Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

6. Callout marker syntax

Date: 2026-11-04

Status

Accepted. Implemented in the change that closed issue #77: wrap_callouts in src/project_intake/mod.rs, applied to project bodies and step bodies, with .callout styles in src/assets/listsome.css. The step-body case isn’t working yet, and the last entry under Negative explains why.

Context

docs/recipe-design.md told authors that a paragraph opening with **Warning:** Turn off power at the breaker renders as a styled callout box. Decision record 0004 described the same feature as bold text that starts with a recognized emoji and colon at the start of a paragraph. Those are two different syntaxes, and neither existed. The recognizer didn’t exist, so both documents described a feature listsome didn’t have, and issue #73 opened against the gap.

The constraint that matters is the one decision records 0003 and 0004 both insist on: content is standard CommonMark and renders acceptably wherever Markdown renders. A callout convention must therefore degrade to something a plain Markdown renderer still shows correctly, and it must never reinterpret text the author didn’t mark. A maker writing a bill of materials shouldn’t have their prose about “note the orientation of the pin” turn into a box, and a project viewed on a forge with no listsome style sheet should still read as a project.

Decision record 0004 and the format reference already fix the vocabulary: warning, caution, hot, tip, pro tip, note.

Decision

A callout is a paragraph whose first inline content carries a marker. Two the recognizer accepts two, and a callout needs at least one:

  1. A bold label, as in **Warning:** body and **Pro tip:** body, where the colon sits inside the emphasis. This is the form docs/recipe-design.md already documented, so it stays canonical.
  2. A leading emoji, as in ⚠️ body, and ⚠️ **Warning:** body where both appear. This is the form decision record 0004 described. With an emoji and no label the kind comes from the emoji, and with both the label wins and decides the title.

Warning: body with no bold and no emoji isn’t a callout. Unmarked prose keeps the shape the author gave it, which is the difference between a convention and a guess.

MarkerKindRendered title
**Warning:**callout-warningthe author’s label, as written
**Caution:**, **Hot:**callout-warningas written
**Tip:**, **Pro tip:**callout-tipas written
**Note:**callout-noteas written
⚠️, 🔥callout-warningWarning or Hot
💡callout-tipTip
📝, ℹ️callout-noteNote

Output structure, produced at build time with no JavaScript:

<aside class="callout callout-warning">
  <p class="callout-title">Warning</p>
  <p>Turn off power at the breaker.</p>
</aside>

<aside> because a callout is content parenthetical to the flow it sits in, and because it keeps the paragraph inside it intact for anything that parses the page as HTML. The label becomes a <p class="callout-title"> rather than an aria-label, so the box is still identifiable in a text selection, on a printed page, or in a feed reader that strips classes.

A label that fills the whole paragraph still produces the box, with no empty body paragraph.

Consequences

Positive:

  • Both documented syntaxes work, so whatever an author copied from the reference renders as promised, and both are a shape the author has to write deliberately.
  • Unmarked paragraphs are never rewritten, which keeps the recognizer honest and removes the false-positive class that decision record 0004 listed under its own Negative.
  • In a renderer without listsome’s style sheet the callout is still a legible <aside> with a visible title line: convention, not custom syntax.
  • One pass over the event stream covers project bodies and step bodies, because render_markdown_to_html renders both.

Neutral:

  • The recognized vocabulary is English-only, as decision record 0004 already conceded. The label table is one constant in project_intake, so a localized build can extend it without touching the recognizer.
  • The recognizer compares emoji by character code, so a variation selector or a text-presentation variant changes nothing that matters. An author who types emoji from a picker gets the expected result, and a hand-typed code point may not.

Negative:

  • A bold label that opens a paragraph becomes a box whether or not the author meant it as one. **Availability:** In stock is safe because availability isn’t in the table, but a future label word added to the table changes how existing content renders. The list is therefore deliberately short, and growing it’s a decision-record question rather than a convenience.
  • The pass runs over the event stream, so a callout marker inside a code block or a table cell stays untouched. That’s correct behavior, and it means the same text can be a box in prose and plain text in a code sample.
  • A callout inside a step body doesn’t render yet, for two reasons. extract_steps leaves in_step_header set whenever a non-step heading precedes the first step heading, and that’s the layout docs/recipe-design.md documents, with ## What You'll Need first. Every step in such a project therefore gets an empty body. And because the body is rebuilt from text events, Markdown structure such as bold, links, images, and inline code can’t survive it even once someone fixes the first defect. Issue #86 holds both, and it’s a prerequisite for the step case this decision assumes. Body text outside a step heading keeps its callouts, so a warning paragraph in a project’s introduction renders today.

Corrections: step bodies

The fix for issue #86 landed. extract_steps keeps each step’s body, and Listsome renders that body through the same event pass as the rest of the page. Markdown structure survives, and a materials heading before the first step no longer empties that step. A callout inside a step body now renders as a box. The example project’s snapshot and the step-body tests in src/project_intake/ hold the behavior in place.