medfreeman / remark-generic-extensions

!Extension[Content](Argument){Properties} -> :tada: — commonmark generic directive extension for remark
Apache License 2.0
25 stars 5 forks source link

remark@next (13) #154

Open wooorm opened 4 years ago

wooorm commented 4 years ago

Hi!

remark is switching to a new parser (and compiler) internally (micromark, remarkjs/remark#536), which will break this plugin. I will create a generic directives plugin though, time permitting, in this month, which would be a good inspiration for “generic extensions”. Keep an eye out that plugin, which will also have micromark and mdast extensions too, and feel free to ask me questions!

wooorm commented 4 years ago

I have created a micromark extension for my interpretation of the generic directive syntax: https://github.com/micromark/micromark-extension-directive And a corresponding utility for mdast: https://github.com/syntax-tree/mdast-util-directive And wrapped ’em all up in: https://github.com/remarkjs/remark-directive

I hope those serve as inspiration: note that you don’t have to split them up in several repos, but that’s how I like to work.

Finally, something like remark-generic-extensions can be done with remark-directive too, where remark-directive handles the syntax and tree, and remark-generic-extensions changes the tree to create HTML?