Skip to content

Add clickable paragraph check box content controls - #1619

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

pseudosavant wants to merge 1 commit into
python-openxml:masterfrom
pseudosavant:codex/checkbox-content-control-upstream

Conversation

@pseudosavant

Copy link
Copy Markdown

Summary

Add a public API for clickable check box content controls inside paragraphs. Paragraph.add_checkbox(checked=False) appends a control. Paragraph.checkboxes reads existing controls, and CheckBox.checked reads or updates their state. Changing the state also updates the visible glyph.

This uses Word's w:sdt content control with w14:checkbox metadata. The change has no dependency on the ps-python-docx fork or markdown-docx.

Validation

  • Four saved-document tests pass for checked and unchecked controls, state changes, and table cells.
  • Ruff checks pass for all changed files.
  • The full upstream test suite has 56 failures in this Windows checkout, beginning with a fixture SHA-1 mismatch. The four added tests pass in that environment. The fork's full suite passed with 1,837 tests before release.

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