From: Lady Date: Sat, 20 Sep 2025 04:51:25 +0000 (-0400) Subject: Add support for footnotes X-Git-Tag: 0.6.0~2 X-Git-Url: https://git.ladys.computer/LesML/commitdiff_plain/5c6c7daa10f7c1ab2074a21fbb2886bcc0f83a7c?ds=sidebyside Add support for footnotes --- diff --git a/README.markdown b/README.markdown index 9a71b40..35f5a53 100644 --- a/README.markdown +++ b/README.markdown @@ -169,15 +169,30 @@ After this classification, each ordinary paragraph is further - If the paragraph begins with `⚠︎`, it is a warning note (``). +- If the paragraph begins with `^`, it is a footnote + (``). + Footnotes are ignored unless their first paragraph has an i·d + (specified with `¶`) which is referenced by one or more footnote + references. + Footnotes are treated as level 1 ordered list items, so they can + contain nested lists. + + Footnotes are removed from the normal document flow and placed in a + footer (``) in order of first + reference. + It is recommended that the i·d¦s you choose are kept stable, so that + links to footnotes do not break. + - If the paragraph begins with `#`, it is a comment. Comments produce X·M·L comment nodes and can be used to break up list items into separate lists. - If the paragraph begins with `⋯`, it is a continuation paragraph. - Continuation paragraphs may be used to continue a preceding div or - list item. - If there is no such preceding div or list item, they will attach to - adjacent heading elements to form heading groups (``). + Continuation paragraphs may be used to continue a preceding note, + footnote, or list item. + If there is no such preceding note, footnote, or list item, they will + attach to adjacent heading elements to form heading groups + (``). Otherwise, they will be treated as ordinary paragraphs. - Otherwise, it is an ordinary paragraph. @@ -242,6 +257,11 @@ Markup within paragraphs is delimited with·out exception by pairs of - The characters `⹐` and `⹑` indicate emphasis (``). +- The characters `^` and `.` indicate a footnote reference + (``). + The characters between these sigils must match the i·d of the first + paragraph of some footnote in the same document. + Once the tree is built as above, it is remediated into its final form by the following steps :⁠— diff --git a/parser.xslt b/parser.xslt index a938d1f..5164ea1 100644 --- a/parser.xslt +++ b/parser.xslt @@ -289,6 +289,56 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one + + + + + + + + + + + + + + + + + + + + + + + + + + + + + backlinks + + + + + + + + doc-backlink + + + # + + + + + + + + + + @@ -372,10 +422,22 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one body - - - + + + + + + + doc-endnotes + + + + + + + + @@ -713,6 +775,22 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one + + + + ordered footnote + + + 1 + + + + + + + + + @@ -737,8 +815,12 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one + + - + + + @@ -769,6 +851,82 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one + + +