module Rakka.Wiki.Engine
( formatPage
+ , formatSubPage
)
where
attachXHtmlNs -< tree
+formatSubPage :: (ArrowXml a, ArrowChoice a, ArrowIO a) =>
+ Environment
+ -> a (Page, Page) XmlTree
+formatSubPage env
+ = proc (mainPage, subPage)
+ -> do tree <- case pageType subPage of
+ MIMEType "text" "x-rakka" _
+ -> do let source = decodeLazy UTF8 (pageContent subPage)
+ formatWikiPage env -< (Just mainPage, source)
+ attachXHtmlNs -< tree
+
+
formatWikiPage :: (ArrowXml a, ArrowChoice a, ArrowIO a) =>
Environment
-> a (Maybe Page, String) XmlTree