Copyright | (c) 2019-2020 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
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
:: 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.
:: (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.
:: 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
).
ConfiguredEnv | |
|
Instances
Eq ConfiguredEnv Source # | |
Defined in Headroom.HeaderFn (==) :: ConfiguredEnv -> ConfiguredEnv -> Bool # (/=) :: ConfiguredEnv -> ConfiguredEnv -> Bool # | |
Show ConfiguredEnv Source # | |
Defined in Headroom.HeaderFn showsPrec :: Int -> ConfiguredEnv -> ShowS # show :: ConfiguredEnv -> String # showList :: [ConfiguredEnv] -> ShowS # | |
Has CurrentYear ConfiguredEnv Source # | |
Defined in Headroom.HeaderFn getter :: ConfiguredEnv -> CurrentYear Source # modifier :: (CurrentYear -> CurrentYear) -> ConfiguredEnv -> ConfiguredEnv Source # hasLens :: Lens' ConfiguredEnv CurrentYear Source # viewL :: MonadReader ConfiguredEnv m => m CurrentYear Source # | |
Has UpdateCopyrightMode ConfiguredEnv Source # | |
Defined in Headroom.HeaderFn |
:: 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
.