foldrun-docs
docs.foldrun.io. The documentation: the markdown, the grouping, and the static site that publishes them.
npm install
npm run dev # http://localhost:4340
npm run check # types, including the .astro files
npm run build # → dist/, plain HTML
The markdown at the root is the source
agents.md, flows.md, api.md and the rest sit at the top of this repo
because they are what an engineer reads in a checkout. Three renderers stand
over them and none of them copies:
| where | who reads it |
|---|---|
| this Astro site | anyone, signed in or not |
the dashboard’s /dashboard/docs |
people who have signed up |
| a checkout | whoever is in the code |
That is the whole reason the docs are their own repo. Four tests in
foldrun-web/tests/consistency.test.ts fail the build when api.md stops
naming a route that exists, or when a flow option is parsed and undocumented.
A second copy of these files would render perfectly and be outside every one
of those tests.
index.ts is the editorial part
Which docs a person needs first, and in what order, is not derivable from the
directory — so index.ts holds the grouping, plus the rules for reading a
title and a summary out of the markdown. The dashboard imports the same file
through a tsconfig alias. Adding foo.md and naming it in a group puts it in
the sidebar of both, with no other change.
The shell is a near-copy of foldrun-site’s
src/layouts/Page.astro, src/lib/site.ts and src/styles/global.css are
about seventy lines of header, footer and type, duplicated on purpose: the two
sites are separate projects on separate domains, and sharing a component would
mean sharing a build. When one changes, change both — they are meant to look
like one product.