docs: generate the Functions Reference from function comment headers #74
Reference in New Issue
Block a user
Delete Branch "docs-option-tables"
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?
Section 5 of the manual is no longer authored in Markdown. It is generated
from the man-page-style comment header already sitting above each function
in
functions/*.fish, so a command's documentation lives beside the codethat implements it and cannot drift from it.
What changed
Two sources of truth, split by content type
docs/manual/**— prose for every section except function entries.functions/*.fishcomment headers — Section 5.The 14 files under
docs/manual/05-functions/are now frontmatter-onlystubs supplying category order, title, and
helpKeywords. Every introparagraph measured zero words before removal — they were pure entry
containers.
New header labels
# CATEGORY— opt-in publishing. A function without one produces noentry. This keeps bundled plugin and prompt internals out of the manual
with no exclusion list to maintain. 96 functions carry it.
# DEPENDENCIES— comma-separated functions or binaries this one calls.The reverse
Used by:index is generated from it, giving the manual anavigable dependency graph that crosses category boundaries.
One-time content merge
Where the old Markdown had prose, examples, or notes the header lacked,
that content was merged into the header before the Markdown was deleted.
No documentation was lost.
Verification (
docs/verify-manual.py, now 24 checks)# CATEGORYfunction produces exactly one entrySYNOPSIS,DESCRIPTION,EXAMPLE# CATEGORYresolves to a stub, and no stub generates zero entries# DEPENDENCIESname is a real function or atype -qbinary##entries# CATEGORYThe round-trip test now excludes Section 5 on both sides, since that
section is generated rather than concatenated.
Fixes carried along
_first_sentence()nowunwraps the hard-wrapped leading paragraph and skips the
Synopsis:block whole — it restated the calling convention the card already shows
as its title.
open-url.fishNOTES claimed "Used internally by config-help --html."It is not;
config-helpcallsxdg-opendirectly. Line removed.git-clean.fishhad a duplicated-fentry in ARGUMENTS.dopsandfzf-updatewere undocumented; both now publish.Expected warning
verify-manual.pyprints:All eight are correct exclusions —
fastis a self-described placeholder,the rest are bundled plugin and prompt internals.
Note on generated files
docs/fish-config.mdis regenerated and committed.docs/fish-config.1is not — pandoc is not installed locally. CI regenerates and
auto-commits it on push; confirm in the job log.
Manual Verification
python3 docs/verify-manual.py→24/24 passedplus the 8-functionwarning above, nothing else.
help config functionsopens Section 5 and the entries readcorrectly in the pager.
help config gitjumps to the git category; spot-check thatgit-cleanshows-h/--helpand-f/--forceexactly once each.docs/fish-config.1was auto-committed.
man fish-configrenders Section 5 with all 96 entries./reference/git-and-version-control/— thecategory card grid lists its functions and each card's description
is a complete sentence, not a truncated clause and not a synopsis.
/reference/ai-and-developer-tools/agy/, confirm theDependencies: link to
agents-initresolves, and thatagents-init's own page shows Used by: linking back to bothagyandclaude(this is the cross-category case).# DESCRIPTION, re-runpython3 docs/build-manual.py --concat, and confirm the changeappears in
docs/fish-config.md— proving the header is the source.# CATEGORYto documented function headers 4c51ef7a33