Add support for footnotes syntax in ghost. Compatible with showdown standalone
npm install showdown-ghost-footnotes
- Require Showdown
const showdown = require('showdown');
- Require Showdown Footnotes
const footnotes = require('showdown-ghost-footnotes');
- Extend Showdown to enable Footnotes
const converter = new showdown.Converter({ extensions: [footnotes] });
I have more [^1] to say up here.
Turns into
<p>
I have more <sup id="fnref-1"><a href="#fn-1" rel="footnote" title="go to footnote">1</a></sup> to say up here.
</p>
And at the bottom of the page
[^1]: To say down here.
Turns into
<div class="footnotes">
<hr>
<ol>
<li id="fn-1"><p>To say down here.
<a href="#fnref-1" class="footnote-backref" title="return to article">↩</a></p></li>
</ol>
</div>