docx icon indicating copy to clipboard operation
docx copied to clipboard

feat: add endnotes support to docx library

Open AlabasterAxe opened this issue 3 months ago • 2 comments

Summary

  • Add comprehensive endnotes implementation with EndnoteReferenceRun component
  • Create Endnotes class and EndnotesWrapper for document integration
  • Add endnote attributes, reference runs, and separator components
  • Update documentation to cover both footnotes and endnotes usage
  • Include demo file demonstrating endnotes functionality with multiple sections
  • Integrate endnotes into compiler pipeline and content types
  • Add comprehensive test coverage for endnote components

Key Features

  • EndnoteReferenceRun: Component for adding endnote references in paragraphs
  • Endnotes class: Manages endnote content and formatting
  • Documentation updates: Extended footnotes.md to cover endnotes usage
  • Demo implementation: Complete working example in demo/97-endnotes.ts
  • Test coverage: Comprehensive unit tests for all endnote components

Differences from Footnotes

  • Endnotes appear at the end of the document, unlike footnotes which appear at the bottom of each page
  • Ideal for academic papers, research documents, and lengthy citations
  • References automatically appear as superscript in the document

Test plan

  • [x] All existing tests pass
  • [x] New endnote tests pass
  • [x] Demo file generates valid DOCX with endnotes
  • [x] Documentation updated with usage examples
  • [x] Code follows project formatting and linting standards

Fixes #359

AlabasterAxe avatar Sep 20 '25 13:09 AlabasterAxe

@dolanmiu FYI

AlabasterAxe avatar Sep 20 '25 13:09 AlabasterAxe

Thanks @AlabasterAxe

Looks good to me

Edit: Failing tests if you don't mind fixing, and then it can be merged.

dolanmiu avatar Nov 05 '25 03:11 dolanmiu