Support toc-depth option for ODT writer (#6697)

To support `--toc-depth` option for ODT, writer and template are
updated.  Closes #6696.
This commit is contained in:
niszet 2020-09-25 01:28:38 +09:00 committed by GitHub
parent 09d39e0e98
commit 1f707da40f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -31,7 +31,7 @@ $include-before$
$endfor$ $endfor$
$if(toc)$ $if(toc)$
<text:table-of-content> <text:table-of-content>
<text:table-of-content-source text:outline-level="10"> <text:table-of-content-source text:outline-level="$toc-depth$">
<text:index-title-template text:style-name="Contents_20_Heading">$toc-title$</text:index-title-template> <text:index-title-template text:style-name="Contents_20_Heading">$toc-title$</text:index-title-template>
<text:table-of-content-entry-template text:outline-level="1" <text:table-of-content-entry-template text:outline-level="1"
text:style-name="Contents_20_1"> text:style-name="Contents_20_1">

View file

@ -247,6 +247,7 @@ writeOpenDocument opts (Pandoc meta blocks) = do
let automaticStyles = vcat $ reverse $ styles ++ listStyles let automaticStyles = vcat $ reverse $ styles ++ listStyles
let context = defField "body" body let context = defField "body" body
. defField "toc" (writerTableOfContents opts) . defField "toc" (writerTableOfContents opts)
. defField "toc-depth" (tshow $ writerTOCDepth opts)
. defField "automatic-styles" automaticStyles . defField "automatic-styles" automaticStyles
$ metadata $ metadata
return $ render colwidth $ return $ render colwidth $