Documentation
¶
Overview ¶
Package onboarding reads the two things ONBOARDING.md makes every command in this repo carry — the `example:` block at the foot of its usage banner, and its `### First run` section in README.md — and reduces an output line to the part the README promises. It is the shared half of the tests that pin the standard, so that "the examples run" and "the transcript is what the tool prints" mean the same thing in every binary rather than five similar things.
It holds no assertions of its own: it parses, and the caller's test decides. Nothing here reads a file, so the caller says where the bytes came from.
Index ¶
Constants ¶
const ExampleHeading = "\nexample:\n"
ExampleHeading is the line that opens the runnable block at the foot of a usage banner. Everything under it, up to the first line that is not a command for this tool, is a command a first run can type.
const FirstRunHeading = "### First run"
FirstRunHeading is the README subsection a stranger reads before anything else about a tool.
Variables ¶
This section is empty.
Functions ¶
func ExampleLines ¶
ExampleLines returns the command lines under a usage banner's `example:` heading — those beginning with the tool's own name, whitespace collapsed so a banner may align its flags. It returns an error rather than nothing when the block is missing, because a banner without one is the failure.
func FirstRun ¶
FirstRun returns the lines of the fenced transcript under a tool's `### First run`, which must live inside that tool's own `## <tool>` section.
func Section ¶
Section returns the body of a top-level `## <name>` section of a markdown document, up to the next top-level heading.
func Shape ¶
Shape reduces an output line to the part a README transcript promises: the two-token event prefix, then the field names in order. Everything after the ": " that closes the fields is a run's own business — scores, counts, paths, snippets — and is deliberately not compared, so that a transcript stays a document rather than becoming a fixture. A line that is not an event line (no upper-case first token) reduces to "".
Types ¶
This section is empty.