orgize icon indicating copy to clipboard operation
orgize copied to clipboard

feat: adds footnote support

Open root-goblin opened this issue 1 year ago • 0 comments

Syntax

  • added node: FN_CONTENT
  • added token: FN_LABEL
  • updated fn_def() and fn_ref() to use the two new syntax kinds
    • re-labelled fn text as keyword

To-do

  • prune unneeded generator functions

AST

  • added FnContent as new AST node
  • added extractors to FnDef, FnRef for label and content

Parsing (HTML)

  • added Event handlers
    • Container:FnDef
    • Container::FnRef
    • Container::FnContent
    • FnLabel
Details

Separating out the label and the content allows extraction during HTML export. This data can then be used to generate a citations or footnotes section.

However as of right now, org-mode automatically generates org-footnotes-section when adding footnotes, so the default HTML export process works fine, but does not apply any special treatment to the Footnotes heading or section.

For future work, this would be wrapped in <aside></aside> or some other semantically significant tag.

Tests

  • updated insta snapshots to reflect new syntax
  • added tests/html.rs > footnote()

Docs

  • updated commands to be more portable

root-goblin avatar Nov 04 '24 21:11 root-goblin