StrappedTemplates-0.2.0.2: General purpose templates in haskell

Safe HaskellNone
LanguageHaskell98

Text.Strapped

Contents

Synopsis

Rendering

defaultConfig :: StrappedConfig Source

Default render configuration. No text escaping.

Controlling variables

combineBuckets :: InputBucket m -> InputBucket m -> InputBucket m Source

If the first bucket fails, try the second.

varBucket :: String -> Input m -> InputBucket m Source

Basic bucket. Matches on string and return input. Returns Nothing for everything else.

lit :: ToLiteral a => a -> Input m Source

dyn :: (Renderable a, Typeable a) => a -> Input m Source

Parsing

parseTemplate :: StrappedConfig -> String -> String -> Either ParseError Template Source

Take config, a template body and a template name and return either an error or a renderable template.

TemplateLoading

templateStoreFromDirectory :: StrappedConfig -> FilePath -> String -> IO (Either ParseError TemplateStore) Source

Given a file path and extension, load all templates in a directory, recursively.