0.2.0 • Published 4 years ago

markdown-it-figure v0.2.0

Weekly downloads
13
License
Apache-2.0
Repository
github
Last release
4 years ago

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>