renderDocs :: String -> String
renderDocs doc =
  let groups = List.groupBy bothAreCode $ lines doc
      nonull = filter (not . null . strip)
      bothAreCode s1 s2 =
                           isPrefixOf ">" (strip s1) &&
                           isPrefixOf ">" (strip s2)
      isCode (s:_) = isPrefixOf ">" $ strip s
      makeBlock lines =
                         if isCode lines
                           then div' "hoogle-code" $ unlines $ nonull lines
                           else div' "hoogle-text" $ unlines $ nonull lines
  in div' "hoogle-doc" $ unlines $ map makeBlock groups
renderDocs :: String -> String
renderDocs doc =
  let groups = List.groupBy bothAreCode $ lines doc
      nonull = filter (not . null . strip)
      bothAreCode s1 s2 =
                           isPrefixOf ">" (strip s1) &&
                           isPrefixOf ">" (strip s2)
      isCode (s:_) = isPrefixOf ">" $ strip s
      makeBlock lines =
                         if isCode lines
                           then div' "hoogle-code" $ unlines $ nonull lines
                           else div' "hoogle-text" $ unlines $ nonull lines
  in div' "hoogle-doc" $ unlines $ map makeBlock groups
renderDocs doc =
  let groups = List.groupBy bothAreCode $ lines doc
      nonull = filter (not . null . strip)
      bothAreCode s1 s2 =
                           isPrefixOf ">" (strip s1) &&
                           isPrefixOf ">" (strip s2)
      isCode (s:_) = isPrefixOf ">" $ strip s
      makeBlock lines =
                         if isCode lines
                           then div' "hoogle-code" $ unlines $ nonull lines
                           else div' "hoogle-text" $ unlines $ nonull lines
  in div' "hoogle-doc" $ unlines $ map makeBlock groups