Prism.js plugin for docutils.
This docutils plugin highlights the content of literal_block elements with Prism.js.
const docutils = require('docutils')
const highlight = require('docutils-plugin-prismjs')
const document = docutils.parse(string, [highlight])The plugin removes the children of every literal_block elements and stores the highlighted code in the html attribute of the element. The plugin retrieves the name of the language form the language attribute. The html attribute will be set to the original code if the language is not supported by Prism.js.
You can install docutils-plugin-prismjs with your npm client of choice.
$ npm install docutils-plugin-prismjsContributions are welcome. The code follows the javascript standard style guide.
$ npm run lintLicense - MIT