Configuring Markdown It

You can access the internal instance of MarkdownIt at acetate.renderer.markdown in your configuration file. This means you can easily use MarkdownIt plugins](https://www.npmjs.com/package/markdown-it-toc-and-anchor) by simply registering them in your configuration file.

acetate.config.js

const markdownItTocAndAnchor = require('markdown-it-toc-and-anchor').default;

module.exports = function (acetate) {
  acetate.renderer.markdown.use(markdownItTocAndAnchor);
}

You can also replace the MarkdownIt instance entirely by making a new instance and assigning it to acetate.renderer.markdown.

acetate.config.js

module.exports = function (acetate) {
  acetate.renderer.markdown = new MarkdownIt({
      html: true,
      linkify: true,
      typographer: true
    });
  }
}

Edit this Page on GitHub