From 3675464e88e2aa252b6dc7cdfcd1082c1f9143f8 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 9 Apr 2002 11:33:55 +0000 Subject: [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. --- src/HaddockTypes.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/HaddockTypes.hs') diff --git a/src/HaddockTypes.hs b/src/HaddockTypes.hs index bd519319..e13fcb1a 100644 --- a/src/HaddockTypes.hs +++ b/src/HaddockTypes.hs @@ -158,6 +158,7 @@ data GenDoc id | DocUnorderedList [GenDoc id] | DocOrderedList [GenDoc id] | DocCodeBlock (GenDoc id) + | DocURL String type Doc = GenDoc HsQName type ParsedDoc = GenDoc String @@ -177,7 +178,8 @@ data DocMarkup id a = Markup { markupMonospaced :: a -> a, markupUnorderedList :: [a] -> a, markupOrderedList :: [a] -> a, - markupCodeBlock :: a -> a + markupCodeBlock :: a -> a, + markupURL :: String -> a } markup :: DocMarkup id a -> GenDoc id -> a @@ -192,6 +194,7 @@ markup m (DocMonospaced d) = markupMonospaced m (markup m d) markup m (DocUnorderedList ds) = markupUnorderedList m (map (markup m) ds) markup m (DocOrderedList ds) = markupOrderedList m (map (markup m) ds) markup m (DocCodeBlock d) = markupCodeBlock m (markup m d) +markup m (DocURL url) = markupURL m url -- | Since marking up is just a matter of mapping 'Doc' into some -- other type, we can \'rename\' documentation by marking up 'Doc' into @@ -207,7 +210,8 @@ mapIdent f = Markup { markupMonospaced = DocMonospaced, markupUnorderedList = DocUnorderedList, markupOrderedList = DocOrderedList, - markupCodeBlock = DocCodeBlock + markupCodeBlock = DocCodeBlock, + markupURL = DocURL } -- ----------------------------------------------------------------------------- -- cgit v1.2.3