wikifyPage :: (ArrowXml a, ArrowChoice a) => InterpTable -> a XmlTree WikiPage
wikifyPage interpTable
= proc tree
- -> do pName <- getXPathTreesInDoc "/page/@name/text()" >>> getText -< tree
- pType <- getXPathTreesInDoc "/page/@type/text()" >>> getText >>> arr read -< tree
- pFileName <- maybeA (getXPathTreesInDoc "/page/fileName/text()" >>> getText) -< tree
+ -> do pType <- getXPathTreesInDoc "/page/@type/text()" >>> getText >>> arr read -< tree
textData <- maybeA (getXPathTreesInDoc "/page/textData/text()" >>> getText) -< tree
base64Data <- maybeA (getXPathTreesInDoc "/page/binaryData/text()" >>> getText) -< tree
-> returnA -< [ Paragraph [Image (Left $ fromJust dataURI) Nothing] ]
_ -> if isJust dataURI then
- -- <a href="data:application/zip;base64,...">foo.zip</a>
+ -- <a href="data:application/zip;base64,...">
+ -- application/zip
+ -- </a>
returnA -< [ Paragraph [ Anchor
[("href", show dataURI)]
- [Text (fromMaybe (defaultFileName pType pName) pFileName)]
+ [Text (show pType)]
]
]
else