2.0.1 • Published 11 months ago

tiptap-footnotes v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

tiptap-footnotes

A footnotes extension for Tiptap

Demo

See it in action here.

Getting Started

Installation

$ npm install tiptap-footnotes

This extension requires the @tiptap/extension-list-item, @tiptap/extension-ordered-list, and the @tiptap/pm extensions, so you need to install them as well:

npm install @tiptap/extension-list-item @tiptap/extension-ordered-list @tiptap/pm

Usage

This package is separated into 3 main extensions:

  • Footnotes: The footnotes ordered list extension
  • Footnote: The footnote list item extension
  • FootnoteReference: the footnote reference extension

Typically, the footnotes should be placed at the bottom of the document, so you should adjust the topNode node (i.e. Document) to have the footnotes placed at the end (as shown below):

import { useEditor, EditorContent } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import { Footnotes, FootnoteReference, Footnote } from "tiptap-footnotes";
import Document from "@tiptap/extension-document";

const Editor = () => {
  const editor = useEditor({
    extensions: [
      StarterKit.configure({
        document: false,
      }),
      Document.extend({
        content: "block+ footnotes?",
      }),
      Footnotes,
      Footnote,
      FootnoteReference,
    ],
    content: "Hello world",
  });


  return <EditorContent editor={editor} />
};

export default Editor;
2.0.1

11 months ago

2.0.0

11 months ago

1.1.1

12 months ago

1.1.0

1 year ago

1.0.0

1 year ago