remark-code-block
v0.1.1
Published
- [x] syntax highlighting with [refractor](https://github.com/wooorm/refractor) which uses [PrismJS](https://github.com/PrismJS/prism) under the hood. - [x] support `filename` through [`meta` field](https://github.com/syntax-tree/mdast#code)
Downloads
10
Readme
Remark code block
[x] syntax highlighting with refractor which uses PrismJS under the hood.
[x] support
filename
throughmeta
field[x] support line highlighting through
meta
field
Use
import {remark} from 'remark';
import {remarkCodeBlock} from 'remark-code-block';
import js from 'refractor/lang/javascript.js';
// register any languages you want to apply syntax highlighting first
remarkCodeBlock.register(js);
remark().use(remarkCodeBlock);
Options
| Option | Type | Default | Description |
| ------------------- | --------- | ------- | ----------------------------------------------------------------------- |
| enableLineNumbers
| boolean
| true
| Attach line numbers to span
elements so you can show them through CSS |