Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jlengstorf/gatsby-remark-numbered-footnotes

A small plugin to change named footnotes to numbered footnotes in your Gatsby pages using Markdown.
https://github.com/jlengstorf/gatsby-remark-numbered-footnotes

gatsby gatsby-plugin gatsbyjs remark

Last synced: 3 months ago
JSON representation

A small plugin to change named footnotes to numbered footnotes in your Gatsby pages using Markdown.

Awesome Lists containing this project

README

        

# gatsby-remark-numbered-footnotes

This is a plugin for [`gatsby-transformer-remark`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark) that converts footnote reference links to sequential numbers.

It’s a lightweight wrapper around `remark-numbered-footnotes` to make it work with Gatsby.

## Installation

```bash
yarn add gatsby-remark-numbered-footnotes
```

In `gatsby-config.js`, add:

```diff
module.exports = {
plugins: [
{
resolve: 'gatsby-transformer-remark',
options: {
+ plugins: [
+ 'gatsby-remark-numbered-footnotes',
+ ],
},
},
],
};
```

## Example Output

In [Remark](https://remark.js.org/), it’s possible to add footnotes in Markdown like this:

```md
This is normal body copy.[^also] It includes a couple footnotes.[^thing]

[^also]:
This is a footnote.

[^thing]:
This is another footnote.
```

By default, this will generate the following HTML:

```html


This is normal body copy.

also

It includes a couple footnotes.

thing







  1. This is a footnote.





  2. This is another footnote.






```

With `gatsby-remark-numbered-footnotes`, the markup will change to:

```diff


This is normal body copy.
-
+
- also
+ 1

It includes a couple footnotes.
-
+
- thing
+ 2






    -

  1. +


  2. This is a footnote.


    -
    +

  3. -

  4. +


  5. This is another footnote.


    -
    +



```