Wikidown

Home / Getting Started / Format

Format Specification

Wikidown's on-disk format is deliberately minimal: markdown pages, folder-based hierarchy, and .order navigation files. The goal of this specification is to ensure that a repository's documentation is equally readable by humans browsing the file system, AI agents using the MCP server, and web-based renderers.

By enforcing these rules, Wikidown prevents the link rot and structural drift that typically plagues flat-file documentation.

1. Page Files and Titles

Every page in the wiki is a standard Markdown file (.md). The title of the page is derived directly from its filename by replacing hyphens with spaces.

The reverse is also true: when creating a page titled "Getting Started", the file must be named Getting-Started.md.

2. Subpages and Hierarchy

Wikidown supports infinite nesting of pages. To create subpages for a given parent page, you must create a folder with the exact same base name as the parent page's file, located in the same directory.

This sibling-folder structure ensures that deleting or moving a parent page can easily include all of its children.

Every subpage folder's parent page should exist and should link every child in its body — see § Index pages below. WikiRepository.Write will happily create /Architecture/Data-Model even if /Architecture doesn't exist yet, which silently orphans the whole subtree: wikidown list / wiki_search / wikidown check-links' normal link scan all walk the wiki by descending from already-discovered pages, so a page whose parent was never created is invisible to all of them. check-links catches this specific case — see below.

3. Ordering

Alphabetical sorting is rarely the correct way to read documentation. Wikidown uses .order files to explicitly define the navigation hierarchy.

Every folder in the wiki (including the root /docs folder) should contain an .order file. This is a plain text file that lists the base names of the pages in that folder, one per line, from top to bottom.

Example .order file:

Getting-Started
Architecture
API-Reference

If a page exists in the folder but is not listed in the .order file, it is typically appended to the end of the list alphabetically by the renderer.

.order controls navigation-widget ordering only — it has no effect on GitHub's raw file view, so it's never a substitute for real body links. See § Index pages.

Internal links between wiki pages must be relative file paths, not absolute title paths. GitHub resolves an absolute path like /Architecture/Data-Model against the repository root, not the wiki root, so a link written that way 404s when the page is viewed directly on github.com. A relative path resolves correctly both on GitHub and in Wikidown-aware renderers.

Write the link relative to the linking page's own folder, adjusted for depth, and include the .md extension:

Images and other repo assets follow the same rule, e.g. ![map](../.attachments/map.png).

Run wikidown check-links (see CLI) to walk every page and verify that relative links and image references resolve to real files; by default it also flags any absolute title-path links left in page bodies, and audits that every folder has a linked index page (§ Index pages).

This rule only applies to links inside page bodies. Addressing a page through a tool or the CLI — e.g. wikidown read --path /Getting-Started/Format, wiki_read --path /Getting-Started/Format — still uses the absolute title path, since that's a tool argument rather than a rendered link.

check-links prints one line per issue:

page:line -> target  (reason)

What to do depends on the (reason):

After editing, re-run wikidown check-links to confirm the line is gone.

5. Index Pages

A folder's parent page is that folder's index — the entry point a reader lands on before descending into its children. Two invariants keep that entry point real rather than aspirational, both audited by wikidown check-links (pass --no-index-check to skip this pass):

A page's own breadcrumb links upward to its ancestors, but that's a different direction from this check: the breadcrumb doesn't help a reader on the parent page discover its children, and it doesn't verify the ancestor pages it links to actually exist — a folder missing its index page still gets a breadcrumb pointing at a .md file that isn't there, which is exactly the case index-page auditing is meant to catch.

Every page gets a one-line breadcrumb trail auto-injected as its first line, always leading back to /Home when the wiki has one:

[Home](../Home.md) / [Encounters](../Encounters.md) / The Sky Hunters <!-- wikidown:breadcrumb -->

This exists because GitHub's own file-path breadcrumb (shown above the raw file view) reflects the repository path — docs / Encounters / The-Sky-Hunters.md — not the wiki's page hierarchy or titles. Wikidown's breadcrumb is built purely from the page's own title chain instead: Home (if it exists) leads, then each further ancestor is a link (relative, per the convention above), and the current page's title is the final, unlinked segment — the same shape GitHub uses, just scoped to the wiki rather than the whole repo.

Key behavior:

7. Markdown Dialect

Wikidown relies on standard CommonMark. There are no proprietary macros or shortcodes required to render the core text. An MVP renderer only needs a standard markdown parser plus the filename↔title mapping logic described above.