-
Notifications
You must be signed in to change notification settings - Fork 0
Overview
Open GitHub wikis are uniquely good for documentation: anyone can fix a typo or
add an experience-based how-to, edits are authenticated, reversible, and
accountable, and the open-edit model has proven safe at fleet scale. But wikis
have no real search — GitHub's built-in wiki search is weak, and you can't
bolt a search engine onto a wiki page because GitHub serves it under a strict
Content-Security-Policy that blocks external scripts, eval, and WebAssembly
(so client-side engines like Pagefind are dead on-page).
Search matters because it decouples findability from information architecture: readers stop depending on perfect page organization, and the person who inherits a project can find the one paragraph they need.
Don't migrate docs into something more searchable — keep the wiki and bolt search beside it. wiki-search is three small, decoupled parts:
- A builder turns a wiki's Markdown into a compact, versioned JSON index.
- The index is self-describing: it carries its own
site.urlTemplate, so result links are built mechanically with no hardcoded host. - A search app (and a one-line bookmarklet) loads that index, searches it, and links to the matching section — highlighting the exact phrase where the browser supports it.
Assume nothing; explain everything. A client validates the index's version
and required fields, then uses it — and on any failure (missing index, bad
JSON, unsupported version, missing fields) it shows a specific message rather
than a blank result box. Because the contract is self-describing and versioned,
anyone can adopt it: generate an index from your docs, host it anywhere
CORS-readable, and point the app at it. wiki-search is not GitHub-specific — a
non-GitHub site just ships a different urlTemplate.
See Architecture for how the pieces fit together, and Design Decisions for why it's built this way.