From: Ulya Trofimovich Date: Sun, 15 Nov 2015 12:15:20 +0000 (+0000) Subject: Added favicon, template and localhost site launcher. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da475617989df35c7475e996325c7cd4d9d6d145;p=re2c Added favicon, template and localhost site launcher. --- diff --git a/Makefile b/Makefile index c3b68d44..c30bf84e 100644 --- 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 index 00000000..36041436 --- /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 acb38c8f..13171735 100755 --- 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 index 00000000..386f482a Binary files /dev/null and b/src/favicon.ico differ diff --git a/src/template.html b/src/template.html new file mode 100644 index 00000000..5f147506 --- /dev/null +++ b/src/template.html @@ -0,0 +1,10 @@ +%(head_prefix)s +%(head)s + + +%(stylesheet)s +%(body_prefix)s +%(body_pre_docinfo)s +%(docinfo)s +%(body)s +%(body_suffix)s