Commit a3222f61 authored by Andrew Gibiansky's avatar Andrew Gibiansky

adding hoogle support for classes, closes #158

parent 22b9e06d
......@@ -48,7 +48,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
":info IHaskellDisplay"
":hoogle printf"
],
"language": "python",
"metadata": {},
......@@ -58,7 +58,7 @@
"output_type": "display_data"
}
],
"prompt_number": 6
"prompt_number": 1
},
{
"cell_type": "code",
......
......@@ -34,6 +34,9 @@ Custom IHaskell CSS.
.hoogle-module {
font-weight: bold;
}
.hoogle-class {
font-weight: bold;
}
/* Styles used for basic displays */
.get-type {
......
......@@ -150,6 +150,12 @@ renderSelf string loc
span "hoogle-module" (link loc $ extractModule string) ++
packageSub package
| startswith "class" string
= let package = extractPackageName loc in
cls ++ " " ++
span "hoogle-class" (link loc $ extractClass string) ++
packageSub package
| otherwise
= let [name, args] = split "::" string
package = extractPackageName loc
......@@ -163,8 +169,10 @@ renderSelf string loc
where
extractPackage = strip . replace "package" ""
extractModule = strip . replace "module" ""
extractClass = strip . replace "class" ""
pkg = span "hoogle-head" "package"
mod = span "hoogle-head" "module"
cls = span "hoogle-head" "class"
unicodeReplace :: String -> String
unicodeReplace =
......
......@@ -327,6 +327,3 @@ replyTo _ ObjectInfoRequest{objectName=oname} replyHeader state = do
objectDocString = Chars.pack docs
}
return (state, reply)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment