pandoc-1.19.2.4: Conversion between markup formats

Copyright | Copyright (C) 2009-2016 John MacFarlane
License | GNU GPL, version 2 or above
Maintainer | John MacFarlane <jgm@berkeley.edu>
Stability | alpha
Portability | portable
Safe Haskell | None
Language | Haskell98

Text.Pandoc.Templates

Description

A simple templating system with variable substitution and conditionals.

Synopsis

- renderTemplate :: (ToJSON a, TemplateTarget b) => Template -> a -> b
- renderTemplate' :: (ToJSON a, TemplateTarget b) => String -> a -> b
- class TemplateTarget a
- varListToJSON :: [(String, String)] -> Value
- compileTemplate :: Text -> Either String Template
- data Template :: *
- getDefaultTemplate :: Maybe FilePath -> String -> IO (Either IOException String)

# Documentation

renderTemplate :: (ToJSON a, TemplateTarget b) => Template -> a -> b #

renderTemplate' :: (ToJSON a, TemplateTarget b) => String -> a -> b Source #

Like `applyTemplate`, but raising an error if compilation fails.

class TemplateTarget a #

Minimal complete definition

toTarget

Instances

TemplateTarget ByteString |
Methods toTarget :: Text -> ByteString
TemplateTarget String |
Methods toTarget :: Text -> String
TemplateTarget Text |
Methods toTarget :: Text -> Text
TemplateTarget Html |
Methods toTarget :: Text -> Html

varListToJSON :: [(String, String)] -> Value #

compileTemplate :: Text -> Either String Template #

data Template :: * #

Instances

Monoid Template |
Methods mempty :: Template # mappend :: Template -> Template -> Template # mconcat :: [Template] -> Template #

getDefaultTemplate Source #

Arguments

:: Maybe FilePath | User data directory to search first
-> String | Name of writer
-> IO (Either IOException String) |

Get default template for the specified writer.