The --graph schema section was hand-written into the generated docs/CLI_REFERENCE.md, which the byte-exact drift gate rejects and any regeneration (including the docs-autofix bot) would erase — breaking TestDocsGraphPlanExampleValidates. Long: strings can't carry it either: escapeMDXText would mangle the fenced JSON example. Add a command doc-supplement mechanism: raw Markdown embedded from cmd/bd/help_supplements/ and appended after a command's flags by the docs generator, so regeneration reproduces the section byte-for-byte in both CLI_REFERENCE.md and the per-command create.md page. Document the parent/estimate aliases and their precedence while moving the text. Regeneration also restores the four per-command pages (heartbeat, migrate-personal, reclaim, unclaim) that docs.json already listed but the committed tree was missing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
20 lines
726 B
Go
20 lines
726 B
Go
package main
|
|
|
|
import (
|
|
_ "embed"
|
|
)
|
|
|
|
// Command doc supplements are extra reference Markdown appended after a
|
|
// command's flags in the generated CLI docs (bd help --docs-root and the
|
|
// per-command staging tree). They are embedded sources, not hand edits:
|
|
// regeneration always reproduces them, so the docs drift gate stays
|
|
// byte-exact. Supplements are raw Markdown (fenced code allowed) and are
|
|
// emitted without MDX escaping — keep prose MDX-safe outside code fences.
|
|
|
|
//go:embed help_supplements/create_graph_plan.md
|
|
var createGraphPlanSupplement string
|
|
|
|
// commandDocSupplements maps a cobra CommandPath() to its supplement.
|
|
var commandDocSupplements = map[string]string{
|
|
"bd create": createGraphPlanSupplement,
|
|
}
|