From da475617989df35c7475e996325c7cd4d9d6d145 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sun, 15 Nov 2015 12:15:20 +0000 Subject: [PATCH] Added favicon, template and localhost site launcher. --- Makefile | 6 ++---- launch.hs | 12 ++++++++++++ mk.sh | 3 +++ src/favicon.ico | Bin 0 -> 318 bytes src/template.html | 10 ++++++++++ 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 launch.hs create mode 100644 src/favicon.ico create mode 100644 src/template.html 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 0000000000000000000000000000000000000000..386f482aa1dc3bd8e8a95a1f7fb30b24aba4f76f GIT binary patch literal 318 zcmbV{u?<2o3`AcfBnk@rg+xvHcc7qPnBTGiY{Et$W}*2F3U@I<)Hpi(V*5@B6rG4r zUN9Ee0;3SZPH^9GX*rW;j?;0I + +%(stylesheet)s +%(body_prefix)s +%(body_pre_docinfo)s +%(docinfo)s +%(body)s +%(body_suffix)s -- 2.40.0