[Question] Adding specific attributes NOT related to HTML output #91

Closed
opened 2026-01-29 14:26:11 +00:00 by claunia · 2 comments
Owner

Originally created by @capybarbu on GitHub (Feb 14, 2017).

Hello,

I'm currentlly using Markdown files into an app, without the need of HTML generation.
I'd like to add some kind of header to the markdown file, something like

[HEADER Title="Test01" Format="theFormat" Author="theAuthor"]
# THIS IS A H1 TEST
This is a test

Is there a way to handle this into Markdig without having to pre-parse the document by hand ?

The syntax in the example is not a requirement. Any syntax can do the job.

Thanks for your help

Originally created by @capybarbu on GitHub (Feb 14, 2017). Hello, I'm currentlly using Markdown files into an app, without the need of HTML generation. I'd like to add some kind of header to the markdown file, something like ``` [HEADER Title="Test01" Format="theFormat" Author="theAuthor"] # THIS IS A H1 TEST This is a test ``` Is there a way to handle this into Markdig without having to pre-parse the document by hand ? The syntax in the example is not a requirement. Any syntax can do the job. Thanks for your help
claunia added the question label 2026-01-29 14:26:11 +00:00
Author
Owner

@xoofx commented on GitHub (Feb 14, 2017):

There is no extensions like this in markdig, as metadata are usually quite process dependent, so they are handled at a higher level (text templating layer, header data...etc.) Usually you use something like a YAML frontmatter, but whatever fits your needs (a simple parser for a first line can be sometimes a simpler option)

@xoofx commented on GitHub (Feb 14, 2017): There is no extensions like this in markdig, as metadata are usually quite process dependent, so they are handled at a higher level (text templating layer, header data...etc.) Usually you use something like a YAML frontmatter, but whatever fits your needs (a simple parser for a first line can be sometimes a simpler option)
Author
Owner

@capybarbu commented on GitHub (Feb 14, 2017):

Oh, YAML seems a good choice, I'll dig it. Thanks

@capybarbu commented on GitHub (Feb 14, 2017): Oh, YAML seems a good choice, I'll dig it. Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#91