Skip to content

6.2 Docs style guide

These are the visual, component, and editorial rules for the public site in website/, and the prose rules also apply to maintained Markdown elsewhere in the repository. Visual tokens are in website/src/styles/custom.css.

Visual system

The site is dark only. There is no light theme, so the theme is pinned to dark before first paint and the toggle is removed. Never author a color outside the token list.

Surfaces and ink:

TokenValueUse
canvas#141414page background
panel#171717header, sidebar, code background
control#202020inline code and code-tab chrome
hairline#2c2c2cborders and dividers
heading ink#f1f1f1headings and primary labels
body ink#cdcdcdprose
muted ink#a0a0a0standfirsts, breadcrumbs, secondary labels
faint ink#858585tertiary labels

The accent is gold #ffc544 (hover #ffd97a, tint #352b16). Gold marks prose links, the primary action, current navigation, selected language, and keyboard focus, and table headers and inactive navigation use neutral text.

Semantic hues are confined to callout kind labels and left rules: blue #6ca9e7 for information, green #75bb92 for tips, red #e68b99 for danger, orange #e9a46b for warnings, and purple #b29ad9 for derivations. Syntax highlighting keeps the code theme’s token colors.

The site loads no font files. Headings, navigation and body text use the platform UI stack (--font-ui, system-ui first) and code uses the platform monospace stack (--font-mono). Headings use sentence case and describe the task or API directly.

The desktop layout uses a 46px header, a 282px navigation rail, and a content column capped at 1040px. Reference articles have a 250px table of contents on wide screens, listed against a hairline rail with a 2px gold marker on the current heading. Guides place instructions beside code or a screenshot, and these columns stack on narrow screens. Prose is 15px over a 1.65 line height and capped at 78 characters per line, but tables and examples can use the full content width. The homepage has no separate title-panel spacer. Borders are thin, corners are 4 to 7 px, and surfaces have no decorative gradients, shadows, or ambient animation. Hover colors change over 90ms and only carets and directional arrows move, over 160ms, and a prefers-reduced-motion request disables both.

One label style heads every list on the site, which is the UI font at weight 600 and 10.5 to 11px, uppercase, with 0.5 to 0.6px tracking in muted ink. It covers sidebar group labels, table headers, the table-of-contents title, topic-group headings, callout kinds, code-frame captions, the code-language label, and the page-foot links. Asides use a 2px left rule with a label, no box and no fill, but details/summary keeps its border because it is a control.

The user docs are one numbered book defined by sections in website/src/nav.ts: an Introduction row, then the chapters Getting started, How Tempo works, Robot code, Reference, Tempo’s GUI, Troubleshooting, and Common error messages. Pages are numbered through their chapter (1.1, 1.2), so group labels inside a chapter do not restart the count, and a single-page chapter is its own row. The sidebar lists every chapter expanded, with a filter box at the top (the / key focuses it) and the Tempo mark on the current row. Each page has one sidebar entry, and URLs stay independent of navigation labels. Under 800px the sidebar becomes a menu that slides over the page, and the language and WPILib year controls move into it.

The contributor guides in docs/contributing/ form a second book, the Contributing book, served under /contributing/ with the same layout in a red accent. Only the files contributingPages in nav.ts lists are published, in the chapters contributingSections defines. The user header links into it and the last row of the user sidebar leads there, and inside it the red wordmark leads to the Contributing home and the header and the last sidebar row lead back. The docs site guide covers the routes and search scopes.

Page anatomy

Every content page renders, in order:

  1. Breadcrumb (automatic, from the documentation section). On a page inside an ordered group it also names the group and its step position. The code-language control shares this row on desktop and follows the title block on phones.
  2. H1 = the frontmatter title.
  3. Standfirst = the frontmatter description, one sentence in muted text stating the page’s subject or task.
  4. A short opening paragraph stating what the page accomplishes and when it applies. A guide states any required setup before its first runnable example.
  5. H2 sections in sentence case, with no “Overview”/“Introduction”/“Conclusion” headers because the opening paragraph is the overview.
  6. An explicit next action. Set prev and next in frontmatter for a tutorial sequence, which renders the previous/next row. A page without them, other than a section index and the homepage, closes with a Continue row carrying its section index, the task index, and a troubleshooting line. Related links name the task they continue.

