+{-# LANGUAGE ScopedTypeVariables #-}
module Main
where
-data Article = Article { headline :: String,
- byline :: String,
- body_html :: String }
- deriving (Eq, Show)
+import Data.Maybe (fromJust)
+import Text.HandsomeSoup (parseHtml)
-parse_article :: String -> String
-parse_article _ = ""
+import Epublishable
+import LWN.ArticlePage
+import LWN.FullPage
+import XHTML
main :: IO ()
main = do
- putStrLn "Hello, world."
+ article_html <- readFile "test/fixtures/501317-article.html"
+ ioap <- parse $ parseHtml article_html
+ let article_page :: ArticlePage = fromJust $ ioap
+ epublish article_page "single_article.epub"
+
+ page_html <- readFile "test/fixtures/500848-page.html"
+ ioap_f <- parse $ parseHtml page_html
+ let full_page :: FullPage = fromJust $ ioap_f
+ --putStrLn $ to_xhtml full_page
+ --epublish full_page "full_page.epub"
+ putStrLn "Done."