Skip to content

Instantly share code, notes, and snippets.

@blacroix
Created May 19, 2018 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blacroix/b24394c230448bcc64b741228ff83e6a to your computer and use it in GitHub Desktop.
Save blacroix/b24394c230448bcc64b741228ff83e6a to your computer and use it in GitHub Desktop.
const toc = require('remark-toc');
module.exports = {
activate() {
const {MDEPreview} = inkdrop.components.classes;
if (MDEPreview) {
MDEPreview.remarkPlugins.push(toc);
}
},
deactivate () {
const { MDEPreview } = inkdrop.components.classes
if (MDEPreview) {
MDEPreview.remarkPlugins = MDEPreview.remarkPlugins.filter(function (plugin) {
return plugin !== toc;
})
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment