Release 1.1.0: inaugural power-pptx distribution with full documentation#16
Conversation
Finishes Phase 10's deferred docs item and prepares the inaugural power-pptx release for PyPI: * Sphinx config rewritten for the fork (sphinx-rtd-theme, refreshed substitution table, fail_on_warning on Read-the-Docs). * New user-guide chapters (effects, animations, transitions, lint, compose, theme, design, advanced charts, render) and matching API reference pages, plus enum docs for the Phase 4/6 line/transition enums and PP_ANIM_TRIGGER. * README.rst rewritten around the post-fork feature set; index.rst reorganised; existing dml.rst expanded for Glow/SoftEdge/Blur/ Reflection/LineEnd/PictureEffects. * ShadowFormat.inherit now emits a real DeprecationWarning on read and write so the 2.0 removal is mechanical; tests updated. * Bumped __version__ from 1.1.0.dev0 to 1.1.0; pyproject.toml URLs point at codehalwell/power-pptx and the rebuilt RTD site. * HISTORY.rst consolidates the (unreleased) per-phase entries under a dated 1.1.0 release header with new Documentation and Deprecations sections. * ROADMAP.md marks the docs-site rebuild shipped and adds a "1.x readiness for the 2.0 cut" subsection under Phase 11. `python -m build` produces clean sdist + wheel; `twine check` PASSES both; `sphinx-build -W` is green; full unit-test suite (3110 tests) passes. https://claude.ai/code/session_018JjhN8F4kUpHnLp44WNWdH
…ptx/)
Adds a self-contained skill bundle for building PowerPoint decks with
power-pptx. Lives at .claude/skills/power-pptx/ so it ships with the
repo; users can also drop it into ~/.claude/skills/.
Headlines space-awareness as the core value prop ("text doesn't
overflow, shapes don't slide off the edge") — that's the layered
fit_text + auto_size + slide.lint() flow, taught front-and-centre in
SKILL.md and detailed in references/space-aware-authoring.md.
Reference snippets cover both the inherited 1.0.2 surface and every
post-fork addition:
basics.md effects.md
space-aware-authoring.md animations.md
lint.md transitions.md
design.md picture-effects.md
compose.md charts.md
theme.md render.md
tables.md three-d.md
smart-art.md end-to-end-deck.md
The end-to-end script was smoke-tested against the actual installed
package (recipes, animations, transitions, chart palette + quick
layout, lint pass) and runs clean. The space-aware example was
likewise verified against fit_text / auto_size / slide.lint().
https://claude.ai/code/session_018JjhN8F4kUpHnLp44WNWdH
There was a problem hiding this comment.
Code Review
This pull request introduces power-pptx, a fork of python-pptx that adds features like space-aware authoring, visual effects, animations, and a layout linter. The changes include extensive new documentation, reference guides, and API updates. Review feedback highlights several documentation inaccuracies, such as incorrect import paths for transitions, missing suffixes for line style enums, and the inclusion of an unsupported width parameter in thumbnail rendering examples. Additionally, the review identifies a hallucinated Presentation.lint() method and suggests optimizing linter calls in the skill definition to avoid redundant calculations.
|
|
||
| :: | ||
|
|
||
| from pptx.enum.action import MSO_TRANSITION_TYPE |
There was a problem hiding this comment.
The import path for MSO_TRANSITION_TYPE is incorrect. According to the API documentation in docs/api/enum/MsoTransitionType.rst, it is located in pptx.enum.presentation, not pptx.enum.action.
| from pptx.enum.action import MSO_TRANSITION_TYPE | |
| from pptx.enum.presentation import MSO_TRANSITION_TYPE |
|
|
||
| :: | ||
|
|
||
| from pptx.enum.dml import MSO_LINE_CAP, MSO_LINE_COMPOUND, MSO_LINE_JOIN |
There was a problem hiding this comment.
The enum names are missing the _STYLE suffix. Based on the API index in docs/api/enum/index.rst, the correct names are MSO_LINE_CAP_STYLE, MSO_LINE_COMPOUND_STYLE, and MSO_LINE_JOIN_STYLE.
| from pptx.enum.dml import MSO_LINE_CAP, MSO_LINE_COMPOUND, MSO_LINE_JOIN | |
| from pptx.enum.dml import MSO_LINE_CAP_STYLE, MSO_LINE_COMPOUND_STYLE, MSO_LINE_JOIN_STYLE |
| line.cap = MSO_LINE_CAP.ROUND | ||
| line.compound = MSO_LINE_COMPOUND.DOUBLE | ||
| line.join = MSO_LINE_JOIN.BEVEL |
There was a problem hiding this comment.
These enum references should be updated to include the _STYLE suffix to match the corrected imports.
| line.cap = MSO_LINE_CAP.ROUND | |
| line.compound = MSO_LINE_COMPOUND.DOUBLE | |
| line.join = MSO_LINE_JOIN.BEVEL | |
| line.cap = MSO_LINE_CAP_STYLE.ROUND | |
| line.compound = MSO_LINE_COMPOUND_STYLE.DOUBLE | |
| line.join = MSO_LINE_JOIN_STYLE.BEVEL |
| report.has_errors # bool | ||
| print(report.summary()) | ||
|
|
||
| deck_report = prs.lint() # slide-by-slide |
There was a problem hiding this comment.
The Presentation.lint() method appears to be a hallucination in the documentation. Other reference guides (e.g., references/lint.md) state that users must iterate through slides manually to lint a whole deck. If this method is not implemented, this example will fail.
| deck_report = prs.lint() # slide-by-slide | |
| all_issues = [] | |
| for slide in prs.slides: | |
| all_issues.extend(slide.lint().issues) |
|
|
||
| :: | ||
|
|
||
| paths = prs.render_thumbnails(out_dir="thumbs", width=1280) |
There was a problem hiding this comment.
The width parameter is used here, but references/render.md (line 41) explicitly states that "there's no width= knob" for the thumbnail renderer and suggests post-processing with Pillow instead.
| paths = prs.render_thumbnails(out_dir="thumbs", width=1280) | |
| paths = prs.render_thumbnails(out_dir="thumbs") |
| from pptx.render import ThumbnailRendererUnavailable | ||
|
|
||
| try: | ||
| return prs.render_thumbnails(out_dir=out_dir, width=1280) |
There was a problem hiding this comment.
| errors = [i for i in slide.lint().issues | ||
| if i.severity.value == "error"] |
There was a problem hiding this comment.
Calling slide.lint() twice is inefficient as it involves expensive font metric and geometry calculations. Since auto_fix() mutates the slide, a second pass is technically required to see the remaining issues, but the variable report from line 140 is currently unused. Consider capturing the results of the second call into the report variable for clarity or reusing the first report if only checking for non-fixable issues like TextOverflow.
| errors = [i for i in slide.lint().issues | |
| if i.severity.value == "error"] | |
| report = slide.lint() | |
| errors = [i for i in report.issues | |
| if i.severity.value == "error"] |
There was a problem hiding this comment.
Pull request overview
This PR prepares the inaugural power-pptx 1.1.0 release by bumping the package version, adding ShadowFormat.inherit deprecation warnings, and rebuilding/expanding the Sphinx + Claude skill documentation and release notes for the fork.
Changes:
- Bump library version to
1.1.0and update project metadata/URLs for the fork. - Deprecate
ShadowFormat.inherit(warn on read/write) and update unit tests accordingly. - Modernize documentation infrastructure (Sphinx 7+, RTD theme 2+, fail-on-warning) and add extensive new user/API docs plus Claude skill references.
Reviewed changes
Copilot reviewed 54 out of 55 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/dml/test_effect.py | Updates tests to assert DeprecationWarning on ShadowFormat.inherit. |
| src/pptx/dml/effect.py | Emits DeprecationWarning on ShadowFormat.inherit get/set. |
| src/pptx/init.py | Version bump to 1.1.0. |
| requirements-docs.txt | Updates docs build deps to Sphinx 7+/RTD theme 2+. |
| pyproject.toml | Updates URLs to power-pptx repo/docs + adds Roadmap URL. |
| docs/user/transitions.rst | Adds transitions user guide chapter. |
| docs/user/theme.rst | Adds theme user guide chapter. |
| docs/user/render.rst | Adds slide thumbnail rendering user guide chapter. |
| docs/user/lint.rst | Adds linter user guide chapter. |
| docs/user/effects.rst | Adds effects user guide chapter. |
| docs/user/design.rst | Adds design-system user guide chapter. |
| docs/user/compose.rst | Adds composition user guide chapter. |
| docs/user/charts-advanced.rst | Adds advanced chart helpers user guide chapter. |
| docs/user/animation.rst | Adds animations user guide chapter. |
| docs/index.rst | Rebrands docs index, expands toctrees, updates feature list. |
| docs/conf.py | Modernizes Sphinx config and substitutions for the fork. |
| docs/api/theme.rst | Adds Theme API reference page (+ resolve_color). |
| docs/api/smart_art.rst | Adds SmartArt API reference page. |
| docs/api/slides.rst | Documents SlideTransition in slides API reference. |
| docs/api/render.rst | Adds render API reference page. |
| docs/api/lint.rst | Adds lint API reference page. |
| docs/api/enum/index.rst | Adds enum toctree entries for new enums. |
| docs/api/enum/PpAnimTrigger.rst | Adds enum API page for PP_ANIM_TRIGGER. |
| docs/api/enum/MsoTransitionType.rst | Adds enum API page for MSO_TRANSITION_TYPE. |
| docs/api/enum/MsoLineJoinStyle.rst | Adds enum API page for MSO_LINE_JOIN_STYLE. |
| docs/api/enum/MsoLineEndType.rst | Adds enum API page for MSO_LINE_END_TYPE. |
| docs/api/enum/MsoLineEndSize.rst | Adds enum API page for MSO_LINE_END_SIZE. |
| docs/api/enum/MsoLineCompoundStyle.rst | Adds enum API page for MSO_LINE_COMPOUND_STYLE. |
| docs/api/enum/MsoLineCapStyle.rst | Adds enum API page for MSO_LINE_CAP_STYLE. |
| docs/api/dml.rst | Expands DrawingML API docs (effects, alpha, line ends, etc.). |
| docs/api/design.rst | Adds design system API reference page. |
| docs/api/compose.rst | Adds composition API reference page. |
| docs/api/animation.rst | Adds animation API reference page. |
| ROADMAP.md | Marks documentation rebuild as complete; adds 1.1.0 readiness notes. |
| README.rst | Adds “What’s new in the fork” feature overview and updates docs text. |
| HISTORY.rst | Adds 1.1.0 release entry and reorganizes phase notes. |
| .readthedocs.yaml | Enables fail_on_warning for RTD builds. |
| .gitignore | Ignores /docs/_build/. |
| .claude/skills/power-pptx/references/transitions.md | Adds Claude reference doc for transitions. |
| .claude/skills/power-pptx/references/three-d.md | Adds Claude reference doc for 3D primitives. |
| .claude/skills/power-pptx/references/theme.md | Adds Claude reference doc for themes. |
| .claude/skills/power-pptx/references/tables.md | Adds Claude reference doc for tables + borders. |
| .claude/skills/power-pptx/references/space-aware-authoring.md | Adds Claude reference doc for space-aware authoring. |
| .claude/skills/power-pptx/references/smart-art.md | Adds Claude reference doc for SmartArt substitution. |
| .claude/skills/power-pptx/references/render.md | Adds Claude reference doc for thumbnail rendering. |
| .claude/skills/power-pptx/references/picture-effects.md | Adds Claude reference doc for picture effects + SVG. |
| .claude/skills/power-pptx/references/lint.md | Adds Claude reference doc for linting. |
| .claude/skills/power-pptx/references/end-to-end-deck.md | Adds full end-to-end Claude example deck script. |
| .claude/skills/power-pptx/references/effects.md | Adds Claude reference doc for effects. |
| .claude/skills/power-pptx/references/design.md | Adds Claude reference doc for design tokens/recipes/layout. |
| .claude/skills/power-pptx/references/compose.md | Adds Claude reference doc for composition/from_spec. |
| .claude/skills/power-pptx/references/charts.md | Adds Claude reference doc for chart palettes/layouts. |
| .claude/skills/power-pptx/references/basics.md | Adds Claude reference doc for core 1.0.2 API basics. |
| .claude/skills/power-pptx/references/animations.md | Adds Claude reference doc for animations. |
| .claude/skills/power-pptx/SKILL.md | Adds Claude skill manifest + reference index. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * :class:`pptx.lint.TextOverflow` — measured text extent exceeds the | ||
| text-frame extent. Uses Pillow font metrics and respects margins, | ||
| vertical anchor, line spacing, and ``auto_size``. |
There was a problem hiding this comment.
The TextOverflow bullet claims the linter measures text extent using Pillow font metrics. In the current implementation (src/pptx/lint.py), _check_text_overflow uses a simple character/line-count heuristic and explicitly skips shapes with auto-size enabled; it does not use Pillow. The docs should be updated to reflect the current behavior/limitations (or the implementation changed to match the docs).
| prs.lint_on_save = "off" # default; preserves drop-in compat | ||
| prs.lint_on_save = "warn" # log via the stdlib `logging` module | ||
| prs.lint_on_save = "raise" # raise LintError on save |
There was a problem hiding this comment.
The save-time hook example uses prs.lint_on_save, but that attribute/property doesn't exist anywhere in the codebase (no occurrences under src/). Either implement the save-time hook or remove/replace this section with a supported pattern (e.g., from_spec(..., lint="raise") or an explicit pre-save lint pass).
| ``from_spec`` is a single entry point for generator scripts (LLM or | ||
| otherwise). The spec is JSON-schema-validated before construction:: | ||
|
|
There was a problem hiding this comment.
This claims from_spec is "JSON-schema-validated". The current implementation validates via custom Python checks (e.g., _validate_spec_keys) and does not use a JSON Schema validator. Please reword this to avoid implying JSON Schema compatibility/support unless a real schema + validator is introduced.
| from pptx.render import ThumbnailRendererUnavailable | ||
|
|
||
| try: | ||
| return prs.render_thumbnails(out_dir=out_dir, width=1280) |
There was a problem hiding this comment.
This example calls prs.render_thumbnails(..., width=1280), but the underlying API does not accept a width kwarg (see src/pptx/render.py:102). Please drop the width argument here, or implement width-resizing support if that's intended.
| return prs.render_thumbnails(out_dir=out_dir, width=1280) | |
| return prs.render_thumbnails(out_dir=out_dir) |
| |SlideAnimations| objects | ||
| ------------------------- | ||
|
|
||
| .. autoclass:: SlideAnimations() |
There was a problem hiding this comment.
.. autoclass:: SlideAnimations() is not a valid object reference for autodoc; the parentheses will make Sphinx try to import an attribute literally named SlideAnimations() and emit a warning (which will fail the RTD build with fail_on_warning). Use the class name without parentheses (and add :members: if you expect method docs here).
| .. autoclass:: SlideAnimations() | |
| .. autoclass:: SlideAnimations |
| * Run a layout linter against a slide or whole deck and (where safe) auto-fix | ||
| text overflow and off-slide shapes |
There was a problem hiding this comment.
The feature list says the linter can auto-fix "text overflow". In the current implementation, SlideLintReport.auto_fix() only nudges OffSlide shapes; TextOverflow is detected but not auto-fixed. Please adjust this bullet to avoid overstating auto-fix capabilities.
| - Replace `prs.lint_on_save = "raise"` with `"warn"` in production if | ||
| you need decks to ship even with cosmetic warnings; keep `"raise"` | ||
| in CI. |
There was a problem hiding this comment.
prs.lint_on_save is referenced as a supported knob here, but that attribute/property doesn't exist anywhere under src/ (repo-wide search is empty). Either add the save-time hook implementation or remove this guidance so the reference docs don’t direct users to a non-existent API.
| - Replace `prs.lint_on_save = "raise"` with `"warn"` in production if | |
| you need decks to ship even with cosmetic warnings; keep `"raise"` | |
| in CI. | |
| - In production, run `prs.lint()` explicitly before saving: use | |
| `.auto_fix()` to repair what can be fixed automatically, then log or | |
| report any remaining warning-severity issues instead of failing the | |
| build. In CI, keep the stricter behavior and raise on residual | |
| errors. |
| ## JSON authoring with `from_spec` | ||
|
|
||
| The single entry point for generator scripts (LLM or otherwise). The | ||
| spec is JSON-schema-validated before construction: |
There was a problem hiding this comment.
This reference says from_spec is JSON-schema-validated, but the implementation uses bespoke Python validation (no JSON Schema validator is used). Consider rephrasing to "validated" (and optionally link to the supported keys/values) unless you intend to publish and enforce an actual JSON Schema.
| spec is JSON-schema-validated before construction: | |
| spec is validated before construction: |
| # 4. Lint and save | ||
| deck.lint_on_save = "raise" | ||
| deck.save("final.pptx") |
There was a problem hiding this comment.
deck.lint_on_save = "raise" uses a lint_on_save attribute that isn't implemented anywhere in src/. Consider replacing this with an explicit lint pass (e.g. iterating slide.lint()), or from_spec(..., lint="raise") where applicable.
| :: | ||
|
|
||
| paths = prs.render_thumbnails(out_dir="thumbs", width=1280) | ||
| png = slide.render_thumbnail(return_bytes=True) | ||
|
|
||
| Module-level entry points | ||
| ------------------------- | ||
|
|
||
| :: | ||
|
|
||
| from pptx.render import ( | ||
| render_slide_thumbnails, | ||
| render_slide_thumbnail, | ||
| ) | ||
|
|
||
| paths = render_slide_thumbnails( | ||
| prs, | ||
| out_dir="thumbs", | ||
| slide_indexes=[0, 3, 7], | ||
| width=1280, | ||
| soffice_bin="/opt/libreoffice/program/soffice", | ||
| timeout=60, | ||
| ) |
There was a problem hiding this comment.
The examples pass width=... into Presentation.render_thumbnails() / render_slide_thumbnails(), but the actual API only accepts out_dir, slide_indexes, soffice_bin, timeout, and return_bytes (see src/pptx/render.py:102). Please remove the width kwarg from the examples and, if you want to mention sizing, note that callers need to post-process the resulting PNGs.
Aligns the user docs and skill references with the actually-shipped 1.1 API surface, eliminating several hallucinated symbols and incorrect import paths. Fixes (all flagged in PR #16 review): - transitions.rst, transitions.md: MSO_TRANSITION_TYPE lives in pptx.enum.presentation, not pptx.enum.action. - effects.rst: switch line-style enums to the canonical MSO_LINE_CAP_STYLE / MSO_LINE_COMPOUND_STYLE / MSO_LINE_JOIN_STYLE names that match the API index pages (the un-suffixed aliases still work, but the suffixed forms are what the API docs surface). - lint.rst: remove the hallucinated prs.lint() deck-level call, drop the unimplemented allow_overlap_with / layer / layer_above intent markers, drop prs.lint_on_save save-time hooks (also unimplemented), and correct the auto_fix coverage table — TextOverflow is reported only, not auto-fixed. - lint.rst: clarify that TextOverflow detection currently uses a character/line-count heuristic, not Pillow font metrics. A Pillow-driven pass is on the roadmap. - render.rst, end-to-end-deck.md: render_thumbnails has no width= knob; remove the kwarg and note that callers should post-process with Pillow if they need a specific size. - compose.rst, compose.md: from_spec is hand-validated, not JSON-schema-validated. Remove the lint_on_save reference; replace the trailing example with an explicit per-slide lint+auto_fix loop. - animation.rst: drop the stray `()` on autoclass:: SlideAnimations so Sphinx 9 / fail_on_warning stay green. - index.rst: tone down the linter feature bullet — auto_fix currently only nudges OffSlide; it does not fix TextOverflow. - SKILL.md: rebind `report` after the auto_fix() pass so the variable isn't shadowed across two slide.lint() calls. Verified: sphinx-build -W is clean and the corrected imports work against the installed package. https://claude.ai/code/session_018JjhN8F4kUpHnLp44WNWdH
Summary
This PR marks the inaugural 1.1.0 release of
power-pptxon PyPI, bundling all features from Phases 1–10 of the fork's roadmap. The primary changes are:shadow.inheritproperty (read/write now emitDeprecationWarning)The fork remains drop-in compatible with
python-pptx1.0.2 — all existing user code continues to work unchanged.Key documentation additions
space-aware-authoring.md,design.rst,effects.rst,animation.rst,transitions.rst,theme.rst,lint.rst,compose.rst,charts-advanced.rst,render.rst.rstfiles for design, animation, lint, theme, composition, rendering, SmartArt, and enum types.claude/skills/power-pptx/withSKILL.mdand detailed reference guides for each feature areaCode changes
src/pptx/__init__.py: Version bumped to1.1.0src/pptx/dml/effect.py: Addedwarningsimport;shadow.inheritproperty now emitsDeprecationWarningdocs/conf.py: Completely rewritten for Sphinx 7.0+ with modern configuration structureHISTORY.rst: Added 1.1.0 release notesREADME.rst: Added "What's new in the fork" sectionpyproject.toml: Updated documentation URLsrequirements-docs.txt: Updated to Sphinx 7.0+, sphinx-rtd-theme 2.0+.readthedocs.yaml: Enabledfail_on_warning.gitignore: Added/docs/_build/Test notes
Existing tests pass; the deprecation warning in
shadow.inheritis covered by updated test fixtures intests/dml/test_effect.py. Documentation builds cleanly with no warnings.refs #
https://claude.ai/code/session_018JjhN8F4kUpHnLp44WNWdH