magu-plugin-toc
Magu plugin that highlight code block use the Highlight.js
Install
yarn add magu-plugin-hljsnpm install magu-plugin-hljs
Usage
;
Register custom language
Use require('magu-plugin-hljs').registerLanguage
.
It is the same as registerLanguage
of Highlight.js.
Please refer to highlightjs.readthedocs.io/en/latest/api.html#registerlanguage-name-language.
Options
selector
(default:'pre > code[class*="lang-"]'
)Selector for obtaining code block elementsselectorMatcher
(default:/lang-([\w_-]+)/
)Regular expression for getting the name of the language from element class
Example
The following .
is simply to make it uninterrupted there.
```jsconsole.log('aiueo');```. ```cssbody { color: orange;}```.
result like this.
console.log('aiueo');body { color: orange;}
License
The MIT License (MIT) Copyright (c) 2016 nju33 nju33.ki@gmail.com