1 {-# LANGUAGE ScopedTypeVariables #-}
5 import Data.Maybe (fromJust)
6 import Text.XML.HXT.Core -- (SysConfigList, IOStateArrow, XmlTree, readDocument)
12 my_read :: String -> IOStateArrow s b XmlTree
14 readDocument [ withValidate no,
16 withInputEncoding utf8,
21 let article_html = my_read "test/fixtures/501317-article.html"
22 ioap <- parse article_html
23 let article_page :: ArticlePage = fromJust $ ioap
24 epublish article_page "single_article.epub"
26 let page_html = my_read "test/fixtures/500848-page.html"
27 ioap_f <- parse page_html
28 let full_page :: FullPage = fromJust $ ioap_f
29 epublish full_page "full_page.epub"
31 let bigpage_html = my_read "test/fixtures/50844-bigpage.html"
32 ioap_bp <- parse bigpage_html
33 let bigpage :: FullPage = fromJust $ ioap_bp
34 epublish bigpage "bigpage.epub"