[Add links to things
Neil Mitchell**20080805124648] {
hunk ./src/Web/Action.hs 89
- [tr $ td "mod" modname ++ td "" (showTagHTML text)
+ [tr $ td "mod" modname ++ td "" (href urlItem $ showTagHTMLWith url text)
hunk ./src/Web/Action.hs 95
- modname = maybe "" showModule modu
- pkgname = maybe "" packageName pkg
+ modname = maybe "" (href urlModule . showModule) modu
+ pkgname = maybe "" (href urlPkg . packageName) pkg
hunk ./src/Web/Action.hs 99
- tr x = "
" ++ x ++ "
"
- td c x = "" ++ x ++ " | "
+ urlPkg = "http://hackage.haskell.org/packages/archive/" +++ maybe "" packageName pkg +++ "/latest/doc/html/"
+ urlModule = urlPkg +++ concat (intersperse "-" $ fromMaybe [] modu) +++ ".html"
+ urlItem = urlModule +++ "#v:" +++ escapeHTML (entryName $ fromLink $ resultEntry r)
hunk ./src/Web/Action.hs 103
+ url (TagHyperlink _ x) = Just $ "" ++ showTagHTML x ++
+ ""
+ url _ = Nothing
+
+ a +++ b = if null a || null b then [] else a ++ b
+
+tr x = "" ++ x ++ "
"
+td c x = "" ++ x ++ " | "
+href url x = if null url then x else "" ++ x ++ ""
hunk ./src/Web/Action.hs 125
-showTagHTML (Str x) = escapeHTML x
-showTagHTML (Tags xs) = concatMap showTagHTML xs
-showTagHTML (TagBold x) = "" ++ showTagHTML x ++ ""
-showTagHTML (TagUnderline x) = "" ++ showTagHTML x ++ ""
-showTagHTML (TagHyperlink url x) = "" ++ showTagHTML x ++ ""
-showTagHTML (TagColor i x) = "" ++ showTagHTML x ++ ""
+showTagHTML = showTagHTMLWith (const Nothing)
+
+
+showTagHTMLWith :: (TagStr -> Maybe String) -> TagStr -> String
+showTagHTMLWith f x = g x
+ where
+ g x | isJust (f x) = fromJust $ f x
+ g (Str x) = escapeHTML x
+ g (Tags xs) = concatMap g xs
+ g (TagBold x) = "" ++ showTagHTML x ++ ""
+ g (TagUnderline x) = "" ++ showTagHTML x ++ ""
+ g (TagHyperlink url x) = "" ++ showTagHTML x ++ ""
+ g (TagColor i x) = "" ++ showTagHTML x ++ ""
hunk ./src/res/hoogle.css 15
+ border: 0px;
hunk ./src/res/hoogle.css 105
+a.dull:hover, a.dull, a.dull:visited {
+ color: inherit;
+ text-decoration: none;
+ background-color: inherit;
+}
+
+
}