| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
B9.Content.StringTemplate
Description
Utility functions bnased on Template to offer $var variable
expansion in string throughout a B9 artifact.
- subst :: [(String, String)] -> String -> String
- substE :: [(String, String)] -> String -> Either String String
- substEB :: [(String, String)] -> ByteString -> Either String ByteString
- substFile :: MonadIO m => [(String, String)] -> FilePath -> FilePath -> m ()
- substPath :: [(String, String)] -> SystemPath -> SystemPath
- readTemplateFile :: (MonadIO m, MonadReader Environment m) => SourceFile -> m ByteString
- data SourceFile = Source SourceFileConversion FilePath
- data SourceFileConversion
- data Environment = Environment [(String, String)]
- withEnvironment :: [(String, String)] -> ReaderT Environment m a -> m a
Documentation
substEB :: [(String, String)] -> ByteString -> Either String ByteString Source
substPath :: [(String, String)] -> SystemPath -> SystemPath Source
readTemplateFile :: (MonadIO m, MonadReader Environment m) => SourceFile -> m ByteString Source
data SourceFile Source
A wrapper around a file path and a flag indicating if template variable expansion should be performed when reading the file contents.
Constructors
| Source SourceFileConversion FilePath |
data SourceFileConversion Source
Constructors
| NoConversion | |
| ExpandVariables |
data Environment Source
Constructors
| Environment [(String, String)] |
withEnvironment :: [(String, String)] -> ReaderT Environment m a -> m a Source