Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bin/build-reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,13 @@ def render_component(components, c):
snippet = section['snippet']
rest, found = split_pitfalls(body_html)
pitfalls.extend(found)
# Use the section's own heading verbatim — no synthetic prefixes.
# The first section in a component that ships a snippet doubles as
# the "minimal example" by convention; readers can tell it from
# later sections by its position, not by an editorial label.
h2 = heading
if not minimal_emitted and snippet:
h2 = 'A minimal example'
minimal_emitted = True
elif snippet:
h2 = f'Refinement: {heading[0].lower() + heading[1:]}' if heading else heading
out.append(f'<h2 id="{slugify(h2)}">{h(h2)}</h2>\n\n')
if rest:
out.append(rest + '\n\n')
Expand Down
Loading