gatsby-remark-figure-caption

    2.0.0 • Public • Published

    gatsby-remark-figure-caption

    Package Version Build Status Code Coverage MIT licensed

    transforms: ![image with description](path-to-image.jpg) into:

    <figure>
      <img src="path-to-image.jpg">
      <figcaption>image with description</figcaption>
    </figure>

    Install

    npm install --save gatsby-remark-figure-caption

    How to use

    // In your gatsby-config.js
    plugins: [
      {
        resolve: `gatsby-transformer-remark`,
        options: {
          plugins: [
            {
              resolve: `gatsby-remark-figure-caption`,
              options: {figureClassName: 'md-figure'},
            },
          ],
        },
      },
    ]

    Options

    Name Default Description
    figureClassName '' class for the wrapper figure element
    imageClassName '' class for the wrapped img element
    captionClassName '' class for the wrapped figcaption element

    Disclaimers

    only tested with gatsby v2, it may work on v1.

    not really a good thing a11y-wise:

    PRs welcome.

    Install

    npm i gatsby-remark-figure-caption

    DownloadsWeekly Downloads

    299

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    16.8 kB

    Total Files

    15

    Last publish

    Collaborators

    • leonardodino