Skip to content

Footnotes Extension

Vladimir Schneider edited this page Mar 19, 2018 · 1 revision

flexmark-java extension for footnote processing

Overview

Creates footnote references in the document. Footnotes are placed at the bottom of the rendered document with links from footnote references to footnote and vice-versa.

Syntax

Converts: [^footnote] to footnote references and [^footnote]: footnote definition to footnotes in the document.

Sample:

Paragraph with a footnote reference[^1]

[^1]: Footnote text added at the bottom of the document

Which renders as:

<p><span class="selection-highlight">Paragraph with a footnote reference</span><sup id="fnref-1"><a class="footnote-ref" href="#fn-1">1</a></sup></p>
<div class="footnotes">
  <hr />
  <ol>
    <li id="fn-1">
      <p><span class="selection-highlight">Footnote text added at the bottom of the document</span></p>
      <a href="#fnref-1" class="footnote-backref">&#8617;</a>
    </li>
  </ol>
</div>

Paragraph with a footnote reference[^1]

[^1]: Footnote text added at the bottom of the document

Parsing Details

Use class FootnoteExtension from artifact flexmark-ext-footnotes.

The following options are available:

Defined in FootnoteExtension class:

Static Field Default Value Description
FOOTNOTES new repository repository for document's footnote definitions
FOOTNOTES_KEEP KeepType.FIRST which duplicates to keep.
FOOTNOTE_REF_PREFIX "" Prefix to use when rendering footnote reference.
FOOTNOTE_REF_SUFFIX "" Suffix to use when rendering footnote reference.
FOOTNOTE_BACK_REF_STRING "&#8617;" String to use for the link text on the footnote back link to text, default: ↩
FOOTNOTE_LINK_REF_CLASS "footnote-ref" String to use for the class attribute of the link used to render the footnote reference
FOOTNOTE_BACK_LINK_REF_CLASS "footnote-backref" String to use for the class attribute of the link used to render the link back to the footnote
FOOTNOTE_PLACEMENT ElementPlacement.AS_IS formatting option see: Markdown Formatter
FOOTNOTE_SORT ElementPlacement.AS_IS formatting option see: Markdown Formatter