]> gitweb.michael.orlitzky.com - dead/lwn-epub.git/blobdiff - src/Main.hs
Begin work on the full page code.
[dead/lwn-epub.git] / src / Main.hs
index e91654da85a6446d32a02afed636a106dd514a7e..37f89674eacbc115050f65f717a6bbe8530ddf71 100644 (file)
@@ -1,14 +1,25 @@
+{-# 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."