0.1.1 • Published 2 years ago

remark-code-block v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Remark code block

  • syntax highlighting with refractor which uses PrismJS under the hood.
  • support filename through meta field

  • 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

OptionTypeDefaultDescription
enableLineNumbersbooleantrueAttach line numbers to span elements so you can show them through CSS