aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-26 16:46:56 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-06-26 16:46:56 +0200
commit19d9482fc400cf486547b6a670c946d3634401cf (patch)
tree8a1c12d21b394b2fe5d4761d920a1d01cc9d3f75
parent6773447c8caf31d3fc0b9390fed79ca64c6d2195 (diff)
downloadpandoc-19d9482fc400cf486547b6a670c946d3634401cf.tar.gz
OpenDocument/ODT writer: Added support for table of contents.
Closes #2836. Thanks to @anayrat.
-rw-r--r--MANUAL.txt3
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs1
2 files changed, 3 insertions, 1 deletions
diff --git a/MANUAL.txt b/MANUAL.txt
index 6499426e1..b5cea779e 100644
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -1228,7 +1228,8 @@ as the following:
: non-null value if `--toc/--table-of-contents` was specified
`toc-title`
-: title of table of contents (works only with EPUB and docx)
+: title of table of contents (works only with EPUB,
+ opendocument, odt, docx)
`include-before`
: contents specified by `-B/--include-before-body` (may have
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index 6c53ab4ab..ed3dabb87 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -220,6 +220,7 @@ writeOpenDocument opts (Pandoc meta blocks) = do
let listStyles = map listStyle (stListStyles s)
let automaticStyles = vcat $ reverse $ styles ++ listStyles
let context = defField "body" body
+ $ defField "toc" (writerTableOfContents opts)
$ defField "automatic-styles" (render' automaticStyles)
$ metadata
case writerTemplate opts of