Copyright | © 2016 Stack Builders |
---|---|
License | BSD 3 clause |
Maintainer | Mark Karpov <markkarpov@openmailbox.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Template Haskell helpers to compile Mustache templates at compile time. This module is not imported as part of Text.Mustache, so you need to import it yourself. Qualified import is recommended, but not necessary.
At the moment, functions in this module only work with GHC 8 (they
require at least template-haskell-2.11
).
- compileMustacheDir :: PName -> FilePath -> Q Exp
- compileMustacheFile :: FilePath -> Q Exp
- compileMustacheText :: PName -> Text -> Q Exp
Documentation
:: PName | Which template to select after compiling |
-> FilePath | Directory with templates |
-> Q Exp | The resulting template |
Compile all templates in specified directory and select one. Template
files should have extension mustache
, (e.g. foo.mustache
) to be
recognized. This function does not scan the directory recursively.
This version compiles the templates at compile time.
Compile single Mustache template and select it.
This version compiles the template at compile time.