Skip to content

Add native footnote authoring and lookup - #1616

Draft
pseudosavant wants to merge 1 commit into
python-openxml:masterfrom
pseudosavant:codex/footnotes-upstream
Draft

pseudosavant wants to merge 1 commit into
python-openxml:masterfrom
pseudosavant:codex/footnotes-upstream

Conversation

@pseudosavant

Copy link
Copy Markdown

Add native footnote creation and lookup, with precise reference placement and editable note content.

Document.add_footnote(after=run, text=...) inserts a separate reference run without changing adjacent text or formatting. Document.footnotes exposes ordinary notes, and Run.footnote_ids exposes existing reference IDs. Notes support the existing block-container and run APIs.

The implementation registers a typed footnotes story part, creates separator entries, reserves existing IDs, preserves note styles and numbering settings, and validates body or table-cell reference locations before adding package structures. It does not add endnotes, field-based reuse, note deletion, or pagination controls.

Related to #1 and the broader proposal in #1392. This draft offers a narrower creation and lookup API for discussion. It is based directly on upstream master and contains no fork packaging or other feature commits.

Validation:

  • 1,628 upstream unit tests passed.
  • 651 acceptance scenarios passed.
  • New-module type checks and lint passed.
  • Word-authored fixture round trips passed.
  • Microsoft Word opened a generated note and confirmed reference placement and multi-paragraph content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant