Member Guide

This guide is for TrickFire members who want to add documentation to an existing project repo.

Prerequisites

  • Node.js 20+
  • pnpm - trickfire-docs dev/build use it to install the docs site's dependencies locally (with the exact patches production builds with)

Setup

1. Scaffold docs files

In your project repo:

Terminal
$ npx trickfire-docs init

This creates:

plaintext
project/
├── docs/
│   └── getting-started.mdx
├── docs.config.json
└── .github/workflows/
    └── docs.yml

It also appends and dist/ to your .gitignore, as this is where build files will get exported if you run npx trickfire-docs build.

2. Configure your project

Edit docs.config.json:

JSON
{
    "$schema": "https://docs.trickfirerobotics.com/docs.config.schema.json",
    "name": "TrickFire CAN",
    "description": "CAN bus driver and protocol library for TrickFire robots."
}

Leave the schema field as it is. It is a reference to the key of the json file for correct syntax highliting. name becomes the project title in the docs navbar dropdown. description shows on the docs homepage.

3. Write your docs

Replace the scaffold MDX files with real content. See Writing Content for the full guide.

4. Preview locally

Terminal
$ npx trickfire-docs dev

This starts a local dev server previewing your project's docs alongside General (org-wide docs) and the TrickFire Docs cli docs - the same view docs.trickfirerobotics.com renders in production. Hot-reload is enabled - edits to docs/ appear instantly. Nothing is generated in your project; the CLI manages a shared cache at ~/.cache/trickfire-docs/ instead.

5. Push to publish

Commit your docs/ folder and docs.config.json, then push to main. The .github/workflows/docs.yml file runs automatically on push and deploys/updates your documentation to the server. Within about a minute, your docs appear at docs.trickfirerobotics.com/<your-repo-name>.

Updating your docs

Just edit files in docs/ and push. The CI workflow handles everything.

Renaming a repo that has docs

When you rename a repo a new subdoc appears with your new repo name automatically on a new CI run. But the old one will not get automatically deleted. Contact the server maintainer to remove it.

Removing a project's docs

To delete a project from the documentation, the content directory needs to be removed from the server, and then the app needs to get rebuilt. To do that SSH into the server and run:

Terminal
$ rm -rf /home/trickfire/docs/content/<repo-name>
$ bash /home/trickfire/docs/scripts/build.sh

The project will disappear from the site.

On this page