markdown-it-figure

0.2.0 • Public • Published

Markdown It Figure

Markdown-It plugin that allows you to add <figure>s with <figcaption>s to your Markdown.

Usage

Markdown-It Config

const markdown = require('markdown-it');
 
const md = markdown({
  /* ... markdown-it options */
}).use(require('markdown-it-figure'));

Markdown

  • #[Caption](/url/to/image.png) - Basic figure. Outputs <figure><img src="/url/to/image.png"><figcaption>Caption</figcaption></figure>
  • #1234[Caption](/url/to/image.png [Alt Text]) - Advanced figure, including a figure number and alt text for image. Outputs figure id="figure-1234"><img src="/images/foo.png" alt="Alt Text"/><figcaption><p><span class="figure-id">1234: </span>Caption</p></figcaption></figure>

Package Sidebar

Install

Weekly Downloads

27

Version

0.2.0

License

Apache-2.0

Unpacked Size

6.9 kB

Total Files

9

Last publish

Collaborators

  • snugug