Skip to content

Fix the runnable examples in the comments guide - #1656

Open
AmanBoronbaev wants to merge 1 commit into
python-openxml:masterfrom
AmanBoronbaev:docs-run-comment-examples
Open

AmanBoronbaev wants to merge 1 commit into
python-openxml:masterfrom
AmanBoronbaev:docs-run-comment-examples

Conversation

@AmanBoronbaev

Copy link
Copy Markdown

The comments guide stops at Document.add_comment() because the example is missing a comma between text and author. Once the call succeeds, comment.id and comment.date both raise AttributeError.

Use the public comment_id and timestamp properties. The lookup example now shows the retrieved text, and the timestamp example shows its UTC timezone. Those values can be checked without relying on a particular date or object address. The rich-content section also uses reStructuredText emphasis for “block-item container” so Sphinx renders it correctly.

All 22 examples in the guide pass with python -m doctest docs/user/comments.rst. Saving and reopening the example document preserved both comments, including the author, initials, UTC timestamp and bold run. The unit test suite passed all 1,609 tests, and the HTML guide built with Sphinx warnings treated as errors.

AI assistance: OpenAI Codex prepared the documentation changes, executed the guide examples, and checked the saved document.

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