Copyright | Copyright (C) 2009-2019 John MacFarlane |
---|---|
License | GNU GPL, version 2 or above |
Maintainer | John MacFarlane <[email protected]> |
Stability | alpha |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Text.Pandoc.Templates
Description
Utility functions for working with pandoc templates.
Synopsis
- data Template a
- compileTemplate :: (TemplateMonad m, TemplateTarget a) => FilePath -> Text -> m (Either String (Template a))
- renderTemplate :: (TemplateTarget a, ToContext a b) => Template a -> b -> Doc a
- getDefaultTemplate :: PandocMonad m => Text -> m Text
Documentation
A template.
Instances
compileTemplate :: (TemplateMonad m, TemplateTarget a) => FilePath -> Text -> m (Either String (Template a)) #
Compile a template. The FilePath parameter is used to determine a default path and extension for partials and may be left empty if partials are not used.
renderTemplate :: (TemplateTarget a, ToContext a b) => Template a -> b -> Doc a #
Render a compiled template in a "context" which provides values for the template's variables.
Arguments
:: PandocMonad m | |
=> Text | Name of writer |
-> m Text |
Get default template for the specified writer.