Frontmatter number_headings selects the heading numbering; refs='ids' numbers on request - #60
Draft
PiotrCzapla wants to merge 1 commit into
Draft
Frontmatter number_headings selects the heading numbering; refs='ids' numbers on request#60PiotrCzapla wants to merge 1 commit into
PiotrCzapla wants to merge 1 commit into
Conversation
PiotrCzapla
force-pushed
the
title-numbering-boundary
branch
from
September 3, 2026 20:51
634c419 to
db57d22
Compare
PiotrCzapla
force-pushed
the
frontmatter-numbering
branch
from
September 3, 2026 20:58
ad0cf5f to
a1069e2
Compare
… numbers on request A document's frontmatter `number_headings: legal` (or `decimal`) now drives every exporter when the call gives no scheme: `mdhtml2html` and `mdhtml2typst` read it from the `Mdhtml` result's `meta`, `md2gfm` extracts it from the raw source by the dialect's own rule (new native `frontmatter_meta`), and `viewmd` reads a notebook's frontmatter message through fastcore's `nb_frontmatter` since `dlg2md` fences that raw cell as code. The call argument still wins when both are present. `refs='ids'` (the live-preview mode Solveit renders in) used to skip numbering entirely; a requested scheme now numbers the fragment's headings there too, while nothing numbers automatically without a registry. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PiotrCzapla
force-pushed
the
title-numbering-boundary
branch
from
September 3, 2026 21:01
db57d22 to
48954ee
Compare
PiotrCzapla
force-pushed
the
frontmatter-numbering
branch
from
September 3, 2026 21:01
a1069e2 to
46493bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #59 (the h1 title boundary); the base flips to main once that merges.
What changes
number_headings: legal(ordecimal) selects the heading numbering whenever a call gives no scheme.mdhtml2htmlandmdhtml2typstread it from theMdhtmlresult'smeta;md2gfmextracts it from the raw source by the dialect's own frontmatter rule (new nativefrontmatter_meta). The call argument still wins when both are present. A plain string source carries no meta, so nothing changes for callers passing raw MDHTML.refs='ids'(the live-preview mode Solveit renders in) used to skip numbering entirely. A requested scheme now numbers the fragment's headings there too; nothing numbers automatically without a registry, as before.viewmdon a notebook reads the frontmatter message through fastcore'snb_frontmatter, sincedlg2mdfences that raw cell as code and the parser never sees it.viewmd rspa.ipynbtherefore numbers the whole contract with the scheme the dialog declares.md2html/viewmdhelp text says the default is the frontmatter's scheme.Tests
test_frontmatter_selects_numberingcovers the HTML fallback, argument precedence, the bare-string case, an unknown scheme name raising,idsmode numbering on request and never automatically, GFM, and Typst. Theviewmdtest gains a notebook whose raw frontmatter cell names the scheme. Full suite: 930 passed (the one failure,test_math_callbacks_with_math_core, is the pre-existing missing optional dependency).cargo test,cargo fmt, andchkstyleclean apart from the pre-existing note inchunk.py.🤖 Generated with Claude Code