From b6b66b9fe10a82b44884be3e27941bd6ab020715 Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 14 Apr 2018 04:14:43 +0200 Subject: Ajout de remark-custom-blocks --- tohtml.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tohtml.js') diff --git a/tohtml.js b/tohtml.js index 1d0ae2c..b18c944 100644 --- a/tohtml.js +++ b/tohtml.js @@ -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) -- cgit v1.2.3