func Render
Render implements the gnoweb view.
- "" or "/" : the index, with every scenario summarized.
- "/<key>" : one scenario at the default context width.
- "/<key>/<context>" : the same, with 0 to 6 lines of context.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package myersdiffdemo is a small gnoweb demo of the [p/moul/x/daily/myersdiff](/p/moul/x/daily/myersdiff)(/p/moul/x/d...
gno.land/r/moul/x/daily/myersdiffdemo/v0A gnoweb demo of the p/moul/x/daily/myersdiff
library: four fixed document pairs, each rendered as a unified diff, each
picked to show one property of the algorithm rather than to look impressive.
It holds no diff logic of its own and no state. Every diff line and every count
on the page is computed by the library at render time, so a change in the
algorithm shows up as a diff in ExampleRender rather than as prose nobody
re-reads.
The four scenarios, and why each one is there:
patch. The ordinary case: most of the file untouched. This is the
shape Myers is fast at, and the reason the cost is O((n+m)*d) rather than
O(n*m).insert. Appending to an empty document, so the left side contributes no
lines at all and the header has to say -0,0. That convention is the one
hand-written hunk headers get wrong.move. Four lines reordered. The algorithm compares sequences, so the
answer is a delete and an insert, never a move: the page shows the cost of
that choice instead of claiming it does not exist.starved. Two unrelated documents with the budget set to 2, which is too
small for the real answer. The page reports minimal: no and still reports
that replaying the script reproduces the right-hand document, which is the
property that survives the budget.Append a number to widen the context: /patch/0 prints the changed lines alone
and /patch/6 prints the whole file as one hunk. Out-of-range values are
clamped to 0..6, and anything that is not a number leaves the default.
No caller string reaches the page. The first path segment is matched against
the scenario table by exact equality and an unknown one renders the index; the
second is parsed as an integer and clamped. That is why this realm carries an
untrusted-render opt-out comment rather than an escaper: there is nothing to
escape, and TestNoCallerEchoOnThePage feeds it a link, an image, a gnoweb tag,
a backtick and a newline to keep it that way.
Rendering is deterministic and costs no chain reads, so the page is the same on every node and at every height.
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
Dependency graph:

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.
Package myersdiffdemo is a small gnoweb demo of the p/moul/x/daily/myersdiff(/p/moul/x/daily/myersdiff/v0) library: four fixed document pairs, each showing one behaviour worth knowing before using it in a realm.
It contains no diff logic of its own. Every line of every diff below is computed by the library at render time, so a change in the algorithm shows up here as a diff rather than as prose.
Stateless and fixed-input, so Render is deterministic and pinnable.
untrusted-render: no caller string reaches the page. The path selects a scenario by exact match against the table below, and the only other segment is parsed as an integer and clamped, so an unknown path renders the index instead of echoing anything.