Let's see key features: https://yhatt.github.io/markdown-it-incremental-dom/ or
const IncrementalDOM =const md =IncrementalDOM
You can use the recent version through CDN provides by unpkg.com.
We recommend using yarn to install.
$ yarn add markdown-it-incremental-dom
If you wanna use npm, try this:
$ npm install markdown-it-incremental-dom --save
When injecting this plugin by
.use(), you should pass Incremental DOM class as second argument. (
window.IncrementalDOM by default)
const IncrementalDOM =const md =
If it is succeed, 2 new rendering methods would be injected to instance.
You can pass option object as third argument. See below:
incrementalizeDefaultRules: For better performance, this plugin would override a few default renderer rules only when you calls injected methods. If the other plugins that override default rules have occured any problem, You can disable overriding by setting
MarkdownIt.render(src[, env]) but it returns a function for Incremental DOM. It means doesn't render Markdown immediately.
You must render to DOM by using
IncrementalDOM.patch(node, description). Please pass the returned function to the description argument. For example:
const node = documentconst func = md// It would render "<h1>Hello, Incremental DOM!</h1>" to <div id="target">IncrementalDOM
MarkdownIt.renderToIncrementalDOM but it wraps
$ git clone$ yarn install$ yarn build
$ npm publish
⚠️ CAUTION: You should not use
yarn publish when you would publish to npm. It would cause publishing wrong / empty build because the building process on
prepublish will run after packaging.
Yuki Hattori (@yhatt)
This plugin releases under the MIT License.