| Safe Haskell | None |
|---|
Template
Description
Templates represent the file to be written while holding information from the source template.
Synopsis
- data Template = Template {
- name :: String
- suffix :: String
- content :: String
- extension :: String
- sourcePath :: String
- newtype TemplateError = NoMatchFound String
- toTemplate :: Maybe Char -> String -> (String, String) -> Template
- mkSuffix :: Char -> String -> String
- ext :: Char -> String -> String
- mkTemplate :: String -> String -> String -> String -> String -> Template
- getTemplateFiles :: AbsDir -> GenConfig -> GenCommand -> IO (Either TemplateError [Template])
Documentation
A Template represents the file that is going to be written. It
contains the content from the source template as well as the
source path which is the filename of the source template
Constructors
| Template | |
Fields
| |
newtype TemplateError #
Encompasses all possible errors in the Template module
Constructors
| NoMatchFound String |
Instances
| Show TemplateError # | |
Defined in Template Methods showsPrec :: Int -> TemplateError -> ShowS show :: TemplateError -> String showList :: [TemplateError] -> ShowS | |
toTemplate :: Maybe Char -> String -> (String, String) -> Template #
mkSuffix :: Char -> String -> String #
Use the filename separator to find and return the suffix for the template.
If there is no suffix the function returns an empty string.
mkTemplate :: String -> String -> String -> String -> String -> Template #
Template factory
getTemplateFiles :: AbsDir -> GenConfig -> GenCommand -> IO (Either TemplateError [Template]) #
Iterates through all files in SKAT template's source directory.
For each file in the directory it will match all files that start
with the what passed in the command.