Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nunof07/markdown-it-alerts

Markdown-it plugin to create Bootstrap alerts
https://github.com/nunof07/markdown-it-alerts

bootstrap markdown markdown-it

Last synced: 9 days ago
JSON representation

Markdown-it plugin to create Bootstrap alerts

Awesome Lists containing this project

README

        

# markdown-it-alerts
[Markdown-it][markdown-it] plugin to create [Bootstrap alerts][bootstrap-alerts].

E.g.:

```md
::: warning
Hello world! [Link](#).
:::
```

Gets converted to:

```html


Hello world! Link.



```

## Install

```bash
$ npm install markdown-it-alerts --save
```

## Usage

### Enable plugin

```js
var md = require('markdown-it');
var alerts = require('markdown-it-alerts');

md().use(alerts);
```

### Options

Enable/disable adding class `alert-link` to links inside alerts.

```js
var md = require('markdown-it');
var alerts = require('markdown-it-alerts');

md().use(alerts, {links: false});
```

### Example

With option `links` enabled (by default):

```md
This is a test. [Link](#).

::: success
Hello world! [Link](#).
:::

This is a test. [Link](#).
```

Gets converted to:

```html

This is a test. Link.



Hello world! Link.



This is a test. Link.


```

[markdown-it]: https://github.com/markdown-it/markdown-it
[bootstrap-alerts]: http://getbootstrap.com/components/#alerts