Refactor footnote handling

- Remove unused footnote section title option
- Move away from maintaining a list of footnotes in the document (only needed
  for html export, potential maintainance overhead when modifying the document)
  and rather only build it on export when required.
- HTML export: Rename all footnotes to numbers (so we can support anonymous
  footnote references by assigning them a number) and export footnotes in order
  of reference, not definition. The implementation of this makes it natural to
  also stop exporting unused footnote definitions so we do that as well.
This commit is contained in:
Niklas Fasching 2019-07-07 09:52:23 +02:00
parent 50395f999a
commit 6dc04b4b02
8 changed files with 69 additions and 100 deletions

View file

@ -409,7 +409,7 @@ src/example/export blocks should not be converted!
<a href="https://github.com/chaseadamsio/goorgeous/issues/87">#87</a>: Markup in footnotes is rendered literally
</h3>
<p>
footnotes can contain <strong>markup</strong> - and other elements and stuff <sup class="footnote-reference"><a id="footnote-reference-2" href="#footnote-2">2</a></sup>
footnotes can contain <strong>markup</strong> - and other elements and stuff <sup class="footnote-reference"><a id="footnote-reference-0" href="#footnote-0">0</a></sup> <sup class="footnote-reference"><a id="footnote-reference-1" href="#footnote-1">1</a></sup>
</p>
<h3 id="headline-23">
<span class="todo">DONE</span>
@ -472,7 +472,7 @@ Footnotes
<hr class="footnotes-separatator">
<div class="footnote-definitions">
<div class="footnote-definition">
<sup id="footnote-1"><a href="#footnote-reference-1">1</a></sup>
<sup id="footnote-0"><a href="#footnote-reference-0">0</a></sup>
<div class="footnote-body">
<p>
a footnote <em>with</em> <strong>markup</strong>
@ -492,7 +492,7 @@ because that&#39;s possible
</div>
</div>
<div class="footnote-definition">
<sup id="footnote-2"><a href="#footnote-reference-2">2</a></sup>
<sup id="footnote-1"><a href="#footnote-reference-1">1</a></sup>
<div class="footnote-body">
<p>
that also goes for <strong>inline</strong> footnote <em>definitions</em>