HSmarty-0.4.2: Small template engine
Safe HaskellNone
LanguageHaskell2010

Text.HSmarty

Synopsis

Documentation

type ParamMap = HashMap Text Value Source #

Maps template variables to template params

mkParam :: ToJSON a => a -> Value Source #

data SmartyCtx Source #

Instances

Instances details
Eq SmartyCtx Source # 
Instance details

Defined in Text.HSmarty.Render.Engine

Show SmartyCtx Source # 
Instance details

Defined in Text.HSmarty.Render.Engine

newtype SmartyError Source #

Constructors

SmartyError 

Fields

Instances

Instances details
Eq SmartyError Source # 
Instance details

Defined in Text.HSmarty.Render.Engine

Show SmartyError Source # 
Instance details

Defined in Text.HSmarty.Render.Engine

prepareTemplate :: FilePath -> IO SmartyCtx Source #

Parse and compile a template

prepareTemplates :: String -> FilePath -> IO SmartyCtx Source #

Parse and compiles templates matching a glob in a directiry

applyTemplate :: FilePath -> SmartyCtx -> ParamMap -> Either SmartyError Text Source #

Fill a template with values and print it as Text

applyTemplateFromJson :: ToJSON a => FilePath -> SmartyCtx -> a -> Either SmartyError Text Source #

Fill a template with values and print it as Text