## Merge order
Standalone; no dependency on the other DOCS-977 PR (task-list
checkboxes).
## Summary
Tracy and Ian flagged the mixed checkbox/emoji styling in the docs
(Slack thread linked from DOCS-977), including the `⚠️ Dangerous`
heading that `scripts/configdocgen` generates from
`codersdk.DeploymentValues`.
The generated configuration reference also has around 130 `h3` headings,
which makes its "On this page" list unreadable.
This PR changes only the generator, `scripts/configdocgen`, and
regenerates `docs/admin/setup/configuration-reference.md` from it.
## Design or Fix
- Emit `toc_depth: 2` frontmatter at the top of the generated page,
before the `<!-- DO NOT EDIT -->` comment.
docs-engine's sync (`packages/docs-build/src/sync.ts`) reads a page's
own frontmatter before stripping it, so this caps the on-page TOC at h2
without any docs-engine change.
- Strip any leading emoji or symbol from generated section headings
(`stripLeadingSymbol`), so the Dangerous heading reads "Dangerous"
instead of "⚠️ Dangerous".
`sectionRank`'s "Dangerous last" ordering still keys off the raw serpent
group name, so ordering is unaffected.
- Render a GitHub `[!CAUTION]` alert directly under the Dangerous
heading, using the group's own codersdk description when it has one,
otherwise a short fallback ("These options can break your deployment or
weaken its security...").
The `⚠️ Dangerous` group name in `codersdk/deployment.go` is unchanged,
because the CLI and other output use it.
## Testing
- `go test ./scripts/configdocgen/...` — 45 passed (7 new/updated cases:
`TestStripLeadingSymbol`, `TestRenderDangerousWithDescription`, and
updated `TestRenderPipeline` assertions for the stripped heading, the
Caution alert, and its position between the heading and the first
option).
- `go vet ./scripts/configdocgen/...` and `gofmt -l
scripts/configdocgen/*.go` — clean.
- `make docs/admin/setup/configuration-reference.md` — regenerated the
page (never hand-edited); this also runs `markdownlint-cli2 --fix` and
`markdown-table-formatter` as part of the make target, both clean.
- `go run ./scripts/docshtmlcheck` — clean.
- Verified with a small Node script against docs-engine's built
`parseFrontmatter`/`extractTitle` (from
`packages/docs-transforms/dist/transform.js`, at the commit that
introduced `toc_depth` support) that a page shaped like the regenerated
one — `toc_depth: 2` frontmatter followed by the `<!-- DO NOT EDIT -->`
comment and then the `# Configuration reference` H1 — parses `toc_depth:
2` and the title correctly.
## QA
Confirmed via the docs-engine sync parser directly (see Testing) that
`toc_depth: 2` is picked up correctly from this file shape.
I did not spin up docs-engine's dev server against this worktree: my
local docs-engine checkout is behind `origin/main` by several commits
including the one that added `toc_depth` support, so a faithful local
preview would first need a docs-engine rebuild against `origin/main`.
Given the direct parser verification above already confirms the
mechanism, I judged the full dev-server rebuild too heavy for the
marginal confidence gained and skipped it.
Expected rendering, based on the diff and docs-engine's documented
`toc_depth` behavior:
- The "On this page" TOC lists only h2 sections (General, Dangerous, and
the rest), not the ~130 option h3s.
- The Dangerous section renders as a plain "Dangerous" heading, followed
immediately by a Caution callout, with no emoji.
## Upstream
No. This is Coder product documentation generation (`codersdk`-driven),
not a Fumadocs engine change.
Linear:
[DOCS-977](https://linear.app/codercom/issue/DOCS-977/docs-replace-emoji-checkboxes-and-emoji-headings-with-one-icon-style)
---
🤖 Built with AI assistance.