summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App/OutputSettings.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-01-30 18:41:44 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2023-01-30 21:09:02 -0800
commit8fc4fc66a31a7a13db9072ebdf0c3f017d6ec51e (patch)
treebdef1df49034727a5cb1cf4821aa7e92a306c006 /src/Text/Pandoc/App/OutputSettings.hs
parent1193bb59641f0fa0ab033d0382916be4c83e07da (diff)
Add new `--chunk-template` option (closes #8581).
* Add `--chunk-template` CLI option, allowing more control over the chunk filenames in chunked HTML output. * Text.Pandoc.App: Add `optChunkTemplate` constructor to Opt [API change]. * Text.Pandoc.Options: add `writerChunkTemplate` contsructor to WriterOptions [API change]. * Text.Pandoc.Chunks: add Data, Typeable, Generic instances for PathTemplate.
Diffstat (limited to 'src/Text/Pandoc/App/OutputSettings.hs')
-rw-r--r--src/Text/Pandoc/App/OutputSettings.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs
index 17df09e9d..525055d72 100644
--- a/src/Text/Pandoc/App/OutputSettings.hs
+++ b/src/Text/Pandoc/App/OutputSettings.hs
@@ -35,6 +35,7 @@ import System.Directory (getCurrentDirectory)
import System.Exit (exitSuccess)
import System.FilePath
import System.IO (stdout)
+import Text.Pandoc.Chunks (PathTemplate(..))
import Text.Pandoc
import Text.Pandoc.App.FormatHeuristics (formatFromFilePaths)
import Text.Pandoc.App.Opt (Opt (..))
@@ -249,6 +250,9 @@ optToOutputSettings scriptingEngine opts = do
, writerEpubFonts = optEpubFonts opts
, writerEpubTitlePage = optEpubTitlePage opts
, writerSplitLevel = optSplitLevel opts
+ , writerChunkTemplate = maybe (PathTemplate "%s-%i.html")
+ PathTemplate
+ (optChunkTemplate opts)
, writerTOCDepth = optTOCDepth opts
, writerReferenceDoc = optReferenceDoc opts
, writerSyntaxMap = syntaxMap