Skip to content

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
@scanny scanny merged commit e454546 into master Jun 16, 2025
@scanny scanny deleted the scanny/comments branch June 16, 2025 21:24
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.

2 participants