headroom-0.4.3.0: License Header Manager
Copyright(c) 2019-2022 Vaclav Svejcar
LicenseBSD-3-Clause
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Headroom.PostProcess

Description

Post-processing 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

postProcess Source #

Arguments

:: PostProcess env

post-processor to run

-> env

environment value

-> Text

text of rendered license header

-> Text

processed text of license header

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

configuredPostProcess Source #

Arguments

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

configuration of post-processors

-> PostProcess env

composed post-processor

Composition of various post-processors, 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

:: forall a m. (Template a, MonadThrow m) 
=> CurrentYear

current year

-> Variables

template variables

-> CtPostProcessConfigs

configuration for post-processors

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