Set pageLayout: guide for task walkthroughs and pageLayout: overview for section indexes. Both use tableOfContents: false, so a task guide should stay short enough to scan. The default article layout keeps the on-page contents for long reference and conceptual material. compatibility adds a brief version/field note beside the page description when an example depends on it.

Getting started follows installation (one page per language), drivetrain callbacks, the first route, and verification, and Robot configuration is a reference page beside the steps and is not one of them. GUI authoring has its own first-auto guide and task pages. Shared runtime contracts are in Robot code or Reference, and GUI guides link there instead of duplicating the contract. Preserve old heading anchors when moving material, with a link to the new topic at each retained anchor.

Components

  • Code samples that teams will copy use CodeTabs with all three languages (java, python, cpp) kept semantically identical. Single-language fences are for single-language content (Gradle, TOML, shell).
  • GuideStep pairs its instructions slot with a code example or GuideFigure. Instructions precede the example in source order and on phones. Keep headings and list content outside indented MDX closing tags.
  • Screenshots of Tempo’s GUI go only on the GUI pages and the Introduction. Code pages don’t show the GUI.
  • GuideFigure uses a current screenshot, descriptive alternative text, an optional caption that adds something the alternative text doesn’t, and a full-size image link. Capture examples in an isolated browser workspace. Screenshots must not contain private project paths or suggest that teaching coordinates describe the bundled field.
  • Use a numbered workflow for ordered steps.
  • YearTabs holds content that differs between WPILib 2026 and 2027, with a y2026 and a y2027 slot. Every group follows one stored choice (tempo-docs-year), kept apart from the language choice (tempo-docs-lang). Use it only where the two years say something different, and the 2026 vs 2027 page lists every difference in one place.
  • A page has no screenshot placeholder. A shot goes in as a GuideFigure once it is captured, and scripts/content.test.mjs fails on ScreenshotPlaceholder.
  • Tables hold enumerable facts like methods, tokens, targets and defaults. Explanations go in prose around the table and not inside cells, and the header row stays short.
  • Callouts: callout-info for context, callout-warn for likely errors, callout-tip for shortcuts, callout-danger for data-loss/safety, callout-math for derivations. Each prints its kind as a word, so the kind survives without color, and a title adds a headline under it. Use at most one callout per screen of content.
  • Reference pages use a minimum usage example followed by method/default tables and behavior details. Signature-only listings do not replace a usage example.
  • Use details/summary only for optional detail (long outputs, edge-case walkthroughs) and never to hide the main path.
  • Code-language tabs share one saved preference, associate tabs with their panels, and support arrow, Home, End, Enter, and Space keys. A group without the saved language falls back to its first available language. Code and wide tables scroll within the article on narrow screens.
  • The page-level Code language selector uses the same preference as CodeTabs. Changing either control updates every example, and storage failures must not block language selection. Section breadcrumbs supply production search filters.
  • Search opens on common starting points while its box is empty, keeps the task and troubleshooting exits visible in every state, and moves between results with the arrow keys. The 404 route offers the same exits and opens search.

Writing rules

