{"_id":"@egihasdi/markdown-it-footnote","_rev":"1-29e22636223b92980787ee30ece39702","name":"@egihasdi/markdown-it-footnote","dist-tags":{"latest":"4.0.1"},"versions":{"4.0.0":{"name":"@egihasdi/markdown-it-footnote","version":"4.0.0","keywords":["markdown-it-plugin","markdown-it","markdown","footnotes"],"license":"MIT","_id":"@egihasdi/markdown-it-footnote@4.0.0","maintainers":[{"name":"egihasdi","email":"egi.hasdi@gmail.com"}],"homepage":"https://github.com/egihasdi/markdown-it-footnote#readme","bugs":{"url":"https://github.com/egihasdi/markdown-it-footnote/issues"},"dist":{"shasum":"63ef2cf46171d15a78947eff90f9707abed33bc8","tarball":"https://registry.npmjs.org/@egihasdi/markdown-it-footnote/-/markdown-it-footnote-4.0.0.tgz","fileCount":9,"integrity":"sha512-d3HsUnlE9Tb30lb8bVEbPVwxg/s52Y5YhtF60m+p54w2+N7HNsS7t26jtPCR8W/rbhFJraWdlu2C90by3LZKkw==","signatures":[{"sig":"MEUCIAeAzwUFqtOL8dKeL+puOsDElH6V+ti7b5MLb8M8YbUAAiEAh7uoPQ3HW4RWvC4MTYJzeJZX0VwMsBBWrwsOOKzElC0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64995},"main":"dist/index.cjs.js","module":"index.mjs","exports":{".":{"import":"./index.mjs","require":"./dist/index.cjs.js"},"./*":{"import":"./*","require":"./*"}},"gitHead":"1b6d7abc6cb24a54db8755496a875588b109492c","scripts":{"lint":"eslint .","test":"npm run lint && npm run build && c8 --exclude dist --exclude test -r text -r html -r lcov mocha","build":"rollup -c","prepublishOnly":"npm run build"},"_npmUser":{"name":"egihasdi","email":"egi.hasdi@gmail.com"},"repository":{"url":"git+https://github.com/egihasdi/markdown-it-footnote.git","type":"git"},"_npmVersion":"10.7.0","description":"Footnotes for markdown-it markdown parser.","directories":{},"_nodeVersion":"22.2.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.1","mocha":"^10.2.0","eslint":"^8.55.0","rollup":"^4.6.1","markdown-it":"^13.0.2","markdown-it-testgen":"^0.1.6","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4","eslint-config-standard":"^17.1.0","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/markdown-it-footnote_4.0.0_1721421464743_0.5543179084624001","host":"s3://npm-registry-packages"}},"4.0.1":{"name":"@egihasdi/markdown-it-footnote","version":"4.0.1","description":"Footnotes for markdown-it markdown parser.","keywords":["markdown-it-plugin","markdown-it","markdown","footnotes"],"repository":{"type":"git","url":"git+https://github.com/egihasdi/markdown-it-footnote.git"},"license":"MIT","main":"dist/index.cjs.js","module":"index.mjs","exports":{".":{"require":"./dist/index.cjs.js","import":"./index.mjs"},"./*":{"require":"./*","import":"./*"}},"scripts":{"lint":"eslint .","build":"rollup -c","test":"npm run lint && npm run build && c8 --exclude dist --exclude test -r text -r html -r lcov mocha","prepublishOnly":"npm run build"},"devDependencies":{"@rollup/plugin-babel":"^6.0.4","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","c8":"^8.0.1","eslint":"^8.55.0","eslint-config-standard":"^17.1.0","markdown-it":"^13.0.2","markdown-it-testgen":"^0.1.6","mocha":"^10.2.0","rollup":"^4.6.1"},"_id":"@egihasdi/markdown-it-footnote@4.0.1","gitHead":"24c4e6b816c5a1b0cc316a93e046d4ba45c7bce5","bugs":{"url":"https://github.com/egihasdi/markdown-it-footnote/issues"},"homepage":"https://github.com/egihasdi/markdown-it-footnote#readme","_nodeVersion":"22.2.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-zgUDLD1QL+Et8arUOpZOBuDOLcJfUHnpR7GDZsgyXqNtkAToRFf6OdghtlnpyVmkcTIScQnnmDItjaLuvwfTVg==","shasum":"873f44a1f11d7297cc0d3822c02690aac5cce222","tarball":"https://registry.npmjs.org/@egihasdi/markdown-it-footnote/-/markdown-it-footnote-4.0.1.tgz","fileCount":9,"unpackedSize":64987,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG225XUwEMj0shQ3QLHMCr6LpfbY7I2wRWhW0FGVaPUaAiA3zyfEfZ5N91iN9HJLUc4VeCVaTDc35At92K7MfeuE3w=="}]},"_npmUser":{"name":"egihasdi","email":"egi.hasdi@gmail.com"},"directories":{},"maintainers":[{"name":"egihasdi","email":"egi.hasdi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/markdown-it-footnote_4.0.1_1721421628872_0.7507048109588919"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-19T20:37:44.636Z","modified":"2024-07-19T20:40:29.208Z","4.0.0":"2024-07-19T20:37:44.964Z","4.0.1":"2024-07-19T20:40:29.061Z"},"bugs":{"url":"https://github.com/egihasdi/markdown-it-footnote/issues"},"license":"MIT","homepage":"https://github.com/egihasdi/markdown-it-footnote#readme","keywords":["markdown-it-plugin","markdown-it","markdown","footnotes"],"repository":{"type":"git","url":"git+https://github.com/egihasdi/markdown-it-footnote.git"},"description":"Footnotes for markdown-it markdown parser.","maintainers":[{"name":"egihasdi","email":"egi.hasdi@gmail.com"}],"readme":"# markdown-it-footnote\n\n[![CI](https://github.com/markdown-it/markdown-it-footnote/actions/workflows/ci.yml/badge.svg)](https://github.com/markdown-it/markdown-it-footnote/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/markdown-it-footnote.svg?style=flat)](https://www.npmjs.org/package/markdown-it-footnote)\n[![Coverage Status](https://img.shields.io/coveralls/markdown-it/markdown-it-footnote/master.svg?style=flat)](https://coveralls.io/r/markdown-it/markdown-it-footnote?branch=master)\n\n> Footnotes plugin for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.\n\n__v2.+ requires `markdown-it` v5.+, see changelog.__\n\nMarkup is based on [pandoc](http://johnmacfarlane.net/pandoc/README.html#footnotes) definition.\n\n__Normal footnote__:\n\n```\nHere is a footnote reference,[^1] and another.[^longnote]\n\n[^1]: Here is the footnote.\n\n[^longnote]: Here's one with multiple blocks.\n\n    Subsequent paragraphs are indented to show that they\nbelong to the previous footnote.\n```\n\nhtml:\n\n```html\n<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>\n<p>This paragraph won’t be part of the note, because it\nisn’t indented.</p>\n<hr class=\"footnotes-sep\">\n<section class=\"footnotes\">\n<ol class=\"footnotes-list\">\n<li id=\"fn1\"  class=\"footnote-item\"><p>Here is the footnote. <a href=\"#fnref1\" class=\"footnote-backref\">↩</a></p>\n</li>\n<li id=\"fn2\"  class=\"footnote-item\"><p>Here’s one with multiple blocks.</p>\n<p>Subsequent paragraphs are indented to show that they\nbelong to the previous footnote. <a href=\"#fnref2\" class=\"footnote-backref\">↩</a></p>\n</li>\n</ol>\n</section>\n```\n\n__Inline footnote__:\n\n```\nHere is an inline note.^[Inlines notes are easier to write, since\nyou don't have to pick an identifier and move down to type the\nnote.]\n```\n\nhtml:\n\n```html\n<p>Here is an inline note.<sup class=\"footnote-ref\"><a href=\"#fn1\" id=\"fnref1\">[1]</a></sup></p>\n<hr class=\"footnotes-sep\">\n<section class=\"footnotes\">\n<ol class=\"footnotes-list\">\n<li id=\"fn1\"  class=\"footnote-item\"><p>Inlines notes are easier to write, since\nyou don’t have to pick an identifier and move down to type the\nnote. <a href=\"#fnref1\" class=\"footnote-backref\">↩</a></p>\n</li>\n</ol>\n</section>\n```\n\n\n## Install\n\nnode.js, browser:\n\n```bash\nnpm install markdown-it-footnote --save\nbower install markdown-it-footnote --save\n```\n\n## Use\n\n```js\nvar md = require('markdown-it')()\n            .use(require('markdown-it-footnote'));\n\nmd.render(/*...*/) // See examples above\n```\n\n_Differences in browser._ If you load script directly into the page, without\npackage system, module will add itself globally as `window.markdownitFootnote`.\n\n\n### Customize\n\nIf you want to customize the output, you'll need to replace the template\nfunctions. To see which templates exist and their default implementations,\nlook in [`index.js`](index.js). The API of these template functions is out of\nscope for this plugin's documentation; you can read more about it [in the\nmarkdown-it\ndocumentation](https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md#renderer).\n\nTo demonstrate with an example, here is how you might replace the `<hr>` that\nthis plugin emits by default with an `<h4>` emitted by your own template\nfunction override:\n\n```js\nconst md = require('markdown-it')().use(require('markdown-it-footnote'));\n\nmd.renderer.rules.footnote_block_open = () => (\n  '<h4 class=\"mt-3\">Footnotes</h4>\\n' +\n  '<section class=\"footnotes\">\\n' +\n  '<ol class=\"footnotes-list\">\\n'\n);\n```\n\nHere's another example that customizes footnotes for epub books:\n\n```js\nconst backrefLabel = 'back to text';\n\nconst epubRules = {\n  footnote_ref: ['<a', '<a epub:type=\"noteref\"'],\n  footnote_open: ['<li', '<li epub:type=\"footnote\"'],\n  footnote_anchor: ['<a', `<a aria-label=\"${backrefLabel}\"`],\n}\n\nObject.keys(epubRules).map(rule => {\n  let defaultRender = md.renderer.rules[rule];\n  md.renderer.rules[rule] = (tokens, idx, options, env, self) => {\n    return defaultRender(tokens, idx, options, env, self).replace(...epubRules[rule]);\n  }\n})\n```\n\n## License\n\n[MIT](https://github.com/markdown-it/markdown-it-footnote/blob/master/LICENSE)\n","readmeFilename":"README.md"}