Closed git-noise closed 3 weeks ago
I have forked the repo and added initial support for footnotes with the following scope/limitations:
@bokuweb, please let me know if you have interest in merging a PR. Thank you
@git-noise Thanks for your great work. I'm interested in your change :)
Great thanks! I'll work on a merge-able PR and send it your way for initial comment/review.
Is your feature request related to a problem? Please describe.
It seems that one cannot currently insert footnotes
Describe the solution you'd like
A way to include a footnote within a paragraph.
Describe alternatives you've considered
Edit the document XML afterwards, and create
footnotes.xml
Additional context
I have not gone too far yet, but a solution could be along the following: 1- extend Paragraph with a
add_footnote_reference
: The XML seems to look like:2- create
footnotes.xml
as a separate XML file within the archive.From a quick look, it seems that 1 is doable (extend Paragraph and RunChild essentially). One could even do some of that externally using Trait as Run and RunChild seem essentially public, but RunChild as an Enum would probably need to be extended with a new variant for FootnoteReference.
However 2 may be a bit more challenging. Creating the XML itself seems straight forward, but then one would also need to keep track of the footnotes to include in
footnotes.xml
at docx build time.Thanks for your feedback