X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Flwn-epub.git;a=blobdiff_plain;f=src%2FLWN%2FFullPage.hs;h=1ba7910cf329d414a6b8e6d6ab10dbceee239050;hp=9ff782c89bc0b7e60cda43a7d47379b97470083b;hb=ed2ed8abd62ba3dec7f799253de1133732f8c153;hpb=b591d5f5c3c47d253c24144beae1edf8648cd94b diff --git a/src/LWN/FullPage.hs b/src/LWN/FullPage.hs index 9ff782c..1ba7910 100644 --- a/src/LWN/FullPage.hs +++ b/src/LWN/FullPage.hs @@ -1,6 +1,29 @@ module LWN.FullPage where +import Data.String.Utils (split, strip) +import Data.Maybe (catMaybes, fromJust) +import Data.Tree.NTree.TypeDefs (NTree) +import Text.XML.HXT.Core ( + ArrowXml, + IOSArrow, + XmlTree, + XNode, + (>>>), + (/>), + (//>), + getChildren, + getText, + hasAttrValue, + hasName, + none, + processTopDown, + runX, + xshow, + when + ) +import Text.HandsomeSoup (css, parseHtml) + import Epublishable import LWN.Article import XHTML @@ -8,16 +31,180 @@ 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] } +data FullPage = FullPage { headline :: String, + articles :: [Article] } + +articles_xhtml :: FullPage -> String +articles_xhtml fp = concatMap to_xhtml (articles fp) instance XHTML FullPage where - to_xhtml fp = "" + to_xhtml fp = + "" ++ + "" ++ + "
" ++ + " " ++ + "