jstransformer-highlight

2.0.0 • Public • Published

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

/jstransformer-highlight/

    Package Sidebar

    Install

    npm i jstransformer-highlight

    Weekly Downloads

    67

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    4.19 kB

    Total Files

    5

    Last publish

    Collaborators

    • calebeby
    • forbeslindesay
    • hemanth
    • robloach
    • stoeffel
    • timothygu