Write a custom extension for markdig #106

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

Originally created by @al1b on GitHub (Mar 30, 2017).

I need to write some custom extentions form markdig, Since I haven't found any documention I need to ask is it possible?
If yes, How I can implement it?

Originally created by @al1b on GitHub (Mar 30, 2017). I need to write some custom extentions form markdig, Since I haven't found any documention I need to ask is it possible? If yes, How I can implement it?
claunia added the question label 2026-01-29 14:27:09 +00:00
Author
Owner

@xoofx commented on GitHub (Mar 30, 2017):

First, I need to know what do you want to do?
Depending on this, you might not need to develop an extension. Many things can be done by just processing the Markdown AST returned by the parser.

If you need to develop an extension, then you need to know if it is going to be a block parser (like a paragraph, a fenced code block...etc.) or an inline parser (emphasis inside a paragraph...etc.), or you will need both.

While there is no documentation for developing an extension, markdig repository is coming with more than 20 extensions that are ranging from very simple one to much more complex, so you can easily learn from these, just my digging a bit into the sourcecode of the extensions, it is well organized and the code is quite commented, so it's not like you have just a black box API without any sourcecode to look at or you couldn't figure out how to do things.

@xoofx commented on GitHub (Mar 30, 2017): First, I need to know what do you want to do? Depending on this, you might not need to develop an extension. Many things can be done by just processing the Markdown AST returned by the parser. If you need to develop an extension, then you need to know if it is going to be a block parser (like a paragraph, a fenced code block...etc.) or an inline parser (emphasis inside a paragraph...etc.), or you will need both. While there is no documentation for developing an extension, markdig repository is coming with more than 20 extensions that are ranging from very simple one to much more complex, so you can easily learn from these, just my digging a bit into the sourcecode of the [extensions](https://github.com/lunet-io/markdig/tree/master/src/Markdig/Extensions), it is well organized and the code is quite commented, so it's not like you have just a black box API without any sourcecode to look at or you couldn't figure out how to do things.
Author
Owner

@copernicus365 commented on GitHub (Jan 3, 2018):

Pointing out the code to the extensions was really helpful, thanks.

@copernicus365 commented on GitHub (Jan 3, 2018): Pointing out the code to the extensions was really helpful, thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#106