Paragraph inlines
-> formatParagraph -< (baseURI, inlines)
+ Div attrs contents
+ -> ( eelem "div"
+ += ( arrL (fst . snd)
+ >>>
+ attrFromPair
+ )
+ += ( (arr fst &&& arrL (snd . snd))
+ >>>
+ formatBlock
+ )
+ ) -< (baseURI, (attrs, contents))
+
formatHeading :: ArrowXml a => a (Int, String) XmlTree
formatHeading
= proc (level, text)
- -> selem ("h" ++ show level) [txt text] -<< ()
+ -> mkelem ("h" ++ show level)
+ [ sattr "id" text ]
+ [ txt text ] -<< ()
formatListElement :: (ArrowXml a, ArrowChoice a) => a (URI, ListElement) XmlTree
+= (arrL id >>> attrFromPair)
) -< attrs
+ Span attrs contents
+ -> ( eelem "span"
+ += ( arrL (fst . snd)
+ >>>
+ attrFromPair
+ )
+ += ( (arr fst &&& arrL (snd . snd))
+ >>>
+ formatInline
+ )
+ ) -< (baseURI, (attrs, contents))
+
attrFromPair :: (ArrowXml a) => a (String, String) XmlTree
attrFromPair = proc (name, value)