npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

gatsby-remark-footnotes

v0.0.8

Published

Customize your gatsby Remark markup footnotes

Downloads

1,398

Readme

Gatsby Remark Footnotes Plugin

gatsby-remark-footnotes

npm

This is a Gatsby Remark plugin that aims to customize the text and style of footnotes in case you want to adhere to the Wikipedia style, ^, front of the footnote-type link.

Installation

With npm:

npm install --save gatsby-remark-footnotes

or with yarn, if that's more your style:

yarn add gatsby-remark-footnotes

Example config

// In gatsby-config.js
plugins: [
  {
    resolve: `gatsby-transformer-remark`,
    options: {
      plugins: [
        {
          resolve: `gatsby-remark-footnotes`,
          options: {
            footnoteBackRefPreviousElementDisplay: "inline",
            footnoteBackRefDisplay: "inline",
            footnoteBackRefInnerText: "^", // Defaults to: "↩"
            //use if you want the Wikipedia style ^ link without an underline beneath it
            footnoteBackRefAnchorStyle: `text-decoration: none;`,
            //use "front" for Wikipedia style ^ links
            footnoteBackRefInnerTextStartPosition: "front",
            useFootnoteMarkerText: false, // Defaults to false
            useCustomDivider: "<hr/><strong>References:</strong>" // Defaults to <hr/>
          }
        }
      ]
    }
  }
];

Plugin Options: in-depth

footnoteBackRefPreviousElementDisplay: the "previous" element is always a <p> tag. Change the CSS display property of it with this prop. Can be omitted if you prefer to not change the display property from the block default, or you have a stylesheet overriding the default already.

footnoteBackRefDisplay: the footnote "back ref" refers to the <a> tag that can be clicked on to bring a user back to the footnote they originated from. Set both this and footnoteBackRefPreviousElementDisplay to inline to have them appear side-by-side. Can be omitted, same as above.

footnoteBackRefInnerText: defaults to . You can use whatever you'd like. Go nuts, replace it with a 👋!

footnoteBackRefAnchorStyle: As in the example above, if you use ^ you'll want to override the text-decoration property (and potentially other ones, like color, if that's your thing) to conform to the Wikipedia style. Can be omitted.

footnoteBackRefInnerTextStartPosition: front for Wikipedia style, otherwise can be omitted.

useFootnoteMarkerText: set to true to use footnote's "marker" (how the footnote is introduced between the Markdown brackets) as the footnote "heading" introducing the footnote in the actual footnote section. Markdown by default auto-numbers footnotes, regardless of how they are introduced; if you use a series of footnotes like so [^1] [^second] [^third] the footnotes will auto number to 1, 2, 3 in the footnote sections. By setting this flag to true, the second and third footnotes would be introduced: second. and third.

useCustomDivider: defaults to <hr/>, can be replaced with HTML of the user's choosing. If set to "" it will remove the horizontal rule.

Targeting your footnotes with further CSS selectors

This plugin appends class names to the elements it produces so that you can further stylize / override the existing CSS.

  • <p> tag: footnote-paragraph class
  • <li> tag: footnote-list-item class
  • <a> tag: footnote-backref class
  • (if using useFootnoteMarkerText config option) <span> tag: footnote-marker-text class

Considerations

This plugin removes nodes from the AST Markdown tree that gatsby-transformer-remark uses to otherwise massage your markdown. This means that other functionality you might rely on from other Gatsby plugins also working on your markdown will probably not work as expected for your footnotes. E.G. you use gatsby-external-link - it's not going to pick up on anchor tags present in your footnotes. This plugin automatically adds target="_blank" rel="noopener noreferrer properties to your anchor tags.

Contributions are welcome!