Skip to content

docs: clarify errors for undefined styles - #1650

Open
Haasini-kudala wants to merge 1 commit into
python-openxml:masterfrom
Haasini-kudala:codex/document-undefined-styles
Open

Haasini-kudala wants to merge 1 commit into
python-openxml:masterfrom
Haasini-kudala:codex/document-undefined-styles

Conversation

@Haasini-kudala

Copy link
Copy Markdown

The styles guide says that assigning a style that is absent from the document fails silently. Assigning an undefined style by name actually raises KeyError.

Clarify the exception, explain that a latent style is not a usable style definition, and point readers to defining built-in styles in their starting document or creating custom styles with Styles.add_style() before applying them.

Fixes #170.

Validation: built the HTML documentation with the pinned Sphinx 1.8.6 and Python 3.9.6; the only Sphinx warning is the existing unknown container target in docs/user/comments.rst:134. Verified missing paragraph, run, table, and latent-only styles raise KeyError, and that built-in/custom style assignment and document save/reload work as described. git diff --check passes.

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.

docs: update styles to indicate exception raised on style not defined

1 participant