Backend (getCurrent,getList,get,setCurrent,update,listKeys)
,PGB
,createPGB
- ,Markup (Text, Paragraph, Link, Bold, Emph, Heading, Url, Underline, Strike, Pre,List)
+ ,Markup (Text, Paragraph, Link, Bold, Emph, Mono, Heading, Url, Underline, Strike, Pre,List)
,Document
,wikiParser
,htmlOutput
| Link String String
| Bold [Markup]
| Emph [Markup]
+ | Mono [Markup]
| Heading Int [Markup]
| Url String
| Underline [Markup]
pEmph = pS "//" (\s -> Emph s)
pUnderline = pS "__" (\s -> Underline s)
pStrike = pS "--" (\s -> Strike s)
+pMono = pS "||" (\s -> Mono s)
pS s f = string s >> do
s <- pStopAt s
return (f s)
,try(pEmph)
,try(pUnderline)
,try(pStrike)
+ ,try(pMono)
,try (pLink)
,try (pURL)
,try (pMail)
,try pEmph
,try pUnderline
,try pStrike
+ ,try pMono
,try pLink
,try pURL
,try pMail
toHtml ((Link l d):xs) = "<link: "++l++" desc: "++d++">"++toHtml xs
toHtml ((Bold d):xs) = "<b>"++toHtml d++"</b>"++toHtml xs
toHtml ((Emph d):xs) = "<em>"++toHtml d++"</em>"++toHtml xs
+toHtml ((Mono d):xs) = "<tt>"++toHtml d++"</tt>"++toHtml xs
toHtml ((Underline d):xs) = "<u>"++toHtml d++"</u>"++toHtml xs
toHtml ((Strike d):xs) = "<strike>"++toHtml d++"</strike>"++toHtml xs
toHtml ((Heading n d):xs) = "\n<h"++show n++">"++toHtml d++"</h"++show n++">\n"++toHtml xs