]> gitweb.michael.orlitzky.com - dead/lwn-epub.git/blob - src/Main.hs
Begin work on the full page code.
[dead/lwn-epub.git] / src / Main.hs
1 {-# LANGUAGE ScopedTypeVariables #-}
2 module Main
3 where
4
5 import Data.Maybe (fromJust)
6 import Text.HandsomeSoup (parseHtml)
7
8 import Epublishable
9 import LWN.ArticlePage
10 import LWN.FullPage
11 import XHTML
12
13 main :: IO ()
14 main = do
15 article_html <- readFile "test/fixtures/501317-article.html"
16 ioap <- parse $ parseHtml article_html
17 let article_page :: ArticlePage = fromJust $ ioap
18 epublish article_page "single_article.epub"
19
20 page_html <- readFile "test/fixtures/500848-page.html"
21 ioap_f <- parse $ parseHtml page_html
22 let full_page :: FullPage = fromJust $ ioap_f
23 --putStrLn $ to_xhtml full_page
24 --epublish full_page "full_page.epub"
25 putStrLn "Done."