From b82a01b6883c1f6a9ce5d3edd80d5a2453ecef9e Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 19 Aug 2021 15:53:21 +0100 Subject: pptx: Add support for more layouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now, the pptx writer only supported four slide layouts: “Title Slide” (used for the automatically generated metadata slide), “Section Header” (used for headings above the slide level), “Two Column” (used when there’s a columns div containing at least two column divs), and “Title and Content” (used for all other slides). This commit adds support for three more layouts: Comparison, Content with Caption, and Blank. - Support “Comparison” slide layout This layout is used when a slide contains at least two columns, at least one of which contains some text followed by some non-text (e.g. an image or table). The text in each column is inserted into the “body” placeholder for that column, and the non-text is inserted into the ObjType placeholder. Any extra content after the non-text is overlaid on top of the preceding content, rather than dropping it completely (as currently happens for the two-column layout). + Accept straightforward test changes Adding the new layout means the “-deleted-layouts” tests have an additional layout added to the master and master rels. + Add new tests for the comparison layout + Add new tests to pandoc.cabal - Support “Content with Caption” slide layout This layout is used when a slide’s body contains some text, followed by non-text (e.g. and image or a table). Before now, in this case the image or table would break onto a new slide: to get that output again, users can add a horizontal rule before the image or table. + Accept straightforward tests The “-deleted-layouts” tests all have an extra layout and relationship in the master for the Content with Caption layout. + Accept remove-empty-slides test Empty slides are still removed, but the Content with Caption layout is now used. + Change slide-level-0/h1-h2-with-text description This test now triggers the content with caption layout, giving a different (but still correct) result. + Add new tests for the new layout + Add new tests to the cabal file - Support “Blank” slide layout This layout is used when a slide contains only blank content (e.g. non-breaking spaces). No content is inserted into any placeholders in the layout. Fixes #5097. + Accept straightforward test changes Blank layout now copied over from reference doc as well, when layouts have been deleted. + Add some new tests A slide should use the blank layout if: - It contains only speaker notes - It contains only an empty heading with a body of nbsps - It contains only a heading containing only nbsps - Change ContentType -> Placeholder This type was starting to have a constructor for each placeholder on each slide (e.g. `ComparisonUpperLeftContent`). I’ve changed it instead to identify a placeholder by type and index, as I think that’s clearer and less redundant. - Describe layout-choosing logic in manual --- .../heading-text-image/deleted-layouts.pptx | Bin 0 -> 45549 bytes .../heading-text-image/input.native | 3 +++ .../heading-text-image/moved-layouts.pptx | Bin 0 -> 56248 bytes .../content-with-caption/heading-text-image/output.pptx | Bin 0 -> 42677 bytes .../heading-text-image/templated.pptx | Bin 0 -> 55749 bytes .../image-text/deleted-layouts.pptx | Bin 0 -> 46248 bytes test/pptx/content-with-caption/image-text/input.native | 2 ++ .../content-with-caption/image-text/moved-layouts.pptx | Bin 0 -> 56934 bytes test/pptx/content-with-caption/image-text/output.pptx | Bin 0 -> 43374 bytes .../pptx/content-with-caption/image-text/templated.pptx | Bin 0 -> 56435 bytes .../text-image/deleted-layouts.pptx | Bin 0 -> 45488 bytes test/pptx/content-with-caption/text-image/input.native | 2 ++ .../content-with-caption/text-image/moved-layouts.pptx | Bin 0 -> 56188 bytes test/pptx/content-with-caption/text-image/output.pptx | Bin 0 -> 42616 bytes .../pptx/content-with-caption/text-image/templated.pptx | Bin 0 -> 55689 bytes 15 files changed, 7 insertions(+) create mode 100644 test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/input.native create mode 100644 test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/output.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/templated.pptx create mode 100644 test/pptx/content-with-caption/image-text/deleted-layouts.pptx create mode 100644 test/pptx/content-with-caption/image-text/input.native create mode 100644 test/pptx/content-with-caption/image-text/moved-layouts.pptx create mode 100644 test/pptx/content-with-caption/image-text/output.pptx create mode 100644 test/pptx/content-with-caption/image-text/templated.pptx create mode 100644 test/pptx/content-with-caption/text-image/deleted-layouts.pptx create mode 100644 test/pptx/content-with-caption/text-image/input.native create mode 100644 test/pptx/content-with-caption/text-image/moved-layouts.pptx create mode 100644 test/pptx/content-with-caption/text-image/output.pptx create mode 100644 test/pptx/content-with-caption/text-image/templated.pptx (limited to 'test/pptx/content-with-caption') diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx new file mode 100644 index 000000000..b5afcc021 Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/input.native b/test/pptx/content-with-caption/heading-text-image/input.native new file mode 100644 index 000000000..576bc1658 --- /dev/null +++ b/test/pptx/content-with-caption/heading-text-image/input.native @@ -0,0 +1,3 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Para [Str "Some",Space,Str "text",Space,Str "here"] +,Para [Image ("",[],[]) [Str "Followed",Space,Str "by",Space,Str "a",Space,Str "picture"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx new file mode 100644 index 000000000..05806a767 Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx new file mode 100644 index 000000000..b3e89757b Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx new file mode 100644 index 000000000..3b0fe64c3 Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx new file mode 100644 index 000000000..e9e0551ac Binary files /dev/null and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/input.native b/test/pptx/content-with-caption/image-text/input.native new file mode 100644 index 000000000..2ffbf0888 --- /dev/null +++ b/test/pptx/content-with-caption/image-text/input.native @@ -0,0 +1,2 @@ +[Para [Image ("",[],[]) [Str "The",Space,Str "picture",Space,Str "first"] ("lalune.jpg","fig:")] +,Para [Str "Then",Space,Str "some",Space,Str "text",Space,Str "here"]] diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx new file mode 100644 index 000000000..77d706ed3 Binary files /dev/null and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx new file mode 100644 index 000000000..94a2e8b88 Binary files /dev/null and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx new file mode 100644 index 000000000..bef1921a7 Binary files /dev/null and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx new file mode 100644 index 000000000..68d3d7b9b Binary files /dev/null and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/input.native b/test/pptx/content-with-caption/text-image/input.native new file mode 100644 index 000000000..762d18426 --- /dev/null +++ b/test/pptx/content-with-caption/text-image/input.native @@ -0,0 +1,2 @@ +[Para [Str "Some",Space,Str "text",Space,Str "here"] +,Para [Image ("",[],[]) [Str "Followed",Space,Str "by",Space,Str "a",Space,Str "picture"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx new file mode 100644 index 000000000..feade1096 Binary files /dev/null and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx new file mode 100644 index 000000000..efa814d65 Binary files /dev/null and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx new file mode 100644 index 000000000..ebd552252 Binary files /dev/null and b/test/pptx/content-with-caption/text-image/templated.pptx differ -- cgit v1.2.3