]> gitweb.michael.orlitzky.com - dead/lwn-epub.git/blobdiff - src/LWN/FullPage.hs
Add a first draft using HXT, HandsomeSoup, and the Haskell epub library.
[dead/lwn-epub.git] / src / LWN / FullPage.hs
diff --git a/src/LWN/FullPage.hs b/src/LWN/FullPage.hs
new file mode 100644 (file)
index 0000000..9ff782c
--- /dev/null
@@ -0,0 +1,23 @@
+module LWN.FullPage
+where
+
+import Epublishable
+import LWN.Article
+import XHTML
+
+-- | An LWN page with more than one article on it. These require
+--   different parsing and display functions than the single-article
+--   pages.
+data FullPage = FullPage { articles :: [Article] }
+
+instance XHTML FullPage where
+  to_xhtml fp = ""
+
+instance Epublishable FullPage where
+  parse xml = do
+    articles <- parse_articles xml
+    case articles of
+      (x:xs)@all -> return $ Just $ FullPage all
+      _          -> return Nothing
+
+  title _ = "LWN.net"