| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.Mustache.Compile
- automaticCompile :: [FilePath] -> FilePath -> IO (Either ParseError Template)
- localAutomaticCompile :: FilePath -> IO (Either ParseError Template)
- type TemplateCache = HashMap String Template
- compileTemplateWithCache :: [FilePath] -> TemplateCache -> FilePath -> IO (Either ParseError Template)
- parseTemplate :: String -> Text -> Either ParseError Template
- cacheFromList :: [Template] -> TemplateCache
- getPartials :: AST -> [FilePath]
Documentation
automaticCompile :: [FilePath] -> FilePath -> IO (Either ParseError Template) Source
Compiles a mustache template provided by name including the mentioned partials.
The same can be done manually using getFile, mustacheParser and getPartials.
This function also ensures each partial is only compiled once even though it may be included by other partials including itself.
A reference to the included template will be found in each including templates
partials section.
type TemplateCache = HashMap String Template Source
compileTemplateWithCache :: [FilePath] -> TemplateCache -> FilePath -> IO (Either ParseError Template) Source
Compile a mustache template providing a list of precompiled templates that do not have to be recompiled.
parseTemplate :: String -> Text -> Either ParseError Template Source
cacheFromList :: [Template] -> TemplateCache Source
getPartials :: AST -> [FilePath] Source
Find the names of all included partials in a mustache AST.
Same as join . fmap getPartials'