vberlier / docutils-plugin-prismjs

Prism.js plugin for docutils.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docutils-plugin-prismjs

Build Status npm

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

About

Prism.js plugin for docutils.

License:MIT License


Languages

Language:JavaScript 100.0%