diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-06-26 16:46:56 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-06-26 16:46:56 +0200 |
commit | 19d9482fc400cf486547b6a670c946d3634401cf (patch) | |
tree | 8a1c12d21b394b2fe5d4761d920a1d01cc9d3f75 | |
parent | 6773447c8caf31d3fc0b9390fed79ca64c6d2195 (diff) | |
download | pandoc-19d9482fc400cf486547b6a670c946d3634401cf.tar.gz |
OpenDocument/ODT writer: Added support for table of contents.
Closes #2836.
Thanks to @anayrat.
-rw-r--r-- | MANUAL.txt | 3 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/OpenDocument.hs | 1 |
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 |