From 1f707da40fa2a916fe6f8f86720494eadfc5ae9e Mon Sep 17 00:00:00 2001 From: niszet Date: Fri, 25 Sep 2020 01:28:38 +0900 Subject: [PATCH] Support toc-depth option for ODT writer (#6697) To support `--toc-depth` option for ODT, writer and template are updated. Closes #6696. --- data/templates/default.opendocument | 2 +- src/Text/Pandoc/Writers/OpenDocument.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/data/templates/default.opendocument b/data/templates/default.opendocument index e34c8d500..2eff86d7b 100644 --- a/data/templates/default.opendocument +++ b/data/templates/default.opendocument @@ -31,7 +31,7 @@ $include-before$ $endfor$ $if(toc)$ - + $toc-title$ diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index bd20d2db6..731f98e75 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -247,6 +247,7 @@ writeOpenDocument opts (Pandoc meta blocks) = do let automaticStyles = vcat $ reverse $ styles ++ listStyles let context = defField "body" body . defField "toc" (writerTableOfContents opts) + . defField "toc-depth" (tshow $ writerTOCDepth opts) . defField "automatic-styles" automaticStyles $ metadata return $ render colwidth $