jamessimone / gatsby-remark-footnotes

Customize your Gatsby Remark markup footnotes
MIT License
4 stars 0 forks source link

Two types of Footnotes #2

Closed signalwerk closed 5 years ago

signalwerk commented 5 years ago

Hey! Thank you for your work. I realised that with your plugin I'm able to do multiple Footnotes at different positions in the dom. That's awesome! Unfortunately I can't figure out how to get the right numbering and structure right. Can you help me here?

Markdown


Basic text[^1] with several footnotes[^2].

![Picture](./img/cat.jpg)  
And here we have a Figure. [^fig-1]

#### Footnote
[^1]: Footnote A.

[^2]: Footnote B.

#### Figures
[^fig-1]: Figure note

Rendering

((img missing but thats on purpose)) image

Expected

Basic text1 with several footnotes2.

đź–Ľ And here we have a Figure.fig-1

Footnote

1 ^ Footnote A.

2 ^ Footnote B.

Figures

fig-1 ^ Figure note

jamessimone commented 5 years ago

Hey @signalwerk, that’s the way that remark parses markdown; I do agree that having the footnote “marker” follow the convention of the marker text would be useful.

That said, it would have to be an opt in plugin option to use the “marker” text instead of auto-numbering, as most markdown guides already prepare the user for the footnotes incrementing as they already do. I have a busy week ahead of me but I would like to add the functionality you’ve described; I’m also open to PRs.

Thanks for reaching out! I’m glad to know you’re at least using the plugin and finding it somewhat useful.

jamessimone commented 5 years ago

@signalwerk this should be all set with the newly published 0.0.6 version of the plugin. Simply set the useFootnoteMarkerText config option to the boolean value true in order to make use of it. If there's any issue, please let me know!

signalwerk commented 5 years ago

Hey @jamessimone Thank you for you help and sorry for the late response. I just tried it now and saw now the following problems:

md

Basic text[^1] with several footnotes[^2].

![Picture](./img/cat.jpg)  
And here we have a Figure. [^fig-1]

#### Footnote
[^1]: Footnote A.
[^2]: Footnote B.

#### Figures
[^fig-1]: Figure note

config

{
  resolve: `gatsby-remark-footnotes`,
  options: {
    footnoteBackRefPreviousElementDisplay: 'inline',
    footnoteBackRefDisplay: 'inline',
    footnoteBackRefInnerText: '^', 
    footnoteBackRefInnerTextStartPosition: 'front',
    useFootnoteMarkerText: true, 
  },
},

result

Screenshot 2019-10-11 at 15 12 13 Screenshot 2019-10-11 at 15 14 09

problems

I'm not sure how you thought of it to use it. Probably I'm just not using it right. Maybe it would be nice to see an example.

jamessimone commented 5 years ago

@signalwerk I published 0.0.7 with additional features to try to help you out. This release adds class names, documented in the Readme so that you can select the generated items. I was unable to reproduce your experience with the undefined pieces of HTML - are you sure that is coming from my plugin? I used the exact plugin options you pasted to debug and was unable to see the same thing, even with the exact same markdown you used.

Hopefully this release rounds out the package for you!

signalwerk commented 5 years ago

Hey @jamessimone Thank you for your work! Since my footnotes are probably too complicated for a standard tool I decided to write now my own footnote-plugin.

jamessimone commented 5 years ago

@signalwerk understood. Sorry to hear contributing here wasn’t possible but I wish you all the best with your own plugin.