aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/ICML.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-07-26 12:00:44 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-07-28 19:25:45 -0700
commitb35fae651145482f1218d32dbea5fffff60e0b0b (patch)
tree02175f056c40aee4329b8f944ada9c9cd6ac1284 /src/Text/Pandoc/Writers/ICML.hs
parent99e24cf18337b0b460005bf77e367783c34b75e7 (diff)
downloadpandoc-b35fae651145482f1218d32dbea5fffff60e0b0b.tar.gz
Use doctemplates 0.3, change type of writerTemplate.
* Require recent doctemplates. It is more flexible and supports partials. * Changed type of writerTemplate to Maybe Template instead of Maybe String. * Remove code from the LaTeX, Docbook, and JATS writers that looked in the template for strings to determine whether it is a book or an article, or whether csquotes is used. This was always kludgy and unreliable. To use csquotes for LaTeX, set `csquotes` in your variables or metadata. It is no longer sufficient to put `\usepackage{csquotes}` in your template or header includes. To specify a book style, use the `documentclass` variable or `--top-level-division`. * Change template code to use new API for doctemplates.
Diffstat (limited to 'src/Text/Pandoc/Writers/ICML.hs')
-rw-r--r--src/Text/Pandoc/Writers/ICML.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs
index a919fb199..89f4146ca 100644
--- a/src/Text/Pandoc/Writers/ICML.hs
+++ b/src/Text/Pandoc/Writers/ICML.hs
@@ -33,7 +33,7 @@ import Text.Pandoc.Logging
import Text.Pandoc.Options
import Text.Pandoc.Pretty
import Text.Pandoc.Shared (isURI, linesToPara, splitBy)
-import Text.Pandoc.Templates (renderTemplate')
+import Text.Pandoc.Templates (renderTemplate)
import Text.Pandoc.Writers.Math (texMathToInlines)
import Text.Pandoc.Writers.Shared
import Text.Pandoc.XML
@@ -149,10 +149,11 @@ writeICML opts (Pandoc meta blocks) = do
$ defField "charStyles" (render' $ charStylesToDoc st)
$ defField "parStyles" (render' $ parStylesToDoc st)
$ defField "hyperlinks" (render' $ hyperlinksToDoc $ links st) metadata
- (if writerPreferAscii opts then toEntities else id) <$>
+ return $
+ (if writerPreferAscii opts then toEntities else id) $
case writerTemplate opts of
- Nothing -> return main
- Just tpl -> renderTemplate' tpl context
+ Nothing -> main
+ Just tpl -> renderTemplate tpl context
-- | Auxiliary functions for parStylesToDoc and charStylesToDoc.
contains :: String -> (String, (String, String)) -> [(String, String)]