Commit 586f2877 authored by Bas Lijnse's avatar Bas Lijnse

Added a for linux which generates a path index of all the libraries,...

Added a for linux which generates a path index of all the libraries, and added an examples dir with a small web demo cgi application

git-svn-id: 2afc29ad-3112-4e41-907a-9359c7e6e986
parent c77b92f0
clm -I `cat ../libraries/cplibs.txt` -nt -nr webdemo -o webdemo
module webdemo
* Simple CGI application built solely on clean-platform libs
import StdEnv
import Html //Text.Html
import Http //Internet.Http
import Cgi //Internet.Http.Cgi
page = HtmlTag [] [head,body]
head = HeadTag [] [TitleTag [] [Text "Hello World!"]]
body = BodyTag [] [H1Tag [] [Text "Hello World!"]]
helloPage :: !HTTPRequest !*World -> (!HTTPResponse,!*World)
helloPage req world
= ({newHTTPResponse & rsp_data = toString (page (name req))},world)
name req = case get "name" req.arg_get of
Nothing = "world"
(Just n) = n
page name = HtmlTag [] [head name,body name]
head name = HeadTag [] [TitleTag [] [Text "Hello ", Text name]]
body name = BodyTag [] [H1Tag [] [Text "Hello ", Text name]]
Start :: *World -> *World
Start world = startCGI [] [(\_ -> True,helloPage)] world
echo "Setting up the Clean Platform library collection"
echo "==="
echo "Creating libraries/cplibs.txt..."
find libraries -type d | grep -v "Clean System Files" | grep -v "\.svn" | grep -v "OS-[Windows|MacOS]" | xargs printf "$PWD/%s:" | xargs printf "%s." > libraries/cplibs.txt
echo "==="
echo "You can now include the Clean platform libraries by adding -I \`cat libraries/cplibs.txt\` to your clm options."
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment