exportFiles(cb: Codebase, ns: string, dir: string, own?: boolean) => number
Write the files kept under `ns` to `dir`, laid out by their names (`ns.a.b` is `a/b.<format>`), and the file named `ns` itself, if there is one and `own`, as `<its name>.<format>`: how many.
A file kept in the codebase as written, as a definition named `name`. Markdown's `{@link}`s to code are references by hash, so they read with current names and follow updates; its links to other files are kept as written, and checked: one to a file of the codebase that isn't there (and isn't among `alsoNew`) is a warning. A binary format's bytes are kept as base64. `format` is a hidden file's after a dot (`.gitignore` is ".", `.mcp.json` ".json"), kept so in its IR, as it's written back.
A file's name in its namespace: its name without the extension (dashes kept; no dots), and without the dot a hidden file's name starts with (`.gitignore` is `gitignore`, `.mcp.json` is `mcp`).
followMove(cb: Codebase, from: string, to: string) => Map<string, DefRecord>
After the file `from` moved to `to`: the pages whose links change, as new definitions, by name.
The file in the codebase a page's link reaches, by its name (and the rest of the link: `#anchor`), or undefined for a link that isn't to such a file (a URL, the same page, code, somewhere outside the codebase).
A page's text with its links following a move: links to `from` lead to `to`, and if the page is the one that moved (`name` was `from`), its links to others are written from where it is now. Undefined if nothing changes.
A file's name on disk: its name in the codebase, and its format as the extension (none for a file without one, like `Dockerfile`), after a dot for a hidden file (`.gitignore`, `.mcp.json`).
A file definition's format, from its IR: its extension ("" for a file without one, like `Dockerfile`), without the dot a hidden file's starts with (`fileName` puts it back).
Where a Markdown file links, outside code (fences and inline code): `[text](target)`, `[label]: target`, and `@link` tags naming code (`code`). Offsets are the target's.
A file's format is its extension (none for a `Dockerfile`), after a dot for a hidden file, so it's written back with it; what reads a format sees it without the dot, and a file that isn't hidden is kept as it always was.