Skip to main content

โœ๏ธ Contributing to the Docs

How to edit, preview, and ship documentation changes.

:::tip TL;DR

  1. Edit any .md in acesense-docs/**
  2. Preview locally: cd website && pnpm start
  3. Verify before pushing: pnpm test โ€” type-checks and builds the site
  4. Open a PR (or commit directly if you're the owner)
  5. 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
---
FieldPurposeRequired
titleH1 heading shown on the pageโœ…
last_verifiedDate the page was checked against its source of truthโœ…
sidebar_labelShort label in the sidebar (defaults to title)โŒ
sidebar_positionOrder within the category (lower = earlier)โŒ
slugCustom URL path (usually unnecessary)โŒ
tagsKeywords 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โ€‹

  1. One-line tagline (quote block at top)
  2. TL;DR admonition โ€” 3-5 bullets a skimmer needs
  3. Main content with H2s as top-level sections
  4. Next Steps footer with 3-5 contextual links

Headingsโ€‹

  • One H1 per page (the title in 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>
  • 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)
  • 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

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!