Skip to content
Add abbr syntax support to gatsby-remark
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.babelrc.js
.eslintrc.js
.gitignore
.prettierrc.js
.travis.yml
README.md
package.json
yarn.lock

README.md

🎩 gatsby-remark-abbr

Add abbreviation syntax support to Gatsby.

With this plugin, you'll be able to write in your Markdown pages:

The HTML specification
is maintained by the W3C.

_[HTML]: Hyper Text Markup Language
_[W3C]: World Wide Web Consortium

And it'll be converted to:

<p>
  The <abbr title="Hyper Text Markup Language">HTML</abbr> specification is
  maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.
</p>

Installation

  1. Add the package to your project:
  • With yarn:
    yarn add gatsby-remark-abbr
  • With npm:
    npm install gatsby-remark-abbr
  1. Add those few lines into your gatsby-config.js:
    module.exports = {
      plugins: [
        {
          resolve: 'gatsby-transformer-remark',
          options: {
+           plugins: [
+             'gatsby-remark-abbr',
+           ],
          },
        },
    };
  1. Delete .cache/ and reboot gatsby
  2. You can now enjoy markdown abbreviation syntax 🎉

Options

Options can be passed to remark-abbr, check out their full available list to see what is available:

    module.exports = {
      plugins: [
        {
          resolve: 'gatsby-transformer-remark',
          options: {
            plugins: [
-             'gatsby-remark-abbr',
+             {
+               resolve: 'gatsby-remark-abbr',
+               options: { expandFirst: true }
+             },
            ],
          },
        },
    };

License

It's a wrapper around remark-abbr plugin, which is under MIT license.

You can’t perform that action at this time.