Safe Haskell | None |
---|---|
Language | Haskell98 |
- render :: MonadIO m => RenderConfig -> InputBucket m -> String -> m (Either StrapError Output)
- defaultConfig :: RenderConfig
- showToBuilder :: Show a => a -> Builder
- combineBuckets :: InputBucket m -> InputBucket m -> InputBucket m
- varBucket :: String -> Input m -> InputBucket m
- bucketLookup :: String -> InputBucket m -> Maybe (Input m)
- bucketFromList :: [(String, Input m)] -> InputBucket m
- emptyBucket :: InputBucket m
- parseTemplate :: String -> String -> Either ParseError Template
- templateStoreFromList :: [(String, String)] -> Either ParseError TemplateStore
- templateStoreFromDirectory :: FilePath -> String -> IO (Either ParseError TemplateStore)
- putStore :: TemplateStore -> RenderConfig -> RenderConfig
- module Text.Strapped.Types
Rendering
render :: MonadIO m => RenderConfig -> InputBucket m -> String -> m (Either StrapError Output) Source
Using a TemplateStore
and an InputBucket
render the template name.
defaultConfig :: RenderConfig Source
Default render configuration. No text escaping.
showToBuilder :: Show a => a -> Builder Source
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.
bucketLookup :: String -> InputBucket m -> Maybe (Input m) Source
bucketFromList :: [(String, Input m)] -> InputBucket m Source
emptyBucket :: InputBucket m Source
Parsing
parseTemplate :: String -> String -> Either ParseError Template Source
Take a template body and a template name and return either an error or a renderable template.
TemplateLoading
templateStoreFromList :: [(String, String)] -> Either ParseError TemplateStore Source
templateStoreFromDirectory :: FilePath -> String -> IO (Either ParseError TemplateStore) Source
Given a file path and extension, load all templates in a directory, recursively.
putStore :: TemplateStore -> RenderConfig -> RenderConfig Source
module Text.Strapped.Types