State behavior, constraints, and evidence directly. Documents must be understandable without access to a conversation, review, or implementation plan.

  • Use periods, commas, or colons instead of em dashes, including list-item and table separators.
  • Use plain sentence openings, and reserve bold for labels that need emphasis and not for the opening phrase of every paragraph or bullet.
  • Remove replies to unstated objections, emphatic qualifications, and unsupported quality claims. A technical contrast must explain an observable difference.
  • Prefer direct verbs such as is and has. Remove introductions that merely announce a fact’s importance.
  • Use task instructions or describe the responsible component. Avoid second-person pronouns and references to the conversation that produced a document.
  • Replace review labels, plan numbers and requirement IDs with the behavior or invariant they name.
  • Keep implementation history in dated records. Maintained guides describe current behavior and commit messages describe changes.
  • Keep maintainer test gates, packaging matrices, and release decisions in docs/contributing/. User guides retain installation steps, robot safety, runtime limitations, and tests teams need for their own autos.
  • Adoption claims are recommendations until teams use Tempo: “most teams should use the bundled pack”, never “most teams use”.
  • Describe coverage in maintained guides. Exact counts, timings, and field results belong in dated records with their workload and verification limits.
  • A copied example defines its values or explicitly identifies itself as a fragment with a link to the complete setup. No unexplained helper functions, ellipsis method bodies, or sample variables masquerading as library APIs.
  • Guides state the result to check after the main task. Command examples explain scheduling, cancellation, ownership, and stop behavior where those affect use.
  • Distinguish teaching field data from the shipped game pack, generated source from runtime robot behavior, and name checks from compiled or executed tests.
  • Per-language spelling in prose matches the tab the reader is in, and neutral prose uses the Java spelling with the Python/C++ twin in parentheses on first use.
  • Code comments state what the line does or the constraint it satisfies. Explain comparisons in the surrounding prose when they affect correct use.
  • No project-layout commentary, except where placement is the lesson. The wiring guide (Tempo.configure in the drivetrain constructor, Tempo.warmup() alone in Robot.java) uses file-labeled samples, and everywhere else only real ordering constraints are stated (“before any route is built”, “set once”).

Project-specific rules

These rules take precedence over the general guidance above.

  • Use task or API names as headings. Delete sentences that add no technical information, instruction, or necessary context.
  • State comparison limits. Tempo is newer and less tested than PathPlanner and Choreo, and comparison pages say so. Replanning is drift-triggered and runs off-thread when configured, so never write “replans every tick” or imply that the standard config enables background planning.
  • The teaching game is REEFSCAPE 2025 per docs-canon.md. Sides are left and right from the blue driver’s view, and “processor side” may gloss the right half. Never “barge side” or “cage side”, because both structures span the full width at midfield. The reef face toward the barge is the back face.
  • Code samples show real robot code. Commands come from subsystems (superstructure.scoreL4()) and are never defined inline. Poses, points and speeds are WPILib geometry in every language (Pose2d, Translation2d, Rotation2d, ChassisSpeeds, with robotpy wpimath.geometry in Python and tempo::wpilib:: in C++). Dashboards are the team’s own SendableChooser fed by setlist.command(), with the LoggedDashboardChooser wrap for AdvantageKit teams.
  • Installation guides use the vendordep workflow.
  • Examples use supported APIs: a team-owned chooser fed by setlist.command() and Tempo.warmup() for Java startup.
  • Put a working example before its explanation where setup permits.

Gates

Review owned Markdown and MDX across the site, contributor guides, and examples against these rules. Include source comments, Python docstrings, generated comment templates, and comments in fenced code examples. Use plain section labels and ASCII markers such as -> and <-. Preserve runtime UI glyphs, test fixture strings, upstream source, licenses, and frozen data.

npm run check in website/ must stay green: astro build, internal links (check:links), content contracts, ASCII punctuation in page prose (check:glyphs), the post-build budgets (test:budget), the C++ snippet check (check:cpp-snippets: each cpp fence must be one that tests/robot/cpp_docs’s DocsSnippetsTest.cpp compiles and runs), and the API fence checker (recognized method calls and import/include names in java/python/cpp fences are checked against the monorepo’s root java/, python/, and cpp/). This is a name check, so verify argument order, types, overloads, and behavior against the implementation as well. External names go in the EXTERNAL list inside website/scripts/check-api.mjs after confirming their source.

After the static build, npm run test:ui verifies navigation, production search, language-tab selection and keyboard controls, copy output, local fonts, and phone/desktop widths. Install Chromium once with npx playwright install chromium, and CI installs the browser before running this gate. Tests serve the existing website/dist/ on a temporary local port and do not create another build directory.

npm run test:content checks sidebar coverage and section lookup, plus parity between the teaching TOML, its downloadable Java/Python/C++ source files, and the guide. It checks tutorial configuration order without claiming to compile or run the robot examples.

esc

Loading search...