DefinitionList list
-> formatDefinitionList -< (baseURI, list)
- LeadingSpaced inlines
- -> formatLeadingSpaced -< (baseURI, inlines)
+ Preformatted inlines
+ -> formatPreformatted -< (baseURI, inlines)
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
) -< (baseURI, def)
-formatLeadingSpaced :: (ArrowXml a, ArrowChoice a) => a (URI, [InlineElement]) XmlTree
-formatLeadingSpaced
+formatPreformatted :: (ArrowXml a, ArrowChoice a) => a (URI, [InlineElement]) XmlTree
+formatPreformatted
= eelem "pre"
+= ( (arr fst &&& arrL snd)
>>>
Text text
-> mkText -< text
+ Italic inlines
+ -> ( eelem "i"
+ += ( (arr fst &&& arrL snd)
+ >>>
+ formatInline
+ )
+ ) -< (baseURI, inlines)
+
+ Bold inlines
+ -> ( eelem "b"
+ += ( (arr fst &&& arrL snd)
+ >>>
+ formatInline
+ )
+ ) -< (baseURI, inlines)
+
link@(PageLink _ _ _)
-> formatPageLink -< (baseURI, link)
+ LineBreak attrs
+ -> ( eelem "br"
+ += (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)
+ -> attr name (txt value) -<< ()
+
formatPageLink :: (ArrowXml a) => a (URI, InlineElement) XmlTree
formatPageLink