npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

jstransformer-highlight

2.0.0

@forbeslindesay

npmHomeRepoSnykSocket
Downloads:23
$ npm install jstransformer-highlight
DailyWeeklyMonthlyYearly

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