Every extension

footnotesKit

Node takes options 0 kB gzipped

Footnotes: a marker in the text, a note at the end, numbered by position.


            editor.commands.insertFootnote()      // a marker here, a note below, caret in the note
editor.commands.removeFootnote(id)    // both halves
editor.commands.goToFootnote(id)      // and back with goToFootnoteRef(id)
          

The numbers are never in the document. They are decorations, recomputed per block when the document changes and not at all when only the caret moves, so deleting a marker renumbers the rest as you watch and an undo puts the old numbers back. A note whose marker is gone is left in place and marked `matra-footnote-orphan`, rather than deleted behind your back.

Adding it

import { createEditor, document, paragraph, text, footnotesKit } from '@matrajs/core'

const editor = createEditor({
  extensions: [document, paragraph, text, footnotesKit({ … })],
  element: document.querySelector('#editor'),
})

There is no separate package · footnotesKit is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.

Attributes

HTML

← All 81 extensions

Edit this page on GitHub