From af7f8c0379dc19ee831e25b64c9e94e733f331be Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 9 Aug 2004 11:55:07 +0000 Subject: [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell , with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. --- src/Binary.hs | 8 +- src/HaddockHH.hs | 4 +- src/HaddockHtml.hs | 47 ++++++---- src/HaddockModuleTree.hs | 31 ++++--- src/HaddockTypes.hs | 2 +- src/HaddockUtil.hs | 232 ++++++++++++++++++++++++++++++++++++++--------- src/HsParser.ly | 24 +++-- src/HsSyn.lhs | 24 +++-- src/Main.hs | 143 +++++++++++++++++++++-------- 9 files changed, 384 insertions(+), 131 deletions(-) diff --git a/src/Binary.hs b/src/Binary.hs index 092d29f2..eb7b9929 100644 --- a/src/Binary.hs +++ b/src/Binary.hs @@ -51,11 +51,11 @@ module Binary -- putBinFileWithDict, -- :: Binary a => FilePath -> Module -> a -> IO () -- re-export for the benefit of other modules. - openBinaryFile + openBinaryFile, - FormatVersion, - nullFormatVersion, - mkFormatVersion, + FormatVersion, + nullFormatVersion, + mkFormatVersion, ) where #include "MachDeps.h" diff --git a/src/HaddockHH.hs b/src/HaddockHH.hs index e0e9a97a..8ad4dfe2 100644 --- a/src/HaddockHH.hs +++ b/src/HaddockHH.hs @@ -57,9 +57,9 @@ ppHHContents odir doctitle maybe_package tree = do fn _ [] = error "HaddockHH.ppHHContents.fn: no module trees given" ppNode :: [String] -> ModuleTree -> Doc - ppNode ss (Node s leaf _pkg []) = + ppNode ss (Node s leaf _pkg _ []) = ppLeaf s ss leaf - ppNode ss (Node s leaf _pkg ts) = + ppNode ss (Node s leaf _pkg _ ts) = ppLeaf s ss leaf $$ text "