Giter VIP home page Giter VIP logo

markdown-it-footnote-conventional's Introduction

markdown-it-footnote-conventional

This is a fork of markdown-it-footnote.

Here are the differences between this fork, and the master branch:

  1. <div class="footnotes"> is used in lieu of <section class="footnotes">
  2. <hr class="footnotes-sep"> is now a child of the <div class="footnotes"> instead of a sibling

The first change I made is just a personal preference. Based on the spec, I don't believe the footnotes section at the bottom of a post/page has the same semantic meaning as a <section>.

The second change I made allows Bigfoot.js to work more consistently. The Bigfoot JavaScript already removed the <section class="footnotes">, but it was not removing the <hr class="footnotes-sep">, because the master branch of markdown-it-footnote placed the <hr class="footnotes-sep"> outside of the <section class="footnotes">---not within it. As a sibling and not a child of the <section class="footnotes">, Bigfoot wouldn't remove the <hr class="footnotes-sep">. It does now :)


Build Status NPM version Coverage Status

Footnotes plugin for markdown-it markdown parser.

v2.+ requires markdown-it v5.+, see changelog.

Markup is based on pandoc definition.

Normal footnote:

Here is a footnote reference,[^1] and another.[^longnote]

[^1]: Here is the footnote.

[^longnote]: Here's one with multiple blocks.

    Subsequent paragraphs are indented to show that they
belong to the previous footnote.

html:

<p>Here is a footnote reference,<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup> and another.<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup></p>
<p>This paragraph won’t be part of the note, because it
isn’t indented.</p>
<div class="footnotes">
<hr class="footnotes-sep">
<ol class="footnotes-list">
<li id="fn1"  class="footnote-item"><p>Here is the footnote. <a href="#fnref1" class="footnote-backref"></a></p>
</li>
<li id="fn2"  class="footnote-item"><p>Here’s one with multiple blocks.</p>
<p>Subsequent paragraphs are indented to show that they
belong to the previous footnote. <a href="#fnref2" class="footnote-backref"></a></p>
</li>
</ol>
</div>

Inline footnote:

Here is an inline note.^[Inlines notes are easier to write, since
you don't have to pick an identifier and move down to type the
note.]

html:

<p>Here is an inline note.<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
<div class="footnotes">
<hr class="footnotes-sep">
<ol class="footnotes-list">
<li id="fn1"  class="footnote-item"><p>Inlines notes are easier to write, since
you don’t have to pick an identifier and move down to type the
note. <a href="#fnref1" class="footnote-backref"></a></p>
</li>
</ol>
</div>

Install

node.js, browser:

npm install markdown-it-footnote-conventional --save
bower install markdown-it-footnote-conventional --save

Use

var md = require('markdown-it')()
            .use(require('markdown-it-footnote-conventional'));

md.render(/*...*/) // See examples above

Differences in browser. If you load script directly into the page, without package system, module will add itself globally as window.markdownitFootnote.

License

MIT

markdown-it-footnote-conventional's People

Contributors

toniwonkanobi avatar rlidwka avatar valeriangalliat avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.