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 provides extended support for selected file types, which mean not only basic management of license headers based on template files is provided, but also some additional functionality is available. For example, some extra data may be extracted from the processed source code file and made available to template via template variables (e.g. module name for Haskell source code files).
Synopsis
- extractVariables :: FileType -> CtHeaderConfig -> Maybe TemplateMeta -> Maybe (Int, Int) -> Text -> Variables
- extractTemplateMeta :: Template t => FileType -> t -> Maybe TemplateMeta
Documentation
:: FileType | type of the file |
-> CtHeaderConfig | license header configuration |
-> Maybe TemplateMeta | extracted metadata from corresponding template |
-> Maybe (Int, Int) | license header position |
-> Text | text of the source code file |
-> Variables | extracted variables |
Extracts variables specific to the file type (if supported), e.g. module name for Haskell source code. Currently supported file types are:
- Haskell - implemented in Headroom.Ext.Haskell
- Java - implemented in Headroom.Ext.Java
- PureScript - implemented in Headroom.Ext.PureScript
:: Template t | |
=> FileType | file type for which this template will be used |
-> t | parsed template |
-> Maybe TemplateMeta | extracted template metadata |
Extracts medatata from given template for selected file type, which
might be later required by the extractVariables
function.