git submodule init
git submodule update --recursive --remote- Node.js 20 or higher
- npm (comes with Node.js)
npm installnpm startThis command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
npm run buildIf you encounter build errors:
npm run clear # Clear Docusaurus cache
npm install # Reinstall dependencies
npm run build # Try building againThe site is Docusaurus, built from the Markdown in docs/. The pages come from the docs/ folder of three projects,
tracked as submodules in projects/: ferrum,
cuprite and vessel.
Docs are published on release, not on every commit to a project's main:
- A
v*tag is pushed in a project repo. - That repo's
.github/workflows/docs.ymlsends adocs-releaserepository_dispatchevent to this repo, with the project name and tag. .github/workflows/sync.ymlhere checks outprojects/<name>at the tag, runsrake sync_docs(deletes the project'sdocs/<name>/*.md, then copiesprojects/<name>/docs/*.md), commitsdocs(<name>): sync docs for <tag>tomasterand triggersdeploy.yml.deploy.ymlbuilds the site and publishes it to GitHub Pages.
If nothing changed, the sync exits without a commit or deploy. Deploy is triggered explicitly because pushes made with
GITHUB_TOKEN don't trigger other workflows.
Run it from the Actions tab (Sync docs), or:
gh workflow run sync.yml -f project=ferrum -f tag=v0.20.1The tag must look like v1.2.3. It must contain a docs/ folder, otherwise the project is skipped. To redeploy
without syncing, run the Deploy to GitHub Pages workflow.
- Add the submodule and a
projectsentry in theRakefile. - Add the project to the allowlist and choices in
.github/workflows/sync.yml. - Copy
.github/workflows/docs.ymlfrom another project, change theprojectvalue and add theDOCS_DISPATCH_TOKENsecret.
- Token expiry. The project repos authenticate with the
DOCS_DISPATCH_TOKENsecret, a fine-grained PAT with Contents: write on this repo (1 year max). When it expires, the dispatch fails in the project'sDocsworkflow and the site silently stops updating. Create a new PAT, then update the secret in each project repo (or at org level):gh secret set DOCS_DISPATCH_TOKEN --repo rubycdp/<project>. - Docs lag releases. Changes merged to a project's
mainappear only after the next release tag. - No tag, no docs. A project with docs but no release containing them (vessel before
v0.3.1) stays at the submodule commit recorded here until it is tagged. - Don't edit
docs/<project>/*.mdhere. The next sync overwrites it. Fix it in the project repo._category_.jsonfiles are kept and are edited here. - Default branch is
master. The workflows push to and deploy from it.