headroom-0.3.1.0: License Header Manager

Copyright(c) 2019-2020 Vaclav Svejcar
LicenseBSD-3-Clause
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Headroom.Ext.Haskell

Contents

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

Variables Extraction

extractModuleName Source #

Arguments

:: Text

input text

-> Maybe Text

extracted module name

Extracts name of Haskell module from given source code file content.

>>> extractModuleName "{-# LANGUAGE OverloadedStrings #-}\nmodule Foo where"
Just "Foo"

extractVariables Source #

Arguments

:: CtHeaderConfig

license header configuration

-> Maybe TemplateMeta

extracted metadata from corresponding template

-> Maybe (Int, Int)

license header position (startLine, endLine)

-> 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

extractTemplateMeta Source #

Arguments

:: Template t 
=> t

parsed template

-> TemplateMeta

extracted template metadata

Extracts template metadata specific for Haskell.