diff options
| author | John MacFarlane <[email protected]> | 2023-01-18 11:15:57 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-01-18 11:15:57 -0800 |
| commit | 8a1f4ad513cfbf922d8695e52daefe82f9f9fe80 (patch) | |
| tree | 579951309f860a5084c74ace73b843566a415277 /pandoc-lua-engine | |
| parent | 27d2dc682174f9359110be2c8ac4a772c49cd0b1 (diff) | |
Add param to tocToList for numberSections.
Otherwise sections are always numbered in the TOC,
even if `--number-sections` is not used.
Diffstat (limited to 'pandoc-lua-engine')
| -rw-r--r-- | pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Structure.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Structure.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Structure.hs index 56977edae..21248c724 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Structure.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Structure.hs @@ -29,7 +29,8 @@ import Text.Pandoc.Lua.Marshal.AST ( peekBlocksFuzzy, peekPandoc , pushBlock, pushBlocks ) import Text.Pandoc.Lua.Marshal.Chunks import Text.Pandoc.Lua.Marshal.WriterOptions ( peekWriterOptions ) -import Text.Pandoc.Options (WriterOptions (writerTOCDepth)) +import Text.Pandoc.Options (WriterOptions (writerTOCDepth, + writerNumberSections)) import Text.Pandoc.Slides (getSlideLevel, prepSlides) import Text.Pandoc.Writers.Shared (toTableOfContents) import qualified Data.Text as T @@ -168,7 +169,8 @@ table_of_contents = defun "table_of_contents" let writerOpts = fromMaybe def mwriterOpts in case tocSource of Left blks -> toTableOfContents writerOpts blks - Right tree -> tocToList (writerTOCDepth writerOpts) tree + Right tree -> tocToList (writerNumberSections writerOpts) + (writerTOCDepth writerOpts) tree ) <#> parameter peekTocSource "Blocks|Pandoc|ChunkedDoc" "toc_source" "list of command line arguments" |
