]> ruin.nu Git - yawbih.git/commitdiff
Monospace fonts
authorMichael Andreen <harv@ruin.nu>
Tue, 1 Feb 2005 17:42:30 +0000 (17:42 +0000)
committerMichael Andreen <harv@ruin.nu>
Sat, 26 Jan 2008 11:33:19 +0000 (12:33 +0100)
Main.hs
Wiki.hs

diff --git a/Main.hs b/Main.hs
index 2dafbccda09d522a9cea358208d07371d59049fe..2aa225ead5154a711fbbc957f3036ad552c0abda 100644 (file)
--- 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 2d394b8243d273dcd3fac82abe0c1b51e9e3d1f2..3d1eed2b309b09e5cc5385ddc3c8852be47e7a1d 100644 (file)
--- 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) = "<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