| 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.Ext.Haskell
Description
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"
Arguments
| :: 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-Copyrightfield of Haddock module header_haskell_module_license-Licensefield of Haddock module header_haskell_module_maintainer-Maintainerfield of Haddock module header_haskell_module_portability-Portabilityfield of Haddock module header_haskell_module_stability-Stabilityfield of Haddock module header_haskell_module_name- name of the Haskell module_haskell_module_longdesc- long description of Haddock module_haskell_module_shortdesc-Descriptionfield of Haddock module header
Template Metadata Extraction
Arguments
| :: Template t | |
| => t | parsed template |
| -> TemplateMeta | extracted template metadata |
Extracts template metadata specific for Haskell.