From: Michael Andreen Date: Tue, 1 Feb 2005 17:42:30 +0000 (+0000) Subject: Monospace fonts X-Git-Url: https://ruin.nu/git/?p=yawbih.git;a=commitdiff_plain;h=fd788a2053b4f32bd80d002329d64272af23759d Monospace fonts --- diff --git a/Main.hs b/Main.hs index 2dafbcc..2aa225e 100644 --- a/Main.hs +++ b/Main.hs @@ -134,6 +134,9 @@ toWash ((Bold d):xs) = do toWash ((Emph d):xs) = do em (toWash d) toWash xs +toWash ((Mono d):xs) = do + tt (toWash d) + toWash xs toWash ((Underline d):xs) = do u (toWash d) toWash xs diff --git a/Wiki.hs b/Wiki.hs index 2d394b8..3d1eed2 100644 --- a/Wiki.hs +++ b/Wiki.hs @@ -2,7 +2,7 @@ module Wiki ( 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 @@ -37,6 +37,7 @@ data Markup = Text String | Link String String | Bold [Markup] | Emph [Markup] + | Mono [Markup] | Heading Int [Markup] | Url String | Underline [Markup] @@ -106,6 +107,7 @@ pBold = pS "**" (\s -> Bold s) 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) @@ -156,6 +158,7 @@ pMain = choice [ ,try(pEmph) ,try(pUnderline) ,try(pStrike) + ,try(pMono) ,try (pLink) ,try (pURL) ,try (pMail) @@ -169,6 +172,7 @@ pOneLine = choice [ ,try pEmph ,try pUnderline ,try pStrike + ,try pMono ,try pLink ,try pURL ,try pMail @@ -240,6 +244,7 @@ toHtml ((Text s):xs) = s++toHtml xs toHtml ((Link l d):xs) = ""++toHtml xs toHtml ((Bold d):xs) = ""++toHtml d++""++toHtml xs toHtml ((Emph d):xs) = ""++toHtml d++""++toHtml xs +toHtml ((Mono d):xs) = ""++toHtml d++""++toHtml xs toHtml ((Underline d):xs) = ""++toHtml d++""++toHtml xs toHtml ((Strike d):xs) = ""++toHtml d++""++toHtml xs toHtml ((Heading n d):xs) = "\n"++toHtml d++"\n"++toHtml xs