diff options
author | simonmar <unknown> | 2002-07-25 14:37:29 +0000 |
---|---|---|
committer | simonmar <unknown> | 2002-07-25 14:37:29 +0000 |
commit | d6edc43ef6c96e1c2c0c0564cfe502f17d0a53ed (patch) | |
tree | c0ea7ef6e0512a365c4b1c7bea3a967ced615879 /src/HsSyn.lhs | |
parent | 4d8d5e948cd6620ed923bf7b11ce408a728e3521 (diff) |
[haddock @ 2002-07-25 14:37:28 by simonmar]
Patch to allow simple hyperlinking to an arbitrary location in another
module's documentation, from Volker Stolz.
Now in a doc comment:
#foo#
creates
<a name="foo"></a>
And you can use the form "M\#foo" to hyperlink to the label 'foo' in
module 'M'. Note that the backslash is necessary for now.
Diffstat (limited to 'src/HsSyn.lhs')
-rw-r--r-- | src/HsSyn.lhs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/HsSyn.lhs b/src/HsSyn.lhs index 77a621df..cde2ce63 100644 --- a/src/HsSyn.lhs +++ b/src/HsSyn.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: HsSyn.lhs,v 1.13 2002/07/24 09:42:18 simonmar Exp $ +% $Id: HsSyn.lhs,v 1.14 2002/07/25 14:37:29 simonmar Exp $ % % (c) The GHC Team, 1997-2002 % @@ -392,6 +392,7 @@ data GenDoc id | DocOrderedList [GenDoc id] | DocCodeBlock (GenDoc id) | DocURL String + | DocAName String deriving (Eq, Show) type Doc = GenDoc [HsQName] @@ -412,7 +413,8 @@ data DocMarkup id a = Markup { markupUnorderedList :: [a] -> a, markupOrderedList :: [a] -> a, markupCodeBlock :: a -> a, - markupURL :: String -> a + markupURL :: String -> a, + markupAName :: String -> a } markup :: DocMarkup id a -> GenDoc id -> a @@ -428,6 +430,7 @@ 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 +markup m (DocAName ref) = markupAName m ref -- | Since marking up is just a matter of mapping 'Doc' into some -- other type, we can \'rename\' documentation by marking up 'Doc' into @@ -445,7 +448,8 @@ mapIdent f = Markup { markupUnorderedList = DocUnorderedList, markupOrderedList = DocOrderedList, markupCodeBlock = DocCodeBlock, - markupURL = DocURL + markupURL = DocURL, + markupAName = DocAName } -- ----------------------------------------------------------------------------- |