diff options
author | Mathieu Boespflug <mathieu.boespflug@parsci.com> | 2013-05-20 11:56:28 +0200 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2013-08-04 10:39:43 -0700 |
commit | c33a0b2ef062ac19692a4b836d28d16b49aab995 (patch) | |
tree | ed1745e4dd3510a708df8b5a25d7662275fcfc0c /src/Haddock/Interface | |
parent | 34d2aa54b95e8d261dc325393893d06f6a085130 (diff) |
Output Copright and License keys in Xhtml backend.
This information is as relevant in the documentation as it is in the
source files themselves.
Signed-off-by: David Waern <david.waern@gmail.com>
Diffstat (limited to 'src/Haddock/Interface')
-rw-r--r-- | src/Haddock/Interface/ParseModuleHeader.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Haddock/Interface/ParseModuleHeader.hs b/src/Haddock/Interface/ParseModuleHeader.hs index 18f4c768..5087affe 100644 --- a/src/Haddock/Interface/ParseModuleHeader.hs +++ b/src/Haddock/Interface/ParseModuleHeader.hs @@ -19,6 +19,7 @@ import RdrName import DynFlags import Data.Char +import Control.Monad (mplus) -- ----------------------------------------------------------------------------- -- Parsing module headers @@ -36,9 +37,9 @@ parseModuleHeader dflags str0 = (_moduleOpt,str1) = getKey "Module" str0 (descriptionOpt,str2) = getKey "Description" str1 - (_copyrightOpt,str3) = getKey "Copyright" str2 - (_licenseOpt,str4) = getKey "License" str3 - (_licenceOpt,str5) = getKey "Licence" str4 + (copyrightOpt,str3) = getKey "Copyright" str2 + (licenseOpt,str4) = getKey "License" str3 + (licenceOpt,str5) = getKey "Licence" str4 (maintainerOpt,str6) = getKey "Maintainer" str5 (stabilityOpt,str7) = getKey "Stability" str6 (portabilityOpt,str8) = getKey "Portability" str7 @@ -58,9 +59,11 @@ parseModuleHeader dflags str0 = Nothing -> Left "Cannot parse header documentation paragraphs" Just doc -> Right (HaddockModInfo { hmi_description = docOpt, - hmi_portability = portabilityOpt, - hmi_stability = stabilityOpt, + hmi_copyright = copyrightOpt, + hmi_license = licenseOpt `mplus` licenceOpt, hmi_maintainer = maintainerOpt, + hmi_stability = stabilityOpt, + hmi_portability = portabilityOpt, hmi_safety = Nothing }, doc) |