markdown-it-tips
v1.0.3
Published
Markdown-it plugin to create tips.
Downloads
22
Maintainers
Readme
markdown-it-tips
Markdown-it plugin to create tips. You can use any type of tip you want, proposed is to use the same type for everything; warning
,error
,success
,info
,danger
or keep the type blank for the default styling of a message.
::: warning
Hello world! [Link](#).
:::
Gets converted to:
<div class="md-tip md-tip-warning" role="md-tip">
<p>Hello world! <a href="#" class="md-tip-link">Link</a>.</p>
</div>
Install
$ npm install markdown-it-tips --save
Usage
Enable plugin
var md = require('markdown-it');
var tips = require('markdown-it-tips');
md().use(tips);
Options
Enable/disable adding class md-tip-link
to links inside tips.
var md = require('markdown-it');
var tips = require('markdown-it-tips');
md().use(tips, {links: false});
Example
With option links
enabled (by default):
This is a test. [Link](#).
::: success
Hello world! [Link](#).
:::
This is a test. [Link](#).
Gets converted to:
<p>This is a test. <a href="#">Link</a>.</p>
<p class="md-tip md-tip-success" role="md-tip">
<p>Hello world! <a href="#" class="md-tip-link">Link</a>.</p>
</p>
<p>This is a test. <a href="#">Link</a>.</p>