Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Template
- fromContext :: Context -> Value
- underCurrentDir :: Path Rel a -> Bool
- copyFileFromTemplate :: (Has (Throw MustacheError) sig m, Has (Throw IllformedPath) sig m, Has (Lift IO) sig m, ToMustache ctx) => ctx -> Path a Dir -> Path b Dir -> Path Rel File -> m ()
- copyDirFromTemplate :: (Has (Throw MustacheError) sig m, Has (Throw IllformedPath) sig m, Has (Lift IO) sig m, ToMustache ctx) => ctx -> Path a Dir -> Path b Dir -> Path Rel Dir -> m ()
- initFromTemplate :: (Has (Throw MustacheError) sig m, Has (Throw IllformedPath) sig m, Has (Lift IO) sig m, MonadIO m, ToMustache ctx) => [Pattern] -> ctx -> Path a Dir -> Path b Dir -> m ()
- readTemplate :: Has (Lift IO) sig m => Path Abs Dir -> m (Maybe Template)
- getTemplateDirs :: Has (Lift IO) sig m => m [Path Abs Dir]
- getTemplate :: (Has (Lift IO) sig m, Has (Throw IllformedPath) sig m) => Text -> m (Maybe Template)
- getTemplates :: Has (Lift IO) sig m => m [Template]
- prettyTemplate :: Bool -> Template -> Doc a
- prettyTemplates :: Bool -> [Template] -> Doc a
Documentation
Local | |
| |
Broken | |
Instances
Eq Template Source # | |
Show Template Source # | |
Generic Template Source # | |
type Rep Template Source # | |
Defined in Hinit.Template type Rep Template = D1 ('MetaData "Template" "Hinit.Template" "hinit-0.2.2-inplace" 'False) (C1 ('MetaCons "Local" 'PrefixI 'True) (S1 ('MetaSel ('Just "path") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Path Abs Dir)) :*: (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "templateConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TemplateConfig))) :+: C1 ('MetaCons "Broken" 'PrefixI 'True) (S1 ('MetaSel ('Just "path") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Path Abs Dir)) :*: (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "errors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TomlDecodeError])))) |
fromContext :: Context -> Value Source #
:: (Has (Throw MustacheError) sig m, Has (Throw IllformedPath) sig m, Has (Lift IO) sig m, ToMustache ctx) | |
=> ctx | Mustache context |
-> Path a Dir | Base dir of the template |
-> Path b Dir | Base dir of the target |
-> Path Rel File | Source file path relative to the template base |
-> m () |
Copy a file from template to the corresponding location in the target directory and apply substitution. Note that this function assumes that the parent directory of the target file exists.
:: (Has (Throw MustacheError) sig m, Has (Throw IllformedPath) sig m, Has (Lift IO) sig m, ToMustache ctx) | |
=> ctx | Mustache context |
-> Path a Dir | Base dir of the template |
-> Path b Dir | Base dir of the target |
-> Path Rel Dir | Source dir path relative to the template base |
-> m () |
Copy a directory from template to the corresponding location in the target directory and apply substitution. Note that this function assumes that the parent directory of the target directory exists.
:: (Has (Throw MustacheError) sig m, Has (Throw IllformedPath) sig m, Has (Lift IO) sig m, MonadIO m, ToMustache ctx) | |
=> [Pattern] | Ignored files |
-> ctx | Mustache context |
-> Path a Dir | Base dir of the template |
-> Path b Dir | Base dir of the target |
-> m () |
Initialize a project from a template