| Copyright | (c) 2019-2020 Vaclav Svejcar |
|---|---|
| License | BSD-3-Clause |
| Maintainer | vaclav.svejcar@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
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
- runHeaderFn :: HeaderFn env -> env -> Text -> Text
- configuredHeaderFn :: (Has CurrentYear env, Has UpdateCopyrightMode env) => CtHeaderFnConfigs -> HeaderFn env
- postProcessHeader :: ConfiguredEnv -> Text -> Text
- data ConfiguredEnv = ConfiguredEnv {}
- mkConfiguredEnv :: MonadThrow m => CurrentYear -> Variables -> CtHeaderFnConfigs -> m ConfiguredEnv
Documentation
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.
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.
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
data ConfiguredEnv Source #
Environemnt data type for the composed license header function
(configuredHeaderFn).
Constructors
| ConfiguredEnv | |
Fields
| |
Instances
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.