docs: migrate the manual to a Starlight documentation site #72
Reference in New Issue
Block a user
Delete Branch "docs-starlight-site"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces the hand-maintained
docs/fish-config.mdmonolith and the chunkedHTML/wiki output with a
docs/manual/**source-of-truth tree and an AstroStarlight site built from it.
What changed
New SSOT.
docs/fish-config.mdwas split intodocs/manual/**— one fileper section, one directory for the 14 function categories, each carrying YAML
frontmatter (
title,manTitle,sidebar.order,helpKeywords). Everythingdownstream is generated from this tree.
Generated outputs.
docs/build-manual.pyproduces the concatenatedmarkdown (pandoc's input for the man page) and the Starlight content
collection.
docs/manualtools.pyholds the shared frontmatter/orderinglibrary. A round-trip test asserts the concat reproduces the original file
byte-for-byte, so the man page cannot silently drift.
Retired.
docs/split-wiki.py,docs/wiki/**, and the chunked-HTMLpipeline. The old wiki generator has no remaining callers.
Site. Astro Starlight in
docs/site/, Catppuccin Mocha/Latte, Pagefindfull-text search, deployed to Cloudflare Pages by
.gitea/workflows/build-docs.ymlon push to
main.Syntax highlighting. The manual is authored man-page style — every
synopsis, example, option table, and description sits in one 4-space-indented
block, which declares no language and renders as an unhighlighted grey slab.
The site build now splits each block into paragraphs and classifies them:
synopsis and shell examples become fenced
fish, descriptions become prose,and column-aligned reference tables keep their indentation. 175 blocks
highlight; the 412 lines of genuine tables are untouched.
This transform is site-only.
docs/manual/**keeps the indented form thatpandoc and
config-helpdepend on, and a test fails if a fence is everwritten back to the SSOT.
config-help. Now resolves sections against the manual tree's headingsand gained a
--htmlflag that opens the site.Deployment prerequisite
The Cloudflare Pages project must exist before CI can deploy to it. Create
fish-config-docsin Direct Upload mode and seed it with the pre-builtbundle (
docs/site/dist/, also zipped at~/fish-config-docs-site.zip), thenadd repository secrets
CF_API_TOKEN(scope: Cloudflare Pages: Edit) andCF_ACCOUNT_ID. Until those exist the deploy step fails; nothing else in theworkflow depends on it.
Manual Verification
python3 docs/verify-manual.pyreports 16/16 passingcd docs/site && npx astro buildcompletes and emits 120 pagesnpx astro preview— code blocks on/functions/file-and-directory/rm/are syntax-highlighted in Catppuccin colours, not flat grey
pkgpage keeps its package-manager query table column-alignedrather than fencing it as shell
"Overview", with title-cased category names
mkcd)help configopens the terminal manual and paginateshelp config abbreviationsjumps to the Abbreviations sectionhelp config --manrenders the compiled man page with correct headingshelp config --htmlopens the documentation sitegit diff main -- docs/fish-config.mdshows only regeneration noise,no content loss
Replace .lstrip('\n') with .removeprefix("\n") to preserve body text that legitimately starts with blank lines. The serialize() function inserts exactly one separator newline; removing only that one newline (via removeprefix) rather than all leading newlines (via lstrip) maintains parse/serialize roundtrip losslessness. Adds regression test to verify bodies with leading blank lines roundtrip correctly.