358 pages · ‘the’ 101 mentions
A shared wiki where every word is a page. Write “the big cat” anywhere and “the”, “big” and “cat” each become a page listing everywhere they’re mentioned. Every page is plain text that anyone can write on, and it has no title but its first word: a page starts with its own word, and the first page is just “words”.
What fold does here
Only the writing is stored: a row per paragraph, keyed by its page and an id that survives edits. Pages and backlinks are never stored. Fold explodes each paragraph into the words it mentions, and keeps, for every word, the paragraphs that mention it, how often, and on how many pages. A page exists while it has text of its own or anyone mentions it, so when the last mention of a word is deleted, its page is gone, retracted by fold in the same commit.
Put two or more words in double brackets, like [[Ada Lovelace]], and they make a page of their own. That’s one more row in the same explode: the phrase is counted alongside the words inside it, and the pages, backlinks and counts cover it with no special case. A document lives on the page its first word names, so retyping that word moves the whole document to the new word’s page in one commit, below any text already there; the old page stays only while something else mentions it. Search is a BM25 index over every paragraph, read by the same tokenizer as everything else.
The bar along the bottom is the page’s own words: every page its text makes, in the order they first appear. It’s one more view over the same paragraphs, so a word joins it the moment you finish typing it, and a page that didn’t exist anywhere until then flashes once as it’s born.
Why it shows off fold
Backlinks are usually bookkeeping: a links table the app updates on every save, with orphans to sweep and counts that drift. Here they’re just a view of the text. Edit one paragraph and fold retracts that paragraph’s old words and adds its new ones; nothing else on the page is touched, however long it is. Each change is pushed to everyone reading that page, and to everyone reading the page of a word it mentions.
Worth trying
- Start at the lighthouse and follow its words: each page it mentions lists the others that mention it too, and “supply boat” is a page made only of mentions.
- Type “the big cat” on an empty page and watch each word join the bar along the bottom as you finish it. Click one, or Cmd-click (Ctrl-click) it in the text: its page already lists your sentence.
- Type a word nobody has written before: its tab flashes as its page is born. Open the same page in another window to watch its bar fill in as you type.
- Open a word’s page in another window, and mention it somewhere: the new mention appears as you type.
- Delete the only sentence that mentions an unusual word, then look for its page: it’s gone.
- Change a page’s first word and finish it with a space: the text moves to that word’s page, and anyone still on the old page sees it go.
- Open the inspector while you type: each pause, space or blur is one commit, and only the paragraph you’re in moves.
Still app code
Splitting a page into paragraphs and matching them against what’s stored, so unchanged paragraphs keep their ids; deciding when a retyped first word is finished, and moving the document then; reading words (case, apostrophes, brackets), on the server and again in the page to find the word clicked; telling which pages a save gave birth to; and the snippets around each mention.
Press \ in the app to watch fold's commits as they happen.