]> ruin.nu Git - yawbih.git/commitdiff
adding the main file and some minor changes
authorMichael Andreen <harv@ruin.nu>
Thu, 9 Dec 2004 11:26:36 +0000 (11:26 +0000)
committerMichael Andreen <harv@ruin.nu>
Thu, 9 Dec 2004 11:26:36 +0000 (11:26 +0000)
Main.hs [new file with mode: 0644]
Wiki.hs

diff --git a/Main.hs b/Main.hs
new file mode 100644 (file)
index 0000000..93a5616
--- /dev/null
+++ b/Main.hs
@@ -0,0 +1,21 @@
+module Main where 
+
+import CGI hiding (div, head, map, span)
+import RawCGIInternal
+import CGIOutput
+
+main = start [] cgi
+
+cgi CGIInfo {cgiUrl = url, cgiPathInfo = pi, cgiContentType = ct, cgiContents = c, cgiCookies = co, cgiArgs = as, cgiHandle = h} parms = do 
+       putStr "content-type: text/html\n\n"
+       print parms
+       print url
+       print pi
+       print ct
+       print co
+       print co
+       print as
+       print h
+       case assocParm "test" parms of
+               Nothing -> putStr "Parameter 'test' not provided"
+               Just x -> putStr $ "Value of test = "++x
diff --git a/Wiki.hs b/Wiki.hs
index bcfd23694a025b65363372dbb3f4f1ac0fa48978..1708f57f7d094276c3afd7dcc01c81e05f315a39 100644 (file)
--- a/Wiki.hs
+++ b/Wiki.hs
@@ -11,7 +11,7 @@ class Backend a where
        --Keyword -> (Full text,date)
        getCurrent :: a -> String -> IO (Maybe (String,String))
 
-       --Keyword -> [(id,date)]
+       --Keyword -> [(id,date,author,comment)]
        getList :: a -> String -> IO [(String, String, String, String)]
 
        --Keyword -> id -> Full text
@@ -23,6 +23,12 @@ class Backend a where
        --Keyword -> Full text -> id
        update :: a -> String -> String -> String -> String -> IO String
 
+data Markup = Text String
+       | Bold String
+       | Paragraph [Markup]
+
+type Document = [Markup]
+
 newtype PGB = PGB DBService
 
 createPGB :: String -> String -> String -> String -> IO PGB