From b19a4bea999c684e092e0ea0feaf02ff8747d2a5 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 4 Apr 2012 16:32:11 +0200 Subject: Add an optional label to URLs --- src/Haddock/Types.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Haddock/Types.hs') diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 048a7ff7..f8890ebf 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -303,7 +303,7 @@ data Doc id | DocOrderedList [Doc id] | DocDefList [(Doc id, Doc id)] | DocCodeBlock (Doc id) - | DocURL String + | DocHyperlink Hyperlink | DocPic String | DocAName String | DocExamples [Example] @@ -315,6 +315,12 @@ instance Monoid (Doc id) where mappend = DocAppend +data Hyperlink = Hyperlink + { hyperlinkUrl :: String + , hyperlinkLabel :: Maybe String + } + + data Example = Example { exampleExpression :: String , exampleResult :: [String] @@ -341,7 +347,7 @@ data DocMarkup id a = Markup , markupOrderedList :: [a] -> a , markupDefList :: [(a,a)] -> a , markupCodeBlock :: a -> a - , markupURL :: String -> a + , markupHyperlink :: Hyperlink -> a , markupAName :: String -> a , markupPic :: String -> a , markupExample :: [Example] -> a -- cgit v1.2.3