aboutsummaryrefslogtreecommitdiff
path: root/test/docx
diff options
context:
space:
mode:
authorAgustín Martín Barbero <agusmbaterra@gmail.com>2019-01-26 16:14:35 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-01-26 16:14:35 -0800
commit9894d05fe3fd239247f755c60dc22247360be958 (patch)
tree92f5d6240edfd3bf72cc3c30295d18bef76a4077 /test/docx
parentff0aaa549d51384ef3cdcb063706dee4f6143444 (diff)
downloadpandoc-9894d05fe3fd239247f755c60dc22247360be958.tar.gz
Improve writing metadata for docx, pptx and odt (#5252)
* docx writer: support custom properties. Solves the writer part of #3024. Also supports additional core properties: `subject`, `lang`, `category`, `description`. * odt writer: improve standard properties, including the following core properties: `generator` (Pandoc/VERSION), `description`, `subject`, `keywords`, `initial-creator` (from authors), `creation-date` (actual creation date). Also fix date. * pptx writer: support custom properties. Also supports additional core properties: `subject`, `category`, `description`. * Includes golden tests. * MANUAL: document metadata support for docx, odt, pptx writers
Diffstat (limited to 'test/docx')
-rw-r--r--test/docx/document-properties-short-desc.native2
-rw-r--r--test/docx/document-properties.native2
-rw-r--r--test/docx/golden/document-properties-short-desc.docxbin0 -> 9902 bytes
-rw-r--r--test/docx/golden/document-properties.docxbin0 -> 10388 bytes
4 files changed, 4 insertions, 0 deletions
diff --git a/test/docx/document-properties-short-desc.native b/test/docx/document-properties-short-desc.native
new file mode 100644
index 000000000..fe3193dc1
--- /dev/null
+++ b/test/docx/document-properties-short-desc.native
@@ -0,0 +1,2 @@
+Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("description",MetaInlines [Str "Short",Space,RawInline (Format "html") "<i>",Str "description",RawInline (Format "html") "</i>",Space,Str "&."]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]})
+[Para [Str "Testing",Space,Str "document",Space,Str "properties"]]
diff --git a/test/docx/document-properties.native b/test/docx/document-properties.native
new file mode 100644
index 000000000..59ca53f4d
--- /dev/null
+++ b/test/docx/document-properties.native
@@ -0,0 +1,2 @@
+Pandoc (Meta {unMeta = fromList [("Company",MetaInlines [Str "My",Space,Str "Company"]),("Second Custom Property",MetaInlines [Str "Second",Space,Str "custom",Space,Str "property",Space,Str "value"]),("abstract",MetaBlocks [Plain [Str "Quite",Space,Str "a",Space,Str "long",Space,Str "description",SoftBreak,Str "spanning",Space,Str "several",Space,Str "lines"]]),("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("category",MetaInlines [Str "My",Space,Str "Category"]),("custom1",MetaInlines [Str "First",Space,Str "custom",Space,Str "property",Space,Str "value"]),("custom3",MetaInlines [Str "Escaping",Space,Str "amp",Space,Str "&",Space,Str "."]),("custom4",MetaInlines [Str "Escaping",Space,Str "LT,GT",Space,Str "<",Space,Str "asdf",Space,Str ">",Space,Str "<"]),("custom5",MetaInlines [Str "Escaping",Space,Str "html",Space,RawInline (Format "html") "<i>",Str "asdf",RawInline (Format "html") "</i>"]),("custom6",MetaInlines [Str "Escaping",Space,Emph [Str "MD"],Space,Str "\225",Space,Str "a"]),("custom9",MetaInlines [Str "Extended",Space,Str "chars:",Space,Str "\8364",Space,Str "\225",Space,Str "\233",Space,Str "\237",Space,Str "\243",Space,Str "\250",Space,Str "$"]),("description",MetaBlocks [Para [Str "Long",Space,Str "description",Space,Str "spanning",SoftBreak,Str "several",Space,Str "lines."],Plain [Str "This",Space,Str "is",Space,Str "\225",Space,Str "second",Space,RawInline (Format "html") "<i>",Str "line",RawInline (Format "html") "</i>",Str "."]]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("lang",MetaInlines [Str "en-US"]),("nested-custom",MetaList [MetaMap (fromList [("custom 7",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "7"])]),MetaMap (fromList [("custom 8",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "8"])])]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("subtitle",MetaInlines [Str "This",Space,Str "is",Space,Str "a",Space,Str "subtitle"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]})
+[Para [Str "Testing",Space,Str "document",Space,Str "properties"]]
diff --git a/test/docx/golden/document-properties-short-desc.docx b/test/docx/golden/document-properties-short-desc.docx
new file mode 100644
index 000000000..ae2813b90
--- /dev/null
+++ b/test/docx/golden/document-properties-short-desc.docx
Binary files differ
diff --git a/test/docx/golden/document-properties.docx b/test/docx/golden/document-properties.docx
new file mode 100644
index 000000000..5db470cd1
--- /dev/null
+++ b/test/docx/golden/document-properties.docx
Binary files differ