Skip to content

Commit

Permalink
📚 Use admonitions with docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardfactory committed Mar 13, 2019
1 parent c0e0bdf commit 59f1dbd
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Expand Up @@ -29,7 +29,7 @@ import Remarkable from 'remarkable';
const md = new Remarkable();

import admonitions from 'remarkable-admonitions';
md.use(admonitions({ icon: 'emoji' }));
md.use(admonitions());

md.render(`
:::caution
Expand All @@ -48,6 +48,26 @@ Beware Ogre
*/
```

### With Docusaurus

If you are using [Docusaurus](https://docusaurus.io), you can load the plugin
in `siteConfig.js`:

```js
const siteConfig = {
// ...
markdownPlugins: [
// Highlight admonitions.
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](https://docusaurus.io), you need to download the css from
[docusaurus-admonitions.css](styles/docusaurus-admonitions.css) and place it
into your `custom/` folder.

## Options

You may configure this plugin with the following options:
Expand Down

0 comments on commit 59f1dbd

Please sign in to comment.