Copyright | (c) 2019-2020 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Module providing generic representation of supported template type, using
the Template
type class.
Synopsis
- class Template t where
- templateExtensions :: NonEmpty Text
- parseTemplate :: MonadThrow m => Maybe Text -> Text -> m t
- renderTemplate :: MonadThrow m => HashMap Text Text -> t -> m Text
Documentation
class Template t where Source #
Type class representing generic license header template support.
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 | values of variables to replace |
-> t | parsed template to render |
-> m Text | rendered template text |
Renders parsed template and replaces all variables with actual values.
Instances
Template Mustache Source # | Support for Mustache templates. |
Defined in Headroom.Template.Mustache templateExtensions :: NonEmpty Text Source # parseTemplate :: MonadThrow m => Maybe Text -> Text -> m Mustache Source # renderTemplate :: MonadThrow m => HashMap Text Text -> Mustache -> m Text Source # |