プログラミング

markdown-it-footnoteでMarkdownに脚注・注記をつける

markdown-it-footnoteでMarkdownに脚注・注記をつけてみます。

npm install markdown-it-footnote --save

https://yuis.xsrv.jp/data/PrxHAltOvWcceCXfx3073k5BvKJS2f2n.png

markdown-it-footnote – npm


var md = require('markdown-it')() .use(require('markdown-it-footnote')); console.log( md.render( "Here is a footnote reference,[^1] and another.[^longnote]\n\n[^1]: Here is the footnote." ) );
</html>
<p>Here is a footnote reference,<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup> and another.[^longnote]</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>Here is the footnote. <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>

https://yuis.xsrv.jp/images/ss/ShareX_ScreenShot_02122af3-4b80-4221-a521-cf5cae28efd2.png