Copyright | (c) 2019-2020 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module provides support for extracting Haskell-specific info from the parsed source code files as template variables. Such info includes module name and selected fields from Haddock module header (see Headroom.FileSupport.Haskell.Haddock).
Synopsis
- extractModuleName :: Text -> Maybe Text
- extractVariables :: CtHeaderConfig -> Maybe TemplateMeta -> Maybe (Int, Int) -> Text -> Variables
- extractTemplateMeta :: Template t => t -> TemplateMeta
Variables Extraction
Extracts name of Haskell module from given source code file content.
>>>
extractModuleName "{-# LANGUAGE OverloadedStrings #-}\nmodule Foo where"
Just "Foo"
:: CtHeaderConfig | license header configuration |
-> Maybe TemplateMeta | extracted metadata from corresponding template |
-> Maybe (Int, Int) | license header position |
-> Text | input text |
-> Variables | extracted variables |
Extracts variables from Haskell source code.
List of Extracted Variables:
_haskell_module_copyright
-Copyright
field of Haddock module header_haskell_module_license
-License
field of Haddock module header_haskell_module_maintainer
-Maintainer
field of Haddock module header_haskell_module_portability
-Portability
field of Haddock module header_haskell_module_stability
-Stability
field of Haddock module header_haskell_module_name
- name of the Haskell module_haskell_module_longdesc
- long description of Haddock module_haskell_module_shortdesc
-Description
field of Haddock module header
Template Metadata Extraction
:: Template t | |
=> t | parsed template |
-> TemplateMeta | extracted template metadata |
Extracts template metadata specific for Haskell.