mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Write a custom extension for markdig #106
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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?
@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.
@copernicus365 commented on GitHub (Jan 3, 2018):
Pointing out the code to the extensions was really helpful, thanks.