Copyright | (c) 2019-2020 Vaclav Svejcar |
---|---|
License | BSD-3 |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Provides generic support for the license header templates, represented by the
Template
type class. Various implementations can be plugged in by creating
custom instance of this type class.
Synopsis
- class Template t where
- templateExtensions :: proxy t -> [Text]
- parseTemplate :: MonadThrow m => Maybe Text -> Text -> m t
- renderTemplate :: MonadThrow m => HashMap Text Text -> t -> m Text
- loadTemplate :: (MonadIO m, Template t) => FilePath -> m t
Documentation
class Template t where Source #
Type class representing generic license header template support.
:: proxy t | phantom parameter, not used |
-> [Text] | list of supported file extensions |
Returns list of supported file extensions for this template type.
:: MonadThrow m | |
=> Maybe Text | name of the template (optional) |
-> Text | raw template text |
-> m t | parsed template |
Parses template from given raw text.
:: MonadThrow m | |
=> HashMap Text Text | variables to replace |
-> t | parsed template to render |
-> m Text | rendered template text |
Renders parsed template and replaces all variables.
Instances
Template Mustache Source # | Support for Mustache templates. |
Defined in Headroom.Template.Mustache |