Support toc-depth option for ODT writer (#6697)
To support `--toc-depth` option for ODT, writer and template are
updated. Closes #6696.
commit1f707da40fa2a916fe6f8f86720494eadfc5ae9e
authorniszet <niszet0016@gmail.com>
dateFri 25 Sep 2020, 01:28 (6 years ago)
parent09d39e0
data/templates/default.opendocument+1−1
@@ -31,7 +31,7 @@ $include-before$
3131$endfor$
3232$if(toc)$
3333<text:table-of-content>
34− <text:table-of-content-source text:outline-level="10">
34+ <text:table-of-content-source text:outline-level="$toc-depth$">
3535 <text:index-title-template text:style-name="Contents_20_Heading">$toc-title$</text:index-title-template>
3636 <text:table-of-content-entry-template text:outline-level="1"
3737 text:style-name="Contents_20_1">
src/Text/Pandoc/Writers/OpenDocument.hs+1
@@ -247,6 +247,7 @@ writeOpenDocument opts (Pandoc meta blocks) = do
247247 let automaticStyles = vcat $ reverse $ styles ++ listStyles
248248 let context = defField "body" body
249249 . defField "toc" (writerTableOfContents opts)
250+ . defField "toc-depth" (tshow $ writerTOCDepth opts)
250251 . defField "automatic-styles" automaticStyles
251252 $ metadata
252253 return $ render colwidth $