Make the element JSON round trip match the docs (4 small fixes)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Issue #585 adds the round-trip tests in tests/test_element_roundtrip.py; read that file and choose one of the four named cases, then inspect its listed builder or converter entry point. Run the matching test with uv run pytest tests/test_element_roundtrip.py -k <test_name> -v; done means removing that case's strict xfail marker, passing the test, and adding a short entry under [Unreleased] → Fixed in CHANGELOG.md. An open linked pull request (#593) means work is already underway.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What problem would this solve?
Agents write slide JSON from the guides in sdpm/references/guides/. Two things follow from that:
- Every key the guides document should work in the builder.
- JSON that
pptx_to_jsonwrites should rebuild into the same slide, so the builder must accept whatever the converter emits.
#585 adds round-trip tests for shape, freeform, line, textbox, group and image elements (tests/test_element_roundtrip.py). Four cases where the docs, the converter and the builder disagree are left as xfail(strict=True) tests. Each one is a small, self-contained fix.
Proposed solution
Once #585 is merged, pick any item below. A PR that fixes a single item is welcome.
-
Shape paragraphs accept the documented
listkey.- Now: shape
paragraphsonly make a bullet from"bullet": true(or a bullet character). The documented form"list": {"type": "disc"}(sdpm/references/guides/slide-json-elements.md, shape section) is ignored, so no bullet is drawn. - Expected:
list: {type: disc}makes a bullet. Keepbulletas an alias so existing JSON still works. - Files:
sdpm/sdpm/engine/builder/elements/shape.py(_add_shape, theparagraphsbranch). The textbox builder (sdpm/sdpm/engine/builder/elements/textbox.py) already handleslistand is a good model. - Test:
TestShapeText::test_documented_paragraph_list_makes_a_bullet
- Now: shape
-
Shape
lineOpacitytakes effect.- Now:
lineOpacityis documented for shapes, but only freeforms apply it, and only freeforms extract it. - Expected: a shape with
lineandlineOpacitygets an alpha on its outline colour, andpptx_to_jsonreads it back. Share the freeform code rather than copying it. - Files:
sdpm/sdpm/engine/builder/elements/shape.py(line colour branch of_add_shape); freeform logic to reuse is insdpm/sdpm/engine/builder/formatting.py(_apply_shape_formatting) andsdpm/sdpm/engine/converter/elements/shapes.py(extract_freeform_element→extract_shape_element). - Test:
TestShapeText::test_line_opacity
- Now:
-
Fixed paragraph line spacing survives a rebuild.
- Now: for a paragraph with fixed line spacing (
a:spcPts), the converter writes"lineSpacing": <1/100 pt>. The textbox builder reads onlylineSpacingPctper paragraph, so the spacing is lost when the JSON is rebuilt. - Expected: the builder reads the converter's paragraph-level fixed spacing and writes
a:lnSpc/a:spcPts. Before choosing the key, check its naming and units against the element-levellineSpacingPt. - Files:
sdpm/sdpm/engine/builder/elements/textbox.py(paragraphsloop),sdpm/sdpm/engine/converter/elements/textbox.py(wherelineSpacingis written). - Test:
TestTextboxParagraphs::test_fixed_line_spacing_survives_a_second_build
- Now: for a paragraph with fixed line spacing (
-
Picture borders are extracted.
- Now: the builder writes
line/lineWidthon raster images, butpptx_to_jsondrops them, so a bordered picture comes back without its border. - Expected: the converter extracts the picture outline as
line/lineWidth. - Files:
sdpm/sdpm/engine/converter/elements/media.py(extract_picture_element).sdpm/sdpm/engine/converter/xml_helpers.pyhas line helpers already used for shapes. - Test:
TestImageProperties::test_border_survives
- Now: the builder writes
Done when the matching xfail marker is removed and the test passes. Also add a short entry under [Unreleased] → Fixed in CHANGELOG.md.
How to run the tests (no LibreOffice needed):
uv run pytest tests/test_element_roundtrip.py -v
uv run pytest tests/test_element_roundtrip.py -k test_line_opacity -v # one item
make lint
Which area?
Slide generation / engine (layouts, elements, charts)
- Ngôn ngữ chính
- Python
- Star
- 136
- Fork
- 13
- Merge trung bình
- 7 giờ 36 phút
- Pull request đã merge (30 ngày)
- 175
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws-samples/sample-spec-driven-presentation-maker
-
Charts: setting `valueAxis` skips theme styling of axis labels and axis linesCó thể đã có người làm @ShotaroKataoka đã nhận hôm nay. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
aws-samples/sample-spec-driven-presentation-maker#630 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
aws-samples/sample-spec-driven-presentation-maker#627 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
aws-samples/sample-spec-driven-presentation-maker#622 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Charts: add radar charts (chartType "radar")Có thể đã có người làm @tridev-tej đã nhận 3 ngày trước. Đang mởenhancement good first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
aws-samples/sample-spec-driven-presentation-maker#621 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 77/100
aws-samples/sample-spec-driven-presentation-maker#620 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aws-samples/sample-spec-driven-presentation-maker
Issue tương tự
-
area: ci bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
hffgzktbcc-blip/ounce-core#484 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
ranxianglei/billion-context#7063 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
MakazhanAlpamys/Soup#2971 ·
Maintainer thường phản hồi trong vòng 1 ngày