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.HeaderFn

Contents

Description

License header functions are basically functions that allows to post-process already rendered license headers. This is useful to perform some additional operations such as some sort of text alignment, update some parts of the header, etc.

Synopsis

Documentation

runHeaderFn Source #

Arguments

:: HeaderFn env

license header function to run

-> env

environment value

-> Text

text of rendered license header

-> Text

processed text of license header

Runs the license header function using the given environment and text of rendered license header as input.

configuredHeaderFn Source #

Arguments

:: (Has CurrentYear env, Has UpdateCopyrightMode env) 
=> CtHeaderFnConfigs

configuration of license header functions

-> HeaderFn env

composed license header function

Composition of various license header functions, which environment is based on YAML configuration and which can be enabled/disabled to fit end user's needs.

postProcessHeader Source #

Arguments

:: ConfiguredEnv

configuration used to define post-processing behaviour

-> Text

rendered text of license header

-> Text

post-processed text of license header

Takes already rendered license header and post-process it based on the given configuration.

Environment Data Types

mkConfiguredEnv Source #

Arguments

:: MonadThrow m 
=> CurrentYear

current year

-> Variables

template variables

-> CtHeaderFnConfigs

configuration of license header functions

-> m ConfiguredEnv

environment data type

Constructor function for ConfiguredEnv data type. This function takes Variables as argument, because it performs template compilation on selected fields of CtHeaderFnConfigs.