Comment tweak
This commit is contained in:
parent
14705c505a
commit
4a8bdcaa63
3 changed files with 12 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
-- | Blaze without attribute operators
|
||||
-- | Blaze without attribute operators.
|
||||
|
||||
module Blaze.Senza where
|
||||
|
||||
|
|
|
@ -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
|
||||
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))
|
||||
Just (title,pan) -> return (Right (title,pan)))
|
||||
where
|
||||
parse doc =
|
||||
do let cursor = fromDocument doc
|
||||
|
|
|
@ -93,7 +93,8 @@ bread url crumbs =
|
|||
ol [class_ "breadcrumb"]
|
||||
(forM_ crumbs
|
||||
(\route ->
|
||||
li [] (a [href (url route)]
|
||||
li []
|
||||
(a [href (url route)]
|
||||
(toHtml (fromRoute route)))))
|
||||
|
||||
-- | Generate a human-readable string from a route.
|
||||
|
|
Loading…
Reference in a new issue