Comment tweak

This commit is contained in:
Chris Done 2014-05-27 16:37:31 +02:00
parent 14705c505a
commit 4a8bdcaa63
3 changed files with 12 additions and 10 deletions

View file

@ -1,4 +1,4 @@
-- | Blaze without attribute operators
-- | Blaze without attribute operators.
module Blaze.Senza where

View file

@ -29,13 +29,14 @@ import Text.XML.Cursor
getWikiPage :: Text -> IO (Either Text (Text,Pandoc))
getWikiPage article =
do request <- parseUrl ("http://www.haskell.org/haskellwiki/Special:Export/" <> unpack article)
withManager $ \manager -> do
response <- http request manager
doc <- catch (fmap Just (responseBody response $$+- sinkDoc def))
(\(_::UnresolvedEntityException) -> return Nothing)
case doc >>= parse of
Nothing -> return (Left "Unable to parse XML from haskell.org.")
Just (title,pan) -> return (Right (title,pan))
withManager
(\manager ->
do response <- http request manager
doc <- catch (fmap Just (responseBody response $$+- sinkDoc def))
(\(_::UnresolvedEntityException) -> return Nothing)
case doc >>= parse of
Nothing -> return (Left "Unable to parse XML from haskell.org.")
Just (title,pan) -> return (Right (title,pan)))
where
parse doc =
do let cursor = fromDocument doc

View file

@ -93,8 +93,9 @@ bread url crumbs =
ol [class_ "breadcrumb"]
(forM_ crumbs
(\route ->
li [] (a [href (url route)]
(toHtml (fromRoute route)))))
li []
(a [href (url route)]
(toHtml (fromRoute route)))))
-- | Generate a human-readable string from a route.
fromRoute :: Route App -> Text