docx
docx copied to clipboard
feat: add endnotes support to docx library
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
@dolanmiu FYI
Thanks @AlabasterAxe
Looks good to me
Edit: Failing tests if you don't mind fixing, and then it can be merged.