Skip to content

Instantiate valid DOCX packages from DOTX templates - #1

Draft
pseudosavant wants to merge 1 commit into
coderamaster:fix/1532-dotx-template-supportfrom
pseudosavant:codex/dotx-upstream
Draft

pseudosavant wants to merge 1 commit into
coderamaster:fix/1532-dotx-template-supportfrom
pseudosavant:codex/dotx-upstream

Conversation

@pseudosavant

Copy link
Copy Markdown

This is a focused follow-up to your upstream python-openxml#1537 proposal.

The existing loader accepts DOTX packages but retains the template main content type when saving to a .docx path. This follow-up makes Document(template) instantiate a document and save a genuine DOCX package. Lower-level Package.open() keeps the original package type.

It also replaces optional, missing-fixture tests with committed Word-authored templates and coverage for paths, streams, content-type detection, macro-enabled format rejection, source immutability, and preservation of styles, numbering, theme, sections, headers, footers, images, and relationships. Documentation defines the distinction between instantiation and template authoring.

Validation:

  • 1,617 unit tests and 651 acceptance scenarios passed on this branch.
  • Changed-file lint passed.
  • Word opened generated output as format 12 (DOCX), with header, image, and generated text intact.

The branch is based directly on your PR head and includes only this follow-up commit. No fork packaging or other features are included.

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