Skip to content

feat: add comments support #1495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

feat: add comments support #1495

wants to merge 25 commits into from

Conversation

scanny
Copy link
Contributor

@scanny scanny commented Jun 13, 2025

This adds support for comments, primarily via the document.add_comment() method and the document.comments accessor for the new Comments collection.

These allow new comments to be added to a document and existing comments to be inspected and their author metadata and content modified.

There is no direct support for accessing the document text "referenced" by a comment (the comment "anchor") although that may be added later.

scanny added 25 commits June 12, 2025 18:09
Provides access to the comments collection from the document object.
Provide a way to get a `Comments` object from the `DocumentPart`.
Also involves adding `CommentsPart.default`. Because the comments part
is optional, we need a mechanism to add a default (empty) comments part
when one is not present. This is what `CommentsPart.default()` is for.
CommentsPart is loaded as XML-part on document deserialization.
To get a comment by id, None when not found.
Actual implementation is primarily inherited from `BlockItemContainer`,
but support for those operations must be present in `CT_Comment` and
it's worth testing explicitly.
Only with `text` parameter so far. Author and initials parameters to
follow.
- allow setting on construction
- allow update with property setters
- developer/analysis docs
- user docs
- API docs
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