โ๏ธ Contributing to the Docs
How to edit, preview, and ship documentation changes.
:::tip TL;DR
- Edit any
.mdinacesense-docs/** - Preview locally:
cd website && pnpm start - Verify before pushing:
pnpm testโ type-checks and builds the site - Open a PR (or commit directly if you're the owner)
- CI runs lint, type-check, build, auth-function tests, links, and freshness :::
๐ Quick setupโ
cd acesense-docs/website
pnpm install
pnpm start # opens http://localhost:3000 with hot reload
The dev server watches the parent acesense-docs/ folder โ any .md edit reloads instantly.
๐งญ Where things liveโ
acesense-docs/
โโโ intro.md # "About these docs" page
โโโ CONTRIBUTING.md # (this file)
โ
โโโ get-started/ # Role-based quickstarts
โ โโโ _category_.json
โ โโโ quickstart.md
โ โโโ frontend-dev.md
โ โโโ ...
โ
โโโ architecture/ # System architecture
โโโ frontend/ # Flutter app docs
โโโ gpu-backend/ # AI pipeline docs
โโโ firebase-functions/ # Cloud Functions docs
โโโ admin/ # Admin panel docs
โโโ annotate/ # Annotation tool docs
โโโ designs/ # Design system
โโโ landing/ # Marketing site docs
โโโ help/ # Troubleshooting + common tasks
โ
โโโ reference/ # Canonical reference material
โ โโโ data-model.md
โ โโโ glossary.md
โ โโโ security.md
โ โโโ observability.md
โ โโโ testing.md
โ โโโ cost.md
โ
โโโ decisions/ # ADRs (Architecture Decision Records)
โ โโโ index.md
โ โโโ template.md
โ โโโ NNNN-short-title.md
โ
โโโ runbooks/ # Incident playbooks
โ โโโ <symptom>.md
โ
โโโ website/ # Docusaurus app (don't edit unless theming)
โโโ docusaurus.config.ts
โโโ sidebars.ts
โโโ src/
โ โโโ pages/index.tsx # Custom homepage
โ โโโ components/
โ โโโ theme/
โ โโโ css/custom.css
โโโ static/
๐ Frontmatter conventionsโ
Every markdown file starts with YAML frontmatter:
---
sidebar_position: 1
title: Data Model
sidebar_label: Data Model
last_verified: YYYY-MM-DD
---
| Field | Purpose | Required |
|---|---|---|
title | H1 heading shown on the page | โ |
last_verified | Date the page was checked against its source of truth | โ |
sidebar_label | Short label in the sidebar (defaults to title) | โ |
sidebar_position | Order within the category (lower = earlier) | โ |
slug | Custom URL path (usually unnecessary) | โ |
tags | Keywords for search | โ |
:::warning Never use slug: / twice
Only src/pages/index.tsx owns the root route. Don't add slug: / to any markdown file.
:::
๐จ Style guideโ
Voiceโ
- Short, direct, active. "Deploy the function" not "The function should be deployed."
- Specific over abstract. "Run
pnpm build" beats "Build the project." - You/your for the reader. "You'll need Python 3.11" not "One needs Python 3.11."
- Link liberally. Cross-link every mention of a concept to its canonical doc.
Structure every page withโ
- One-line tagline (quote block at top)
- TL;DR admonition โ 3-5 bullets a skimmer needs
- Main content with H2s as top-level sections
- Next Steps footer with 3-5 contextual links
Headingsโ
- One H1 per page (the
titlein frontmatter becomes the H1) - H2s = major sections
- H3s = subsections
- Never skip levels (no H2 โ H4)
- Avoid emoji in section IDs (they break anchor links)
Code blocksโ
- Always specify the language:
```bash,```dart,```typescript - Keep examples runnable โ copy-paste should work
- Add comments for non-obvious lines
Tablesโ
- Use tables for key/value data, not prose
- Align columns with
:---:for center,:---for left - Keep rows < 80 chars where possible
๐งฉ Docusaurus features you should useโ
Admonitionsโ
:::tip TL;DR
Quick summary for skimmers.
:::
:::info Tech Stack
Neutral informational block.
:::
:::warning Be careful
Warn readers about footguns.
:::
:::danger Never do this
Critical warnings about destructive actions.
:::
:::note
A side note or context.
:::
Mermaid diagramsโ
Wrap Mermaid code in a mermaid fence:
```mermaid
flowchart LR
A[Start] --> B{Decision}
B -->|Yes| C[Do thing]
B -->|No| D[Skip]
```
Use Mermaid for:
- Flowcharts (decision trees, pipelines)
- Sequence diagrams (request/response flows)
- State diagrams (lifecycles)
- Entity-relationship (data models)
:::warning Mermaid + headings Don't use H1/H2 Markdown headings inside Mermaid code โ they break the parser. :::
Tabsโ
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs>
<TabItem value="macos" label="macOS" default>
`brew install ffmpeg`
</TabItem>
<TabItem value="linux" label="Linux">
`sudo apt install ffmpeg`
</TabItem>
</Tabs>
Internal linksโ
- Use site-relative paths:
[Data Model](/reference/data-model), not../reference/data-model.md - Anchor links:
[Step 3](/runbooks/job-stuck#step-3--did-the-video-actually-upload)
External linksโ
- Add context if the link is slow/heavy:
[RunPod Console](https://www.runpod.io/console/serverless) - Never bare-link in prose (
Check https://foo.bar) โ wrap it
๐ Broken link policyโ
Docusaurus warns on broken links during pnpm build. Treat warnings as errors.
cd website
pnpm build # fails on broken links if you run in CI mode
If you reference a page that doesn't exist yet, link to the nearest existing parent page. Create the new page only when you're adding the real content now.
Never leave a dangling [link](/foo/bar) that 404s.
๐งช Local preview checklistโ
Before pushing:
-
pnpm startโ navigate to every page you touched; visually verify -
pnpm testโ TypeScript clean, build succeeds, and Docusaurus links resolve -
node ../scripts/check-links.mjs --strictโ relative Markdown links resolve -
node ../scripts/check-freshness.mjsโ reviewed pages have an honest date -
cd ../functions && pnpm testโ auth gate and static serving still pass - Dark + light mode both look OK (toggle in navbar)
- Mobile viewport (Chrome DevTools โ responsive) doesn't break
๐ข Deployingโ
After merge:
cd acesense-docs/website
pnpm build
rm -rf ../functions/site
cp -R build ../functions/site
cd ..
firebase deploy --only functions:docs:docsServer,hosting:docs --project acesense-prod
Rollback via Firebase Console โ Hosting โ Release history โ Rollback.
๐ Need help?โ
- Docusaurus docs: docusaurus.io/docs
- Internal: Slack
#acesense-dev - Existing pages as examples โ mimic their structure
Thank you for keeping the docs alive!