]> ruin.nu Git - yawbih.git/blobdiff - Main.hs
headings, urls and maybe some more
[yawbih.git] / Main.hs
diff --git a/Main.hs b/Main.hs
index 2457b058632e32edc520c090bf631d33f86b5063..324241616b6b4c462ceceddd58b41fb525af98e1 100644 (file)
--- a/Main.hs
+++ b/Main.hs
@@ -118,6 +118,19 @@ ex ((Bold d):xs) = do
 ex ((Emph d):xs) = do
        em (ex d)
        ex xs
+ex ((Heading n d):xs) = do
+       heading n $ ex d
+       ex xs
+ex ((Url l):xs) = do
+       hlink (URL {unURL = ("wiki?"++l)}) (text l)
+       ex xs
+
+heading 1 = h1
+heading 2 = h2
+heading 3 = h3
+heading 4 = h4
+heading 5 = h5
+heading 6 = h6
 
 ex2 [] = []
 ex2 ((Paragraph):xs) = "<p>"++ex2 xs
@@ -125,6 +138,8 @@ ex2 ((Text s):xs) = s++ex2 xs
 ex2 ((Link l d):xs) = "<link: "++l++" desc: "++d++">"++ex2 xs
 ex2 ((Bold d):xs) = "<b>"++ex2 d++"</b>"++ex2 xs
 ex2 ((Emph d):xs) = "<em>"++ex2 d++"</em>"++ex2 xs
+ex2 ((Heading n d):xs) = "<h"++show n++">"++ex2 d++"</h"++show n++">"++ex2 xs
+ex2 ((Url l):xs) = "<link: "++l++">"++ex2 xs
 
 
 test s = case parse wikiParser "" s of