diff options
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | tohtml.js | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/package.json b/package.json index 0a8f14a..4bca5d1 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "rehype-raw": "^2.0.0", "rehype-stringify": "^3.0.0", "remark": "^8.0.0", + "remark-custom-blocks": "^2.1.1", "remark-highlight.js": "^5.0.0", "remark-html": "^6.0.1", "remark-kbd": "^1.0.6", @@ -20,6 +20,7 @@ const rehypeKatex = require('rehype-katex'); const rehypeStringify = require('rehype-stringify'); const unified = require('unified'); const remark = require('remark-parse'); +const customBlocks = require('remark-custom-blocks'); function toHTML(data, fnc) { @@ -32,6 +33,29 @@ function toHTML(data, fnc) { .use(math) .use(kbd) .use(sb) + .use(customBlocks, { + information: { + classes: 'special-box information', + title: 'optional' + }, + comment: { + classes: 'special-box comment', + title: 'optional' + }, + attention: { + classes: 'special-box attention', + title: 'optional' + }, + question: { + classes: 'special-box question', + title: 'optional' + }, + good: { + classes: 'special-box good', + }, + bad: { + classes: 'special-box bad', + }}) .use(highlight) .use(html, {allowDangerousHTML: true}) .use(rehypeKatex) |