diff options
author | Emily Bourke <undergroundquizscene@protonmail.com> | 2021-08-19 15:53:21 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-09-01 07:16:17 -0700 |
commit | b82a01b6883c1f6a9ce5d3edd80d5a2453ecef9e (patch) | |
tree | 223aaee72e5f53c5abc8b3a04e31b18577dec5a5 /test/pptx/comparison | |
parent | 8dbea4909211ef7b2acc677288be7c5f10cbb40e (diff) | |
download | pandoc-b82a01b6883c1f6a9ce5d3edd80d5a2453ecef9e.tar.gz |
pptx: Add support for more layouts
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
Diffstat (limited to 'test/pptx/comparison')
25 files changed, 112 insertions, 0 deletions
diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx Binary files differnew file mode 100644 index 000000000..6a5affdbf --- /dev/null +++ b/test/pptx/comparison/both-columns/deleted-layouts.pptx diff --git a/test/pptx/comparison/both-columns/input.native b/test/pptx/comparison/both-columns/input.native new file mode 100644 index 000000000..2557880d4 --- /dev/null +++ b/test/pptx/comparison/both-columns/input.native @@ -0,0 +1,23 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Then",Space,Str "some",Space,Str "more",Space,Str "text"]] + ,Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Para [Image ("",[],[]) [Str "Plus",Space,Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx Binary files differnew file mode 100644 index 000000000..88282fabb --- /dev/null +++ b/test/pptx/comparison/both-columns/moved-layouts.pptx diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx Binary files differnew file mode 100644 index 000000000..477072fb4 --- /dev/null +++ b/test/pptx/comparison/both-columns/output.pptx diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx Binary files differnew file mode 100644 index 000000000..431d22392 --- /dev/null +++ b/test/pptx/comparison/both-columns/templated.pptx diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx Binary files differnew file mode 100644 index 000000000..beed077f7 --- /dev/null +++ b/test/pptx/comparison/extra-image/deleted-layouts.pptx diff --git a/test/pptx/comparison/extra-image/input.native b/test/pptx/comparison/extra-image/input.native new file mode 100644 index 000000000..34aeb8f2b --- /dev/null +++ b/test/pptx/comparison/extra-image/input.native @@ -0,0 +1,24 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Then",Space,Str "some",Space,Str "more",Space,Str "text"]] + ,Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Para [Image ("",[],[]) [Str "Plus",Space,Str "an",Space,Str "image"] ("lalune.jpg","fig:")] + ,Para [Image ("",[],[]) [Str "And",Space,Str "another",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx Binary files differnew file mode 100644 index 000000000..f86f5b043 --- /dev/null +++ b/test/pptx/comparison/extra-image/moved-layouts.pptx diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx Binary files differnew file mode 100644 index 000000000..a0eb5e847 --- /dev/null +++ b/test/pptx/comparison/extra-image/output.pptx diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx Binary files differnew file mode 100644 index 000000000..a434ba29f --- /dev/null +++ b/test/pptx/comparison/extra-image/templated.pptx diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx Binary files differnew file mode 100644 index 000000000..6a5affdbf --- /dev/null +++ b/test/pptx/comparison/extra-text/deleted-layouts.pptx diff --git a/test/pptx/comparison/extra-text/input.native b/test/pptx/comparison/extra-text/input.native new file mode 100644 index 000000000..2557880d4 --- /dev/null +++ b/test/pptx/comparison/extra-text/input.native @@ -0,0 +1,23 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Then",Space,Str "some",Space,Str "more",Space,Str "text"]] + ,Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Para [Image ("",[],[]) [Str "Plus",Space,Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx Binary files differnew file mode 100644 index 000000000..88282fabb --- /dev/null +++ b/test/pptx/comparison/extra-text/moved-layouts.pptx diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx Binary files differnew file mode 100644 index 000000000..8de7d23b2 --- /dev/null +++ b/test/pptx/comparison/extra-text/output.pptx diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx Binary files differnew file mode 100644 index 000000000..431d22392 --- /dev/null +++ b/test/pptx/comparison/extra-text/templated.pptx diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx Binary files differnew file mode 100644 index 000000000..bd7aa69b7 --- /dev/null +++ b/test/pptx/comparison/non-text-first/deleted-layouts.pptx diff --git a/test/pptx/comparison/non-text-first/input.native b/test/pptx/comparison/non-text-first/input.native new file mode 100644 index 000000000..a8caad151 --- /dev/null +++ b/test/pptx/comparison/non-text-first/input.native @@ -0,0 +1,21 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Plus",Space,Str "a",Space,Str "paragraph",Space,Str "here"]] + ,Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "Just",Space,Str "an",Space,Str "image",Space,Str "on",Space,Str "this",Space,Str "side"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx Binary files differnew file mode 100644 index 000000000..a01def95c --- /dev/null +++ b/test/pptx/comparison/non-text-first/moved-layouts.pptx diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx Binary files differnew file mode 100644 index 000000000..cb7843fce --- /dev/null +++ b/test/pptx/comparison/non-text-first/output.pptx diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx Binary files differnew file mode 100644 index 000000000..32db19cbf --- /dev/null +++ b/test/pptx/comparison/non-text-first/templated.pptx diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx Binary files differnew file mode 100644 index 000000000..5fd7cf9b6 --- /dev/null +++ b/test/pptx/comparison/one-column/deleted-layouts.pptx diff --git a/test/pptx/comparison/one-column/input.native b/test/pptx/comparison/one-column/input.native new file mode 100644 index 000000000..b99740a14 --- /dev/null +++ b/test/pptx/comparison/one-column/input.native @@ -0,0 +1,21 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + [])] + ,Div ("",["column"],[]) + [Para [Str "Only",Space,Str "a",Space,Str "paragraph",Space,Str "here"]]]] diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx Binary files differnew file mode 100644 index 000000000..d5df2b751 --- /dev/null +++ b/test/pptx/comparison/one-column/moved-layouts.pptx diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx Binary files differnew file mode 100644 index 000000000..6914162ff --- /dev/null +++ b/test/pptx/comparison/one-column/output.pptx diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx Binary files differnew file mode 100644 index 000000000..a30a24453 --- /dev/null +++ b/test/pptx/comparison/one-column/templated.pptx |