Repository navigation
Show front matter, read its fields, and recognize TOML front matter (#195) - #196
Merged
Merged
Conversation
jeff377
enabled auto-merge (squash)
December 4, 2026 16:17
… analyzer findings
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.
Closes #195
What this adds
MarkdownOptions.ShowFrontMatter(off by default). With it off, the output is the same as before. With it on, the YAML (---) or TOML (+++) front matter at the top of a text is shown by bothMarkdownViewers and byMarkdownHtml:titleis drawn like a first-level heading. It is not a heading, so it is left out of the table of contents, find, and outline numbering.date,author/authorsandtags/categoriesgo on one faded line, with the tags drawn as labels.FrontMatterMoreLabelon each viewer, so an application can translate it.MarkdownFrontMatter.Read(string): a public reader whose API uses no Markdig type. It returns the format and the fields (Text,ListorNested).MarkdownHtml.ToPagetakes the front matter'stitlewhenMarkdownHtmlOptions.Titleis not set.+++block is no longer read as paragraphs, andMarkdownEditorcolors it as code.Downstream (Polhem framework)
--pmd-tag-bg, the background of a front matter tag. When it is not set, it falls back to--pmd-code-bg.pmd-front-matter,pmd-front-matter-title,pmd-front-matter-byline,pmd-front-matter-tag,pmd-front-matter-fields,pmd-front-matter-more.FrontMatterMoreLabelon both viewers.+++) used to show that block as paragraphs. Now it is hidden by default, the same way YAML front matter already was.Checks
dotnet build/dotnet test(Release),node --test tests/js/*.test.mjs,./check-md-links.sh, the AOT smoke publish and run, and the WASM gallery publish all pass locally.Expanderdraws its own bottom divider above the front matter's rule. This comes from the theme, not from the package.