markdig icon indicating copy to clipboard operation
markdig copied to clipboard

Add support for TOML front matter format

Open jonjbar opened this issue 3 years ago • 1 comments

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 ?

jonjbar avatar Aug 06 '21 14:08 jonjbar

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 avatar Aug 06 '21 15:08 xoofx