JSPM

docutils-plugin-prismjs

1.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q30215F
  • License MIT

Prism.js plugin for docutils

Package Exports

  • docutils-plugin-prismjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (docutils-plugin-prismjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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