Skip to content

tategakibunko/nehan-highlight

Repository files navigation

nehan-highlight

nehan plugin for code highlight.

demo

create nehan style

import { PagedNehanDocument, CssStyleSheet } from 'nehan';
import * as HighlightStyle from 'nehan-highlight';

const hljsStyle: CssStyleSheet = HighlightStyle.create({
  selector: "pre>code"
});

const pd = new PagedNehanDocument('<pre><code class="lang-typescript">const x: string = "foo"</code></pre>', {
  styleSheets:[
    hljsStyle, // add highlight style!
  ]
});

use markup

<pre><code class="lang-typescript">
const x: string = "foo";
</code></pre>