Add support for TOML front matter format #475

Open
opened 2026-01-29 14:37:45 +00:00 by claunia · 1 comment
Owner

Originally created by @jonjbar on GitHub (Aug 6, 2021).

It looks like the current version of markdig can only support the Yaml front matter format. However, the Hugo static web-site generator also supports the Toml format identified by opening and closing +++.
Can the existing Yaml front matter parser be extended to support that feature ? If not, would you consider implementing a Toml front matter parser ?

Originally created by @jonjbar on GitHub (Aug 6, 2021). It looks like the current version of markdig can only support the Yaml front matter format. However, the [Hugo](https://gohugo.io/) static web-site generator also supports the [Toml format](https://gohugo.io/content-management/front-matter/#front-matter-formats) identified by opening and closing +++. Can the existing Yaml front matter parser be extended to support that feature ? If not, would you consider implementing a Toml front matter parser ?
claunia added the enhancementPR Welcome! labels 2026-01-29 14:37:45 +00:00
Author
Owner

@xoofx commented on GitHub (Aug 6, 2021):

The Yaml extension in Markdig is not a fully fledged Yaml parser - and is likely incorrect. I would not recommend to use this method for properly separating Markdown content from a frontmatter content, but instead perform the parsing separately upfront with the different parsers.

Can the existing Yaml front matter parser be extended to support that feature ?

Yes, It could.

If not, would you consider implementing a Toml front matter parser ?

Probably better to rename Yaml extension to a frontmatter extension and allow extensibility here.

Don't have personal spare time/interest for this feature, but PR welcome.

@xoofx commented on GitHub (Aug 6, 2021): The Yaml extension in Markdig is not a fully fledged Yaml parser - and is likely incorrect. I would not recommend to use this method for properly separating Markdown content from a frontmatter content, but instead perform the parsing separately upfront with the different parsers. > Can the existing Yaml front matter parser be extended to support that feature ? Yes, It could. > If not, would you consider implementing a Toml front matter parser ? Probably better to rename Yaml extension to a frontmatter extension and allow extensibility here. Don't have personal spare time/interest for this feature, but PR welcome.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#475