Skip to content

ai/jstransformer-lowlight

Repository files navigation

jstransformer-lowlight

Lowlight support for JSTransformers.

import jstransformer from 'jstransformer'
import lowlight from 'jstransformer-lowlight'

const highlight = jstransformer(lowlight)

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>;'
Sponsored by Evil Martians

Options

  • lang (false): the language of the code if you know it.
  • prefix (hljs-): the class prefix.

About

Lowlight support for JSTransformers

Resources

License

Stars

Watchers

Forks

Packages

No packages published