From: pho Date: Wed, 3 Oct 2007 10:27:01 +0000 (+0900) Subject: Added an example of lucu-implant-file. X-Git-Tag: RELEASE-0_2_1~30 X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=7b141208b4c741de208ec147eff6b2462ce26e80;p=Lucu.git Added an example of lucu-implant-file. darcs-hash:20071003102701-62b54-2c592046da1c8efc7de552dc2f52ba87109558ca.gz --- diff --git a/.boring b/.boring index 320eabe..2591e26 100644 --- a/.boring +++ b/.boring @@ -55,3 +55,5 @@ ^.installed-pkg-config$ ^examples/HelloWorld$ +^examples/Implanted$ +^examples/MiseRafturai\.hs$ diff --git a/examples/HelloWorld.hs b/examples/HelloWorld.hs index ad1263b..f21e052 100644 --- a/examples/HelloWorld.hs +++ b/examples/HelloWorld.hs @@ -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 index 0000000..633e40a --- /dev/null +++ b/examples/Implanted.hs @@ -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 diff --git a/examples/Makefile b/examples/Makefile index e1c2c5a..0253776 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -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 index 0000000..b1d6f9c --- /dev/null +++ b/examples/mise-rafturai.html @@ -0,0 +1,30 @@ + + + + Mise Rafturaí + + +

Mise Rafturaí

+ +

+ Mise Rafturaí an file
+ Lán dúċais is gráḋ
+ Le súile gan solas
+ Le ciúnas gan crá
+

+ +

+ Ag dul síar ar m'aistear
+ Le solas mo ċroí
+ Fann agus tuirseaċ
+ Go deireaḋ mo ṡlí
+

+ +

+ Féaċ anois mé
+ Is mo ċúl le ḃfalla
+ Ag seinm ceoil
+ Do ṗócaí folaṁ
+

+ + \ No newline at end of file