Adds admonitions parsing support to Remarkable
Installation
With npm:
npm install --save remarkable-admonitions
or with Yarn:
yarn add remarkable-admonitions
Usage
import Remarkable from 'remarkable';
const md = new Remarkable();
import admonitions from 'remarkable-admonitions';
md.use(admonitions());
md.render(`
:::caution
Beware Ogre
:::
`);
With Docusaurus
If you are using Docusaurus, you can load the plugin
in siteConfig.js
:
const siteConfig = {
markdownPlugins: [
require('remarkable-admonitions')({ icon: 'svg-inline' })
]
};
There is a style developed to match its visual appearence (the same you can see
in the preview image up here). Due to Docusaurus CSS loading system, you need to download the css from
docusaurus-admonitions.css and place it
into your custom/
folder.
Options
You may configure this plugin with the following options:
Option | Default | Description |
---|
icon | svg-inline | Allows to use a different method to render admonition icons. By default it uses svg-inline with Octicons icons. Choose emoji to use Emojis instead. |