Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type ParamMap = HashMap Text Value
- mkParam :: ToJSON a => a -> Value
- data SmartyCtx
- newtype SmartyError = SmartyError {}
- prepareTemplate :: FilePath -> IO SmartyCtx
- prepareTemplates :: String -> FilePath -> IO SmartyCtx
- applyTemplate :: FilePath -> SmartyCtx -> ParamMap -> Either SmartyError Text
- applyTemplateFromJson :: ToJSON a => FilePath -> SmartyCtx -> a -> Either SmartyError Text
Documentation
newtype SmartyError Source #
Instances
Eq SmartyError Source # | |
Defined in Text.HSmarty.Render.Engine (==) :: SmartyError -> SmartyError -> Bool # (/=) :: SmartyError -> SmartyError -> Bool # | |
Show SmartyError Source # | |
Defined in Text.HSmarty.Render.Engine showsPrec :: Int -> SmartyError -> ShowS # show :: SmartyError -> String # showList :: [SmartyError] -> ShowS # |
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