headroom-0.3.1.0: License Header Manager

Copyright(c) 2019-2020 Vaclav Svejcar
LicenseBSD-3-Clause
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Headroom.Template

Description

Module providing generic representation of supported template type, using the Template type class.

Synopsis

Documentation

class Template t where Source #

Type class representing generic license header template support.

Methods

templateExtensions Source #

Arguments

:: NonEmpty Text

list of supported file extensions

Returns list of supported file extensions for this template type.

parseTemplate Source #

Arguments

:: MonadThrow m 
=> Maybe Text

name of the template (optional)

-> Text

raw template text

-> m t

parsed template

Parses template from given raw text.

renderTemplate Source #

Arguments

:: MonadThrow m 
=> Variables

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.

rawTemplate Source #

Arguments

:: t

template for which to return raw template text

-> Text

raw template text

Returns the raw text of the template, same that has been parsed by parseTemplate method.

data TemplateError Source #

Error during processing template.

Constructors

MissingVariables !Text ![Text]

missing variable values

ParseError !Text

error parsing raw template text