Haskell implementation of Mustache templates
See homepage for examples of usage: http://github.com/lymar/hastache
- hastacheStr :: MonadIO m => MuConfig -> ByteString -> MuContext m -> m ByteString
- hastacheFile :: MonadIO m => MuConfig -> String -> MuContext m -> m ByteString
- type MuContext m = ByteString -> MuType m
- data MuType m
- = forall a . MuVar a => MuVariable a
- | MuList [MuContext m]
- | MuBool Bool
- | MuLambda (ByteString -> ByteString)
- | MuLambdaM (ByteString -> m ByteString)
- data MuConfig = MuConfig {}
- class Show a => MuVar a
- htmlEscape :: ByteString -> ByteString
- emptyEscape :: ByteString -> ByteString
- defaultConfig :: MuConfig
- encodeStr :: String -> ByteString
- encodeStrLBS :: String -> ByteString
- decodeStr :: ByteString -> String
- decodeStrLBS :: ByteString -> String
Documentation
:: MonadIO m | |
=> MuConfig | Configuration |
-> ByteString | Template |
-> MuContext m | Context |
-> m ByteString |
Render Hastache template from ByteString
:: MonadIO m | |
=> MuConfig | Configuration |
-> String | Template file name |
-> MuContext m | Context |
-> m ByteString |
Render Hastache template from file
forall a . MuVar a => MuVariable a | |
MuList [MuContext m] | |
MuBool Bool | |
MuLambda (ByteString -> ByteString) | |
MuLambdaM (ByteString -> m ByteString) |
MuConfig | |
|
htmlEscape :: ByteString -> ByteStringSource
Escape HTML symbols
emptyEscape :: ByteString -> ByteStringSource
No escape
defaultConfig :: MuConfigSource
Default config: HTML escape function, current directory as template directory, template file extension not specified
encodeStr :: String -> ByteStringSource
Convert String to UTF-8 Bytestring
encodeStrLBS :: String -> ByteStringSource
Convert String to UTF-8 Lazy Bytestring
decodeStr :: ByteString -> StringSource
Convert UTF-8 Bytestring to String
decodeStrLBS :: ByteString -> StringSource
Convert UTF-8 Lazy Bytestring to String