diff options
Diffstat (limited to 'src/HaskellCodeExplorer')
-rw-r--r-- | src/HaskellCodeExplorer/Types.hs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/HaskellCodeExplorer/Types.hs b/src/HaskellCodeExplorer/Types.hs index b42db87..1bd9b25 100644 --- a/src/HaskellCodeExplorer/Types.hs +++ b/src/HaskellCodeExplorer/Types.hs @@ -25,7 +25,7 @@ import Data.Generics , DataType , Fixity(..) , constrIndex - , gcast2 +-- , gcast2 , mkConstr , mkDataType ) @@ -46,6 +46,7 @@ import Documentation.Haddock.Types ( DocH(..) , Example(..) , Header(..) + , ModLink(..) , Hyperlink(..) , Picture(..) #if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0) @@ -481,7 +482,7 @@ instance (Data k, Data v, Eq k, Ord k, Data (IVM.Interval k)) => 1 -> k (z IVM.fromList) _ -> error "gunfold" dataTypeOf _ = intervalMapDataType - dataCast2 = gcast2 + -- dataCast2 = gcast2 fromListConstr :: Constr fromListConstr = mkConstr intervalMapDataType "fromList" [] Prefix @@ -763,10 +764,13 @@ docToHtml modToHtml idToHtml = toStrict . renderHtml . toH mapM_ (\(doc1, doc2) -> Html.dt (toH doc1) >> Html.dd (toH doc2)) docs toH (DocCodeBlock doc) = Html.div Html.! Attr.class_ "source-code" $ toH doc toH (DocIdentifierUnchecked modName) = modToHtml modName - toH (DocModule str) = Html.span . Html.toHtml . T.pack $ str - toH (DocHyperlink (Hyperlink url mbTitle)) = + toH (DocModule (ModLink url label)) = + -- Html.span . Html.toHtml . T.pack $ str Html.a Html.! (Attr.href . Html.textValue . T.pack $ url) $ - Html.toHtml $ fromMaybe url mbTitle + fromMaybe (Html.toHtml url) $ toH <$> label + toH (DocHyperlink (Hyperlink url label)) = + Html.a Html.! (Attr.href . Html.textValue . T.pack $ url) $ + fromMaybe (Html.toHtml url) $ toH <$> label toH (DocPic (Picture uri mbTitle)) = Html.img Html.! (Attr.src . Html.textValue . T.pack $ uri) Html.! (Attr.title . Html.textValue . T.pack $ fromMaybe "" mbTitle) |