Skip to content

rbottomley/markdown-it-figure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown It Figure

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

Install

npm install @rbottomley/markdown-it-figure

Usage

Markdown-It Config

const markdown = require('@rbottomley/markdown-it');

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

Basic figure

Markdown

#[Caption](/url/to/image.png)

Generated HTML

<figure>
  <img src="/url/to/image.png" />
  <figcaption>Caption</figcaption>
</figure>

Advanced figure

Includes a figure number and alt text for image.

Markdown

#1234[Caption](/url/to/image.png [Alt Text])

Generated HTML

<figure id="figure-1234">
  <img src="/images/foo.png" alt="Alt Text" />
  <figcaption>
      <span class="figure-id">1234: </span>
      Caption
  </figcaption>
</figure>

Changelog

1.0.1

  • update dependencies.

1.0.0

  • remove P tag from FIGCAPTION output.

0.2.0

  • fork from @chromeos/static-site-scaffold-modules.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors