https://github.com/commenthol/markdown-it-admon
Plugin to create admonitions for markdown-it markdown parser
https://github.com/commenthol/markdown-it-admon
Last synced: over 1 year ago
JSON representation
Plugin to create admonitions for markdown-it markdown parser
- Host: GitHub
- URL: https://github.com/commenthol/markdown-it-admon
- Owner: commenthol
- License: mit
- Created: 2021-07-02T15:12:37.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-29T08:45:18.000Z (over 2 years ago)
- Last Synced: 2025-02-09T14:15:31.874Z (over 1 year ago)
- Language: HTML
- Size: 182 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-admon
> Plugin for creating admonitions for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.
With this plugin you can create admonitions like:
```
!!! warning
*here be dragons*
```
Markdown syntax follows [python-markdown][].
[rST][] suggests the following "types": `attention`, `caution`, `danger`, `error`, `hint`, `important`, `note`, `tip`, and `warning`; however, you’re free to use whatever you want.
A styles file does support the following admonition types: Credits go to [vscode-markdown-extended][].
```
'note',
'summary', 'abstract', 'tldr',
'info', 'todo',
'tip', 'hint',
'success', 'check', 'done',
'question', 'help', 'faq',
'warning', 'attention', 'caution',
'failure', 'fail', 'missing',
'danger', 'error', 'bug',
'example', 'snippet',
'quote', 'cite'
```

## Installation
node.js:
```bash
$ npm install markdown-it-admon --save
```
## API
```js
const md = require('markdown-it')()
.use(require('markdown-it-admon') [, options]);
```
Params:
- __name__ - container name (mandatory)
- __options?:__
- __render__ - optional, renderer function for opening/closing tokens.
## License
[MIT](./LICENSE)
## References
* [python-markdown][python-markdown]
* [rST][rST]
* [vscode-markdown-extended][vscode-markdown-extended]
[python-markdown]: https://python-markdown.github.io/extensions/admonition/
[rST]: https://docutils.sourceforge.io/docs/ref/rst/directives.html#specific-admonitions
[vscode-markdown-extended]: https://github.com/qjebbs/vscode-markdown-extended