markdown-it / markdown-it-footnote

Footnotes plugin for markdown-it markdown parser
https://markdown-it.github.io/
MIT License
210 stars 59 forks source link

how to use without require #45

Closed OrenBochman closed 2 years ago

OrenBochman commented 2 years ago

Thanks for adding footnote support.

For devs who are not coding for node please also document how to import this module for use a js module with imports instead of using require.

puzrin commented 2 years ago

You can use webpack or other builder, it will do all stuff for you. That's generic programming question, not specific to this package.

Nekkowe commented 1 week ago

I came across this issue while looking for the right syntax to do this with eleventy, and found the solution a bit later:

import markdownItFootnote from "markdown-it-footnote";
// etc...
export default async function(eleventyConfig) {
  // etc... 
  eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownItFootnote));
  // etc...
}