gatsby-remark-reference-footnotes

0.0.4 • Public • Published

Footnotes in Gatsby

Downloads

Gatsby plugin using remark to generate footnotes with advanced grouping.

Installation

npm i gatsby-remark-reference-footnotes

Use

Generate footnotes:

[^Normal footnote]
 
<!-- This code block gets replaced with footnotes -->
 
```references
 
```

Generate footnotes for a specific group of footnotes:

[^:fig:Footnote for group named fig]
 
<!-- This code block gets replaced with footnotes for group `fig` -->
 
```references
group-include: fig
```

If you like to overwrite the global settings in place (camelCase or kebab-case):

<!-- This code block gets replaced with footnotes -->
 
```references
group-include: fig
 
inline-link-prefix: ' Fig. '
inline-link-suffix: '.'
inline-text-prefix: ' '
inline-text-suffix: ''
 
reference-link-position: end
 
reference-link-prefix:  ' Fig. '
reference-link-suffix:  '.⇡'
reference-text-prefix:  ' '
reference-text-suffix:  ''
```

Global Configuration

Global configurations can be set in gatsby-config.js.

module.exports = ({ root }) => ({
  plugins: [
    {
      resolve: `gatsby-transformer-remark`,
      options: {
        plugins: [
          {
            resolve: `gatsby-remark-reference-footnotes`,
            options: {
              groupInclude: "default",
 
              inlineLinkPrefix: "",
              inlineLinkSuffix: "",
              inlineTextPrefix: "",
              inlineTextSuffix: "",
 
              referenceLinkPosition: "start",
 
              referenceLinkPrefix: "↑ ",
              referenceLinkSuffix: ".",
              referenceTextPrefix: "",
              referenceTextSuffix: " "
            }
          }
        ]
      }
    }
  ]
});

Options

group-include

string? — default: default
If a footnote reference starts with :groupname: the output can be filtered by this group-name.

reference-link-prefix

string? — default: Footnote: in link before reference number

reference-link-suffix

string? — default: . Footnote: in link after reference number

reference-text-prefix

string? — default: '' Footnote: text before reference link

reference-text-suffix

string? — default: ' ' Footnote: text after reference link

reference-link-position

string? — default: start – options: start|end Footnote-Reference: should the reference link be at the start or end

inline-link-prefix

string? — default: '' Footnote-Reference: in link before inline number

inline-link-suffix

string? — default: '' Footnote-Reference: in link after inline number

inline-text-prefix

string? — default: '' Footnote-Reference: text before inline link

inline-text-suffix

string? — default: '' Footnote-Reference: text after inline link

Example

Input

Text with[^test] reference footnote[^test].
Text with inline footnote[^here the inline reference].
 
![Cat](http://placekitten.com/g/80/120)
_This is a cat [^:fig:Reference from a different group]_
 
<!-- refs -->
 
[^test]: This is the named reference
 
### Footnotes
 
<!-- This code block gets replaced with footnotes -->
 
```references
 
```
 
### Figures
 
<!-- This code block gets replaced with footnotes -->
 
```references
group-include: fig
inline-link-prefix: 'Fig. '
reference-link-position: end
reference-link-prefix: ' Fig. '
reference-link-suffix: ' ⇡'
reference-text-prefix: ' '
```

Output

example output

License

MITStefan Huber

Version

  • 0.0.4 – FIX: sorting problems

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    0
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i gatsby-remark-reference-footnotes

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

12 kB

Total Files

3

Last publish

Collaborators

  • signalwerk