aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/App.hs')
-rw-r--r--src/Text/Pandoc/App.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index 93a2a9da6..3e8d767f8 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -124,9 +124,15 @@ parseOptions options' defaults = do
latexEngines :: [String]
latexEngines = ["pdflatex", "lualatex", "xelatex"]
+defaultLatexEngine :: String
+defaultLatexEngine = "pdflatex"
+
htmlEngines :: [String]
htmlEngines = ["wkhtmltopdf", "weasyprint", "prince"]
+defaultHtmlEngine :: String
+defaultHtmlEngine = "wkhtmltopdf"
+
pdfEngines :: [String]
pdfEngines = latexEngines ++ htmlEngines ++ ["context", "pdfroff"]
@@ -140,7 +146,7 @@ pdfWriterAndProg mWriter mEngine = do
(Left err, _) -> panErr err
(_, Left err) -> panErr err
where
- go Nothing Nothing = (Right "latex", Right $ head latexEngines)
+ go Nothing Nothing = (Right "latex", Right defaultLatexEngine)
go (Just writer) Nothing = (Right writer, engineForWriter writer)
go Nothing (Just engine) = (writerForEngine engine, Right engine)
go (Just writer) (Just engine) =
@@ -162,9 +168,9 @@ pdfWriterAndProg mWriter mEngine = do
engineForWriter "context" = Right "context"
engineForWriter "ms" = Right "pdfroff"
- engineForWriter "latex" = Right $ head latexEngines
+ engineForWriter "latex" = Right defaultLatexEngine
engineForWriter format
- | format `elem` ["html", "html5"] = Right $ head htmlEngines
+ | format `elem` ["html", "html5"] = Right defaultHtmlEngine
| otherwise = Left $ "cannot produce pdf output with output format " ++ format