markdown-it-tips

1.0.3 • Public • Published

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>

Package Sidebar

Install

npm i markdown-it-tips

Weekly Downloads

8

Version

1.0.3

License

MIT

Unpacked Size

4.78 kB

Total Files

4

Last publish

Collaborators

  • zllunpm