This repository contains source files for generating documentation using Docusaurus.
The site is published to https://docs.westonrobot.com by the Deploy Docusaurus site to GitHub Pages workflow on every push to main.
Make sure you have docker and docker compose set up properly. You can refer to the instructions here. Then you can build and run the app:
docker compose upYou should be able to access the site at: http://localhost:3000
Dependencies are installed inside the container rather than into your working tree, and re-checked on every start, so a git pull that changes package.json needs no extra step from you.
Use the container or the host, not both. Docusaurus writes absolute paths into
.docusaurus/, so a cache generated by a host-sidenpm run buildwill make the container fail withModule not found, and vice versa. When switching between them, clear the cache first:rm -rf .docusaurus build
Docusaurus requires Node.js 20.0 or higher. The version this project targets is pinned in .nvmrc, and CI reads that same file, so nvm use gives you exactly what CI runs.
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"
# Install the version pinned in .nvmrc (run from the repository root):
nvm install
nvm use
# Verify:
node -v
npm -vnvm ships its own npm, so there is no need to apt install npm.
Install dependencies from the lockfile, then start the dev server with hot reload:
cd <this-repository>
npm ci
npm run startDocumentation is split into six independent Docusaurus docs plugin instances, each with its own sidebar file:
| Section | Content directory | Sidebar |
|---|---|---|
/support |
support/ |
sidebars-support.ts |
/robot |
robot/ |
sidebars-robot.ts |
/peripheral |
peripheral/ |
sidebars-peripheral.ts |
/system |
system/ |
sidebars-system.ts |
/solution |
solution/ |
sidebars-solution.ts |
/tutorial |
tutorial/ |
sidebars-tutorial.ts |
The general and software sections were dissolved; docusaurus.config.ts keeps redirects for their old URLs, because support engineers paste them into tickets.
The landing page is src/pages/index.tsx.
This file gets the site running. CONTRIBUTING.md is what to
do once it is: editing a page, adding a product, publishing a downloadable
document, adding a video, moving a URL, recording a decision — and the checks
to run before opening a pull request.