executablebooks / markdown-it-docutils

A markdown-it plugin for implementing docutils style roles/directives.
https://executablebooks.github.io/markdown-it-docutils/
MIT License
12 stars 8 forks source link

How to extend with new/custom directives/roles/plugins #17

Open rowanc1 opened 2 years ago

rowanc1 commented 2 years ago

Currently this is a dictionary that you pass in to the markdown-it plugin, and if you extend the options, you have to copy all default plugins into the dict.

Other ways to do this could be extending through a setup class/function.

function setup(app: Docutils) {
    app.addDirective('coolDirective', directive)
}

This is similar to how Sphinx works, and would be a layer above markdown-it.