]> gitweb @ CieloNegro.org - Lucu.git/commitdiff
Added an example of lucu-implant-file.
authorpho <pho@cielonegro.org>
Wed, 3 Oct 2007 10:27:01 +0000 (19:27 +0900)
committerpho <pho@cielonegro.org>
Wed, 3 Oct 2007 10:27:01 +0000 (19:27 +0900)
darcs-hash:20071003102701-62b54-2c592046da1c8efc7de552dc2f52ba87109558ca.gz

.boring
examples/HelloWorld.hs
examples/Implanted.hs [new file with mode: 0644]
examples/Makefile
examples/mise-rafturai.html [new file with mode: 0644]

diff --git a/.boring b/.boring
index 320eabe33aa7cb1d7729d0ab0006655c0d5482f7..2591e26213774f374c188a1bef6601d46f50ceda 100644 (file)
--- a/.boring
+++ b/.boring
@@ -55,3 +55,5 @@
 ^.installed-pkg-config$
 
 ^examples/HelloWorld$
+^examples/Implanted$
+^examples/MiseRafturai\.hs$
index ad1263b530f133bde94f061b07e578fc212739a8..f21e052d7c0a8219ae0ee6b91510e081ee4032e4 100644 (file)
@@ -13,7 +13,8 @@ main = let config    = defaultConfig { cnfServerPort = PortNumber 9999 }
                                    , staticDir "/usr/include" )
                                  ]
        in
-         runHttpd config resources
+         do putStrLn "Access http://localhost:9999/ with your browser."
+            runHttpd config resources
 
 
 helloWorld :: ResourceDef
diff --git a/examples/Implanted.hs b/examples/Implanted.hs
new file mode 100644 (file)
index 0000000..633e40a
--- /dev/null
@@ -0,0 +1,11 @@
+import MiseRafturai
+import Network
+import Network.HTTP.Lucu
+
+main :: IO ()
+main = let config    = defaultConfig { cnfServerPort = PortNumber 9999 }
+           resources = mkResTree [ ([], miseRafturai) ]
+       in
+         do putStrLn "Access http://localhost:9999/ with your browser."
+            runHttpd config resources
+                                   
\ No newline at end of file
index e1c2c5aecc6979afd98f191bc126b3b19462e6bf..02537764fcd3680dc614a616c4316848c5decab0 100644 (file)
@@ -1,10 +1,14 @@
-build:
-       ghc --make HelloWorld -threaded -fglasgow-exts -O3
+build: MiseRafturai.hs
+       ghc --make HelloWorld -threaded -O3
+       ghc --make Implanted -threaded -O3
 
 run: build
        ./HelloWorld
 
 clean:
-       rm -f HelloWorld *.hi *.o
+       rm -f HelloWorld Implanted MiseRafturai.hs *.hi *.o
+
+MiseRafturai.hs: mise-rafturai.html
+       lucu-implant-file -m MiseRafturai -o $@ $<
 
 .PHONY: build run clean
\ No newline at end of file
diff --git a/examples/mise-rafturai.html b/examples/mise-rafturai.html
new file mode 100644 (file)
index 0000000..b1d6f9c
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xml:lang="ga" xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Mise Rafturaí</title>
+  </head>
+  <body>
+    <h1>Mise Rafturaí</h1>
+
+    <p>
+      Mise Rafturaí an file<br />
+      Lán dúċais is gráḋ<br />
+      Le súile gan solas<br />
+      Le ciúnas gan crá<br />
+    </p>
+
+    <p>
+      Ag dul síar ar m'aistear<br />
+      Le solas mo ċroí<br />
+      Fann agus tuirseaċ<br />
+      Go deireaḋ mo ṡlí<br />
+    </p>
+
+    <p>
+      Féaċ anois mé<br />
+      Is mo ċúl le ḃfalla<br />
+      Ag seinm ceoil<br />
+      Do ṗócaí folaṁ<br />
+    </p>
+  </body>
+</html>
\ No newline at end of file