nehan-highlight
Version:
nehan plugin for code highlighting
31 lines (22 loc) • 629 B
Markdown
[](https://github.com/tategakibunko/nehan) plugin for code highlight.

```typescript
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!
]
});
```
```html
<pre><code class="lang-typescript">
const x: string = "foo";
</code></pre>
```