]> granicus.if.org Git - re2c/commitdiff
Added favicon, template and localhost site launcher.
authorUlya Trofimovich <skvadrik@gmail.com>
Sun, 15 Nov 2015 12:15:20 +0000 (12:15 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Sun, 15 Nov 2015 12:15:20 +0000 (12:15 +0000)
Makefile
launch.hs [new file with mode: 0644]
mk.sh
src/favicon.ico [new file with mode: 0644]
src/template.html [new file with mode: 0644]

index c3b68d44ac3e91d07b74cada01d02a8737dec1b3..c30bf84e8ca2743d4e6742e97a5b55b2d4e618f0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -63,9 +63,6 @@ SRC_RST = \
     src/install/install.rst \
     src/index.rst
 
-SRC_CSS = \
-    src/css/default.css
-
 SRC_OTH = \
     src/examples/06_braille.utf8.txt \
     src/examples/05_parsing_integers_conditions.re \
@@ -78,6 +75,7 @@ SRC_OTH = \
     src/examples/06_braille.utf16.txt \
     src/examples/03_arbitrary_large_input.re \
     src/examples/02_recognizing_strings.re \
+    src/favicon.ico \
     src/feed/feed.png \
     src/feed/atom.xml \
     src/manual/warnings/condition_order/wcondition_order.re \
@@ -98,7 +96,7 @@ all: $(OBJ_RST)
 
 .rst.html:
        @ mkdir -p "`dirname $@`"
-       @ rst2html.py --stylesheet="$(VPATH)/$(SRC_CSS)" --record-dependencies="$*.dd" $< $@
+       @ rst2html.py --stylesheet="$(VPATH)/src/css/default.css" --template="$(VPATH)/src/template.html" --record-dependencies="$*.dd" $< $@
        @ echo $@: `cat $*.dd` > $*.d && rm $*.dd
        @ echo $@
 
diff --git a/launch.hs b/launch.hs
new file mode 100644 (file)
index 0000000..3604143
--- /dev/null
+++ b/launch.hs
@@ -0,0 +1,12 @@
+import qualified Snap.Http.Server    as Snap
+import qualified Snap.Util.FileServe as Snap
+
+main :: IO ()
+main =
+    let config
+            = Snap.setPort      8000
+            $ Snap.setAccessLog Snap.ConfigNoLog
+            $ Snap.setErrorLog  Snap.ConfigNoLog
+            $ Snap.emptyConfig
+    in  Snap.httpServe config $ Snap.serveDirectory "obj/src"
+
diff --git a/mk.sh b/mk.sh
index acb38c8faacb8ea533759aaa576c73c94410a60f..131717351f4e14fb784b2af9199cfd6d0a679c1c 100755 (executable)
--- a/mk.sh
+++ b/mk.sh
@@ -5,3 +5,6 @@ objdir="obj" \
     && make -f ../Makefile -j5 \
     && cd ..
 
+runhaskell launch.hs
+
+
diff --git a/src/favicon.ico b/src/favicon.ico
new file mode 100644 (file)
index 0000000..386f482
Binary files /dev/null and b/src/favicon.ico differ
diff --git a/src/template.html b/src/template.html
new file mode 100644 (file)
index 0000000..5f14750
--- /dev/null
@@ -0,0 +1,10 @@
+%(head_prefix)s
+%(head)s
+<link rel="alternate" type="application/atom+xml" href="/feed/atom.xml" title="Atom 1.0" />
+<link rel="shortcut icon" href="/favicon.ico" />
+%(stylesheet)s
+%(body_prefix)s
+%(body_pre_docinfo)s
+%(docinfo)s
+%(body)s
+%(body_suffix)s