docs/README.md
This repository contains the markdown files which are used to display documentation on our website. This documentation is built using Docusaurus.
To make changes to our docs, you can open a pull request in this repository. You can typically edit the files directly using the GitHub web interface, but you can also clone our repository and make your edits locally.
git clone ssh://[email protected]/<username>/SpacetimeDB
cd SpacetimeDB/docs
git add .
git commit -m "A specific description of the changes I made and why"
git checkout -b a-branch-name-that-describes-my-change
git push -u origin a-branch-name-that-describes-my-change
To regenerate the CLI reference section, run pnpm generate-cli-docs.
For more information on how to use Docusaurus, see the Docusaurus documentation.
docs directory.pnpm installpnpm dev, which will start a local server and open a browser window.
All changes you make to the markdown files will be reflected live in the browser.Use Docusaurus versioning to snapshot the current docs into versioned_docs.
docs/, cut a version:pnpm docusaurus docs:version <version-name>
Example:
pnpm docusaurus docs:version 1.12.0
This updates:
docs/versions.jsondocs/versioned_docs/version-<version-name>/docs/versioned_sidebars/version-<version-name>-sidebars.jsonAfter cutting, update docs/docusaurus.config.ts as needed:
lastVersion for the default version at /docsversions.current label/path for prerelease docsversions['<version-name>'] label/banner for the stable snapshotIf you need a version snapshot from an old commit (instead of current docs/docs), use:
./docs/scripts/get-old-docs.sh <commit> <version-name>
Example:
./docs/scripts/get-old-docs.sh e45cf891c20d87b11976e1d54c04c0e4639dbe81 1.12.0
The script creates a temporary worktree, snapshots docs from that commit, and copies the generated versioned_docs artifacts back into your current branch.
Absolute links like /quickstarts/react can resolve to the default docs version. To keep links inside the current version, rewrite internal links to relative paths.
Dry run:
pnpm --dir docs rewrite-links
Apply changes:
pnpm --dir docs rewrite-links:write
This script rewrites internal absolute links in:
docs/docs (current/prerelease docs)docs/versioned_docs/version-* (all version snapshots)All of our directory and file names are prefixed with a five-digit number which determines how they're sorted. We started with the hundreds place as the smallest significant digit, to allow using the tens and ones places to add new pages between. When adding a new page in between two existing pages, choose a number which:
For example, if you want to add a new page between 00300-foo and 00400-bar, name it 00350-baz. To add a new page between 00350-baz and 00400-bar, prefer 00370-quux or 00380-quux, rather than 00375-quux, to avoid populating the ones place.
To add a new page after all previous pages, use the smallest multiple of 100 larger than all other pages. For example, if the highest-numbered existing page is 01350-abc, create 01400-def.
This documentation repository is licensed under Apache 2.0. See LICENSE.txt for more details