docutils-plugin-prismjs
v1.3.0
Published
Prism.js plugin for docutils
Downloads
10
Maintainers
Readme
docutils-plugin-prismjs
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.
Installation
You can install docutils-plugin-prismjs
with your npm
client of choice.
$ npm install docutils-plugin-prismjs
Contributing
Contributions are welcome. The code follows the javascript standard style guide.
$ npm run lint
License - MIT