aboutsummaryrefslogtreecommitdiff
path: root/test/pptx
diff options
context:
space:
mode:
authorEmily Bourke <undergroundquizscene@protonmail.com>2021-09-07 13:38:47 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2021-09-15 09:13:05 -0700
commit0fb6474a55427b52bf9aebd179f7b26f30c7dbaf (patch)
tree805afab753da87814146374b3305fc2f60f5024a /test/pptx
parenta3162d341b2937113514b5f515cbc86141fbfcf2 (diff)
downloadpandoc-0fb6474a55427b52bf9aebd179f7b26f30c7dbaf.tar.gz
pptx: Add support for incremental lists
- Support -i option - Support incremental/noincremental divs - Support older block quote syntax - Add tests One thing not clear from the manual is what should happen when the input uses a combination of these things. For example, what should the following produce? ```md ::: {.incremental .nonincremental} - are - these - incremental? ::: ::: incremental ::::: nonincremental - or - these? ::::: ::: ::: nonincremental > - how > - about > - these? ::: ``` In this commit I’ve taken the following approach, matching the observed behaviour for beamer and reveal.js output: - if a div with both classes, incremental wins - the innermost incremental/nonincremental div is the one which takes effect - a block quote containing a list as its first element inverts whether the list is incremental, whether or not the quote is inside an incremental/non-incremental div I’ve added some tests to verify this behaviour. This commit closes issue #5689 (https://github.com/jgm/pandoc/issues/5689).
Diffstat (limited to 'test/pptx')
-rw-r--r--test/pptx/incremental-lists/with-flag/deleted-layouts.pptxbin0 -> 80172 bytes
-rw-r--r--test/pptx/incremental-lists/with-flag/input.native139
-rw-r--r--test/pptx/incremental-lists/with-flag/moved-layouts.pptxbin0 -> 90917 bytes
-rw-r--r--test/pptx/incremental-lists/with-flag/output.pptxbin0 -> 77298 bytes
-rw-r--r--test/pptx/incremental-lists/with-flag/templated.pptxbin0 -> 90414 bytes
-rw-r--r--test/pptx/incremental-lists/without-flag/deleted-layouts.pptxbin0 -> 78405 bytes
-rw-r--r--test/pptx/incremental-lists/without-flag/input.native137
-rw-r--r--test/pptx/incremental-lists/without-flag/moved-layouts.pptxbin0 -> 89148 bytes
-rw-r--r--test/pptx/incremental-lists/without-flag/output.pptxbin0 -> 75533 bytes
-rw-r--r--test/pptx/incremental-lists/without-flag/templated.pptxbin0 -> 88645 bytes
10 files changed, 276 insertions, 0 deletions
diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx
new file mode 100644
index 000000000..5a74826a4
--- /dev/null
+++ b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx
Binary files differ
diff --git a/test/pptx/incremental-lists/with-flag/input.native b/test/pptx/incremental-lists/with-flag/input.native
new file mode 100644
index 000000000..b690794dc
--- /dev/null
+++ b/test/pptx/incremental-lists/with-flag/input.native
@@ -0,0 +1,139 @@
+[Header 1 ("slide-1-content",[],[]) [Str "Slide",Space,Str "1",Space,Str "(Content)"]
+,BulletList
+ [[Plain [Str "These"]]
+ ,[Plain [Str "bullets"]]
+ ,[Plain [Str "should"]]
+ ,[Plain [Str "be"]]
+ ,[Plain [Str "incremental"]]]
+,Header 1 ("slide-2-content",[],[]) [Str "Slide",Space,Str "2",Space,Str "(Content)"]
+,BulletList
+ [[Para [Str "as"]]
+ ,[Para [Str "should"]]
+ ,[Para [Str "these"]]]
+,Header 1 ("slide-3-content",[],[]) [Str "Slide",Space,Str "3",Space,Str "(Content)"]
+,Para [Str "Even",Space,Str "with",Space,Str "some",Space,Str "text",Space,Str "first,",Space,Str "these",Space,Str "should:"]
+,BulletList
+ [[Plain [Str "also"]]
+ ,[Plain [Str "be"]]
+ ,[Plain [Str "incremental"]]]
+,Header 1 ("slide-4-content",[],[]) [Str "Slide",Space,Str "4",Space,Str "(Content)"]
+,OrderedList (1,Decimal,Period)
+ [[Plain [Str "These"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "incremental"]]]
+,Para [Str "But",Space,Str "this",Space,Str "text",Space,Str "isn\8217t"]
+,BulletList
+ [[Plain [Str "But"]]
+ ,[Plain [Str "these"]]
+ ,[Plain [Str "are"]]]
+,Header 1 ("slide-5-two-content",[],[]) [Str "Slide",Space,Str "5",Space,Str "(Two",Space,Str "Content)"]
+,Div ("",["columns"],[])
+ [Div ("",["column"],[])
+ [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "left:"]
+ ,BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "by"]]
+ ,[Plain [Str "one"]]]
+ ,Para [Str "With",Space,Str "something",Space,Str "below"]]
+ ,Div ("",["column"],[])
+ [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "right:"]
+ ,BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "by"]]
+ ,[Plain [Str "one"]]]
+ ,Para [Str "With",Space,Str "something",Space,Str "else",Space,Str "below"]]]
+,Header 1 ("slide-6-two-content-right",[],[]) [Str "Slide",Space,Str "6",Space,Str "(Two",Space,Str "Content",Space,Str "Right)"]
+,Div ("",["columns"],[])
+ [Div ("",["column"],[])
+ [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]
+ ,Div ("",["column"],[])
+ [BulletList
+ [[Plain [Str "An"]]
+ ,[Plain [Str "Incremental"]]
+ ,[Plain [Str "List"]]]]]
+,Header 1 ("slide-7-content-with-caption",[],[]) [Str "Slide",Space,Str "7",Space,Str "(Content",Space,Str "with",Space,Str "Caption)"]
+,Para [Str "First,",Space,Str "we",Space,Str "have",Space,Str "some",Space,Str "incremental",Space,Str "bullets:"]
+,BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]
+,Para [Str "Then,",Space,Str "a",Space,Str "picture:"]
+,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")]
+,Header 1 ("slide-8-comparison",[],[]) [Str "Slide",Space,Str "8",Space,Str "(Comparison)"]
+,Div ("",["columns"],[])
+ [Div ("",["column"],[])
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]
+ ,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")]]
+ ,Div ("",["column"],[])
+ [OrderedList (1,Decimal,Period)
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]
+ ,Table ("",[],[]) (Caption Nothing
+ [])
+ [(AlignDefault,ColWidth 5.555555555555555e-2)]
+ (TableHead ("",[],[])
+ [Row ("",[],[])
+ [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+ [Plain [Str "1"]]]])
+ [(TableBody ("",[],[]) (RowHeadColumns 0)
+ []
+ [Row ("",[],[])
+ [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+ [Plain [Str "2"]]]])]
+ (TableFoot ("",[],[])
+ [])]]
+,Header 1 ("slide-9-content",[],[]) [Str "Slide",Space,Str "9",Space,Str "(Content)"]
+,Div ("",["nonincremental"],[])
+ [BulletList
+ [[Plain [Str "these"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "not"]]
+ ,[Plain [Str "incremental"]]]]
+,BulletList
+ [[Plain [Str "these"]]
+ ,[Plain [Str "are"]]]
+,Header 1 ("slide-10-content",[],[]) [Str "Slide",Space,Str "10",Space,Str "(Content)"]
+,Div ("",["incremental","nonincremental"],[])
+ [BulletList
+ [[Plain [Str "these"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "incremental"]]
+ ,[Plain [Str "(the",Space,Str "incremental",Space,Str "class",Space,Str "wins)"]]]]
+,Header 1 ("slide-11-content",[],[]) [Str "Slide",Space,Str "11",Space,Str "(Content)"]
+,Para [Str "These",Space,Str "bullets",Space,Str "are",Space,Str "not",Space,Str "incremental:"]
+,BlockQuote
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]]
+,Para [Str "These",Space,Str "are:"]
+,Div ("",["nonincremental"],[])
+ [BlockQuote
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]]]
+,Para [Str "These",Space,Str "are",Space,Str "not:"]
+,BlockQuote
+ [Div ("",["nonincremental"],[])
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]]]
+,Header 1 ("slide-12-content",[],[]) [Str "Slide",Space,Str "12",Space,Str "(Content)"]
+,Div ("",["nonincremental"],[])
+ [Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "these"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "incremental"]]]]]
+,Div ("",["incremental"],[])
+ [Div ("",["nonincremental"],[])
+ [BulletList
+ [[Plain [Str "these"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "not"]]]]]]
diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx
new file mode 100644
index 000000000..f20dd2906
--- /dev/null
+++ b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx
Binary files differ
diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx
new file mode 100644
index 000000000..d4f76f1e7
--- /dev/null
+++ b/test/pptx/incremental-lists/with-flag/output.pptx
Binary files differ
diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx
new file mode 100644
index 000000000..f5ee2ff5f
--- /dev/null
+++ b/test/pptx/incremental-lists/with-flag/templated.pptx
Binary files differ
diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx
new file mode 100644
index 000000000..16bd85ffd
--- /dev/null
+++ b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx
Binary files differ
diff --git a/test/pptx/incremental-lists/without-flag/input.native b/test/pptx/incremental-lists/without-flag/input.native
new file mode 100644
index 000000000..87a4aea7e
--- /dev/null
+++ b/test/pptx/incremental-lists/without-flag/input.native
@@ -0,0 +1,137 @@
+[Header 1 ("slide-1-content",[],[]) [Str "Slide",Space,Str "1",Space,Str "(Content)"]
+,Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "These"]]
+ ,[Plain [Str "bullets"]]
+ ,[Plain [Str "should"]]
+ ,[Plain [Str "be"]]
+ ,[Plain [Str "incremental"]]]]
+,Header 1 ("slide-2-content",[],[]) [Str "Slide",Space,Str "2",Space,Str "(Content)"]
+,BulletList
+ [[Plain [Str "These"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "not"]]]
+,Header 1 ("slide-3-content",[],[]) [Str "Slide",Space,Str "3",Space,Str "(Content)"]
+,Para [Str "Even",Space,Str "with",Space,Str "some",Space,Str "text",Space,Str "first,",Space,Str "these",Space,Str "should:"]
+,Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "also"]]
+ ,[Plain [Str "be"]]
+ ,[Plain [Str "incremental"]]]]
+,Header 1 ("slide-4-content",[],[]) [Str "Slide",Space,Str "4",Space,Str "(Content)"]
+,Div ("",["incremental"],[])
+ [OrderedList (1,Decimal,Period)
+ [[Plain [Str "These"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "incremental"]]]]
+,Para [Str "But",Space,Str "this",Space,Str "text",Space,Str "isn\8217t"]
+,Header 1 ("slide-5-two-content",[],[]) [Str "Slide",Space,Str "5",Space,Str "(Two",Space,Str "Content)"]
+,Div ("",["columns"],[])
+ [Div ("",["column"],[])
+ [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "left:"]
+ ,Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "by"]]
+ ,[Plain [Str "one"]]]]
+ ,Para [Str "With",Space,Str "something",Space,Str "below"]]
+ ,Div ("",["column"],[])
+ [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "right:"]
+ ,Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "by"]]
+ ,[Plain [Str "one"]]]]
+ ,BulletList
+ [[Plain [Str "already"]]
+ ,[Plain [Str "here"]]
+ ,[Plain [Str "though"]]]]]
+,Header 1 ("slide-6-two-content-right",[],[]) [Str "Slide",Space,Str "6",Space,Str "(Two",Space,Str "Content",Space,Str "Right)"]
+,Div ("",["columns"],[])
+ [Div ("",["column"],[])
+ [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]
+ ,Div ("",["column"],[])
+ [Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "An"]]
+ ,[Plain [Str "Incremental"]]
+ ,[Plain [Str "List"]]]]]]
+,Header 1 ("slide-7-content-with-caption",[],[]) [Str "Slide",Space,Str "7",Space,Str "(Content",Space,Str "with",Space,Str "Caption)"]
+,Para [Str "First,",Space,Str "we",Space,Str "have",Space,Str "some",Space,Str "incremental",Space,Str "bullets:"]
+,Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]]
+,Para [Str "Then,",Space,Str "a",Space,Str "picture:"]
+,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")]
+,Header 1 ("slide-8-comparison",[],[]) [Str "Slide",Space,Str "8",Space,Str "(Comparison)"]
+,Div ("",["columns"],[])
+ [Div ("",["column"],[])
+ [Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]]
+ ,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")]]
+ ,Div ("",["column"],[])
+ [Div ("",["incremental"],[])
+ [OrderedList (1,Decimal,Period)
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]]
+ ,Table ("",[],[]) (Caption Nothing
+ [])
+ [(AlignDefault,ColWidth 5.555555555555555e-2)]
+ (TableHead ("",[],[])
+ [Row ("",[],[])
+ [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+ [Plain [Str "1"]]]])
+ [(TableBody ("",[],[]) (RowHeadColumns 0)
+ []
+ [Row ("",[],[])
+ [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+ [Plain [Str "2"]]]])]
+ (TableFoot ("",[],[])
+ [])]]
+,Header 1 ("slide-10-content",[],[]) [Str "Slide",Space,Str "10",Space,Str "(Content)"]
+,Div ("",["incremental","nonincremental"],[])
+ [BulletList
+ [[Plain [Str "these"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "incremental"]]
+ ,[Plain [Str "(the",Space,Str "incremental",Space,Str "class",Space,Str "wins)"]]]]
+,Header 1 ("slide-11-content",[],[]) [Str "Slide",Space,Str "11",Space,Str "(Content)"]
+,Para [Str "These",Space,Str "bullets",Space,Str "are",Space,Str "incremental:"]
+,BlockQuote
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]]
+,Para [Str "These",Space,Str "are",Space,Str "not:"]
+,Div ("",["incremental"],[])
+ [BlockQuote
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]]]
+,Para [Str "These",Space,Str "are:"]
+,BlockQuote
+ [Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "one"]]
+ ,[Plain [Str "two"]]
+ ,[Plain [Str "three"]]]]]
+,Header 1 ("slide-12-content",[],[]) [Str "Slide",Space,Str "12",Space,Str "(Content)"]
+,Div ("",["nonincremental"],[])
+ [Div ("",["incremental"],[])
+ [BulletList
+ [[Plain [Str "these"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "incremental"]]]]]
+,Div ("",["incremental"],[])
+ [Div ("",["nonincremental"],[])
+ [BulletList
+ [[Plain [Str "these"]]
+ ,[Plain [Str "are"]]
+ ,[Plain [Str "not"]]]]]]
diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx
new file mode 100644
index 000000000..054fe918e
--- /dev/null
+++ b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx
Binary files differ
diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx
new file mode 100644
index 000000000..1b326461d
--- /dev/null
+++ b/test/pptx/incremental-lists/without-flag/output.pptx
Binary files differ
diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx
new file mode 100644
index 000000000..dee6e9b06
--- /dev/null
+++ b/test/pptx/incremental-lists/without-flag/templated.pptx
Binary files differ