All Projects → jstransformers → Jstransformer Highlight

jstransformers / Jstransformer Highlight

Licence: mit
Highlight.js support for JSTransformers.

Programming Languages

javascript
184084 projects - #8 most used programming language

jstransformer-highlight

Highlight.js support for JSTransformers.

Build Status Coverage Status Dependency Status Greenkeeper badge NPM version

Options

  • lang - The language the code is in
  • auto - defaults to true if lang is undefined. Set this to true to have highlight.js auto-detect the language. Set this to false to disable auto-detection even when there is no lang option.

Example

var highlight = require('jstransformer')(require('jstransformer-highlight'))

highlight.render('var i = 5 + 10;', { lang: 'javascript' }).body
//=> '<span class=\"hljs-variable\"><span class=\"hljs-keyword\">var</span> i</span> = <span class=\"hljs-number\">5</span> + <span class=\"hljs-number\">10</span>;'

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].