Copyright | (c) 2019-2022 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
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
- postProcess :: PostProcess env -> env -> Text -> Text
- configuredPostProcess :: (Has CurrentYear env, Has UpdateCopyrightMode env) => CtPostProcessConfigs -> PostProcess env
- postProcessHeader :: ConfiguredEnv -> Text -> Text
- data ConfiguredEnv = ConfiguredEnv {}
- mkConfiguredEnv :: forall a m. (Template a, MonadThrow m) => CurrentYear -> Variables -> CtPostProcessConfigs -> m ConfiguredEnv
Documentation
:: 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 #
:: (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.
:: 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 post-processor
(configuredPostProcess
).
ConfiguredEnv | |
|
Instances
Eq ConfiguredEnv Source # | |
Defined in Headroom.PostProcess (==) :: ConfiguredEnv -> ConfiguredEnv -> Bool # (/=) :: ConfiguredEnv -> ConfiguredEnv -> Bool # | |
Show ConfiguredEnv Source # | |
Defined in Headroom.PostProcess showsPrec :: Int -> ConfiguredEnv -> ShowS # show :: ConfiguredEnv -> String # showList :: [ConfiguredEnv] -> ShowS # | |
Has CurrentYear ConfiguredEnv Source # | |
Defined in Headroom.PostProcess 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.PostProcess |
:: 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
.