stache-0.1.4: Mustache templates for Haskell

Copyright© 2016 Stack Builders
LicenseBSD 3 clause
MaintainerMark Karpov <markkarpov@openmailbox.org>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Text.Mustache.Compile

Description

Mustache Template creation from file or a Text value. You don't usually need to import the module, because Text.Mustache re-exports everything you may need, import that module instead.

Synopsis

Documentation

compileMustacheDir Source #

Arguments

:: (MonadIO m, MonadThrow m) 
=> PName

Which template to select after compiling

-> FilePath

Directory with templates

-> m Template

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.

The action can throw the same exceptions as getDirectoryContents, and readFile.

compileMustacheFile Source #

Arguments

:: (MonadIO m, MonadThrow m) 
=> FilePath

Location of the file

-> m Template 

Compile single Mustache template and select it.

The action can throw the same exceptions as readFile.

compileMustacheText Source #

Arguments

:: PName

How to name the template?

-> Text

The template to compile

-> Either (ParseError Char Dec) Template

The result

Compile Mustache template from a lazy Text value. The cache will contain only this template named according to given PName.