Mainly code tidyup, also documentation.
This commit is contained in:
parent
04ce4d7f83
commit
357f4f53d4
40
docs/cloverage/coverage.css
Normal file
40
docs/cloverage/coverage.css
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
.covered {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
background-color: #558B55;
|
||||||
|
}
|
||||||
|
|
||||||
|
.not-covered {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.partial {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
background-color: orange;
|
||||||
|
}
|
||||||
|
|
||||||
|
.not-tracked {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blank {
|
||||||
|
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.with-bar {
|
||||||
|
width: 250px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.with-number {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.ns-name {
|
||||||
|
min-width: 150px;
|
||||||
|
padding-right: 25px;
|
||||||
|
}
|
200
docs/cloverage/index.html
Normal file
200
docs/cloverage/index.html
Normal file
|
@ -0,0 +1,200 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="./coverage.css"/>
|
||||||
|
<title>Coverage Summary</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table>
|
||||||
|
<thead><tr>
|
||||||
|
<td class="ns-name"> Namespace </td>
|
||||||
|
<td class="with-bar"> Forms </td>
|
||||||
|
<td class="with-number">Forms %</td>
|
||||||
|
<td class="with-bar"> Lines </td>
|
||||||
|
<td class="with-number">Lines %</td>
|
||||||
|
<td class="with-number">Total</td><td class="with-number">Blank</td><td class="with-number">Instrumented</td>
|
||||||
|
</tr></thead>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/handler.clj.html">mw-ui.handler</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:48.68421052631579%;
|
||||||
|
float:left;"> 37 </div><div class="not-covered"
|
||||||
|
style="width:51.31578947368421%;
|
||||||
|
float:left;"> 39 </div></td>
|
||||||
|
<td class="with-number">48.68 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:81.25%;
|
||||||
|
float:left;"> 13 </div><div class="not-covered"
|
||||||
|
style="width:18.75%;
|
||||||
|
float:left;"> 3 </div></td>
|
||||||
|
<td class="with-number">81.25 %</td>
|
||||||
|
<td class="with-number">86</td><td class="with-number">10</td><td class="with-number">16</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/layout.clj.html">mw-ui.layout</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:87.03703703703704%;
|
||||||
|
float:left;"> 47 </div><div class="not-covered"
|
||||||
|
style="width:12.962962962962964%;
|
||||||
|
float:left;"> 7 </div></td>
|
||||||
|
<td class="with-number">87.04 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:75.0%;
|
||||||
|
float:left;"> 9 </div><div class="partial"
|
||||||
|
style="width:16.666666666666668%;
|
||||||
|
float:left;"> 2 </div><div class="not-covered"
|
||||||
|
style="width:8.333333333333334%;
|
||||||
|
float:left;"> 1 </div></td>
|
||||||
|
<td class="with-number">91.67 %</td>
|
||||||
|
<td class="with-number">51</td><td class="with-number">7</td><td class="with-number">12</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/middleware.clj.html">mw-ui.middleware</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:73.77049180327869%;
|
||||||
|
float:left;"> 45 </div><div class="not-covered"
|
||||||
|
style="width:26.229508196721312%;
|
||||||
|
float:left;"> 16 </div></td>
|
||||||
|
<td class="with-number">73.77 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:92.85714285714286%;
|
||||||
|
float:left;"> 13 </div><div class="partial"
|
||||||
|
style="width:7.142857142857143%;
|
||||||
|
float:left;"> 1 </div></td>
|
||||||
|
<td class="with-number">100.00 %</td>
|
||||||
|
<td class="with-number">52</td><td class="with-number">9</td><td class="with-number">14</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/render_world.clj.html">mw-ui.render-world</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:3.864734299516908%;
|
||||||
|
float:left;"> 8 </div><div class="not-covered"
|
||||||
|
style="width:96.13526570048309%;
|
||||||
|
float:left;"> 199 </div></td>
|
||||||
|
<td class="with-number">3.86 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:19.51219512195122%;
|
||||||
|
float:left;"> 8 </div><div class="not-covered"
|
||||||
|
style="width:80.48780487804878%;
|
||||||
|
float:left;"> 33 </div></td>
|
||||||
|
<td class="with-number">19.51 %</td>
|
||||||
|
<td class="with-number">104</td><td class="with-number">17</td><td class="with-number">41</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/repl.clj.html">mw-ui.repl</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:22.950819672131146%;
|
||||||
|
float:left;"> 14 </div><div class="not-covered"
|
||||||
|
style="width:77.04918032786885%;
|
||||||
|
float:left;"> 47 </div></td>
|
||||||
|
<td class="with-number">22.95 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:26.31578947368421%;
|
||||||
|
float:left;"> 5 </div><div class="partial"
|
||||||
|
style="width:5.2631578947368425%;
|
||||||
|
float:left;"> 1 </div><div class="not-covered"
|
||||||
|
style="width:68.42105263157895%;
|
||||||
|
float:left;"> 13 </div></td>
|
||||||
|
<td class="with-number">31.58 %</td>
|
||||||
|
<td class="with-number">66</td><td class="with-number">8</td><td class="with-number">19</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/routes/home.clj.html">mw-ui.routes.home</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:26.575342465753426%;
|
||||||
|
float:left;"> 97 </div><div class="not-covered"
|
||||||
|
style="width:73.42465753424658%;
|
||||||
|
float:left;"> 268 </div></td>
|
||||||
|
<td class="with-number">26.58 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:17.647058823529413%;
|
||||||
|
float:left;"> 12 </div><div class="partial"
|
||||||
|
style="width:20.58823529411765%;
|
||||||
|
float:left;"> 14 </div><div class="not-covered"
|
||||||
|
style="width:61.76470588235294%;
|
||||||
|
float:left;"> 42 </div></td>
|
||||||
|
<td class="with-number">38.24 %</td>
|
||||||
|
<td class="with-number">133</td><td class="with-number">12</td><td class="with-number">68</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/routes/load.clj.html">mw-ui.routes.load</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:4.918032786885246%;
|
||||||
|
float:left;"> 3 </div><div class="not-covered"
|
||||||
|
style="width:95.08196721311475%;
|
||||||
|
float:left;"> 58 </div></td>
|
||||||
|
<td class="with-number">4.92 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:17.647058823529413%;
|
||||||
|
float:left;"> 3 </div><div class="not-covered"
|
||||||
|
style="width:82.3529411764706%;
|
||||||
|
float:left;"> 14 </div></td>
|
||||||
|
<td class="with-number">17.65 %</td>
|
||||||
|
<td class="with-number">62</td><td class="with-number">9</td><td class="with-number">17</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/routes/params.clj.html">mw-ui.routes.params</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:2.027027027027027%;
|
||||||
|
float:left;"> 3 </div><div class="not-covered"
|
||||||
|
style="width:97.97297297297297%;
|
||||||
|
float:left;"> 145 </div></td>
|
||||||
|
<td class="with-number">2.03 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:8.823529411764707%;
|
||||||
|
float:left;"> 3 </div><div class="not-covered"
|
||||||
|
style="width:91.17647058823529%;
|
||||||
|
float:left;"> 31 </div></td>
|
||||||
|
<td class="with-number">8.82 %</td>
|
||||||
|
<td class="with-number">80</td><td class="with-number">5</td><td class="with-number">34</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/routes/rules.clj.html">mw-ui.routes.rules</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:31.57894736842105%;
|
||||||
|
float:left;"> 30 </div><div class="not-covered"
|
||||||
|
style="width:68.42105263157895%;
|
||||||
|
float:left;"> 65 </div></td>
|
||||||
|
<td class="with-number">31.58 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:41.666666666666664%;
|
||||||
|
float:left;"> 10 </div><div class="partial"
|
||||||
|
style="width:4.166666666666667%;
|
||||||
|
float:left;"> 1 </div><div class="not-covered"
|
||||||
|
style="width:54.166666666666664%;
|
||||||
|
float:left;"> 13 </div></td>
|
||||||
|
<td class="with-number">45.83 %</td>
|
||||||
|
<td class="with-number">72</td><td class="with-number">6</td><td class="with-number">24</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/routes/save.clj.html">mw-ui.routes.save</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:8.0%;
|
||||||
|
float:left;"> 2 </div><div class="not-covered"
|
||||||
|
style="width:92.0%;
|
||||||
|
float:left;"> 23 </div></td>
|
||||||
|
<td class="with-number">8.00 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:50.0%;
|
||||||
|
float:left;"> 2 </div><div class="not-covered"
|
||||||
|
style="width:50.0%;
|
||||||
|
float:left;"> 2 </div></td>
|
||||||
|
<td class="with-number">50.00 %</td>
|
||||||
|
<td class="with-number">41</td><td class="with-number">4</td><td class="with-number">4</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><a href="mw_ui/util.clj.html">mw-ui.util</a></td><td class="with-bar"><div class="covered"
|
||||||
|
style="width:18.354430379746834%;
|
||||||
|
float:left;"> 29 </div><div class="not-covered"
|
||||||
|
style="width:81.64556962025317%;
|
||||||
|
float:left;"> 129 </div></td>
|
||||||
|
<td class="with-number">18.35 %</td>
|
||||||
|
<td class="with-bar"><div class="covered"
|
||||||
|
style="width:35.8974358974359%;
|
||||||
|
float:left;"> 14 </div><div class="partial"
|
||||||
|
style="width:2.5641025641025643%;
|
||||||
|
float:left;"> 1 </div><div class="not-covered"
|
||||||
|
style="width:61.53846153846154%;
|
||||||
|
float:left;"> 24 </div></td>
|
||||||
|
<td class="with-number">38.46 %</td>
|
||||||
|
<td class="with-number">91</td><td class="with-number">10</td><td class="with-number">39</td>
|
||||||
|
</tr>
|
||||||
|
<tr><td>Totals:</td>
|
||||||
|
<td class="with-bar"></td>
|
||||||
|
<td class="with-number">24.03 %</td>
|
||||||
|
<td class="with-bar"></td>
|
||||||
|
<td class="with-number">38.89 %</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
266
docs/cloverage/mw_ui/handler.clj.html
Normal file
266
docs/cloverage/mw_ui/handler.clj.html
Normal file
|
@ -0,0 +1,266 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/handler.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "Set up and tear down the request handler."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.handler
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [compojure.core :refer [defroutes]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [mw-ui.routes.home :refer [home-routes]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [mw-ui.middleware :refer [load-middleware]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [noir.response :refer [redirect]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 [noir.util.middleware :refer [app-handler]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 [compojure.route :as route]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 [taoensso.timbre :as timbre]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ;; [taoensso.timbre.appenders.rotor :as rotor]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 [selmer.parser :as parser]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 [environ.core :refer [env]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
014
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
032 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
033 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
034 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
035 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
036 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
037
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
038 (defroutes app-routes
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
039 (route/resources "/")
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
040 (route/not-found "Not Found"))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
041
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
042
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
043 (defn init
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
044 "init will be called once when
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
045 app is deployed as a servlet on
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
046 an app server such as Tomcat
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
047 put any initialization code here"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
048 []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
049 ;; TODO fix timbre config!
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
050 ;; (timbre/set-config!
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
051 ;; [:appenders :rotor]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
052 ;; {:min-level :info
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
053 ;; :enabled? true
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
054 ;; :async? false ; should be always false for rotor
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
055 ;; :max-message-per-msecs nil
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
056 ;; :fn rotor/appender-fn})
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
057 ;; (timbre/set-config!
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
058 ;; [:shared-appender-config :rotor]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
059 ;; {:path "mw_ui.log" :max-size (* 512 1024) :backlog 10})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
060
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
061
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 7 forms covered">
|
||||||
|
062 (when (env :dev) (parser/cache-off!))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 16 forms covered">
|
||||||
|
063 (timbre/info "mw-ui started successfully"))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
064
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
065
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
066 (defn destroy
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
067 "destroy will be called when your application
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
068 shuts down, put any clean up code here"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
069 []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 16 forms covered">
|
||||||
|
070 (timbre/info "mw-ui is shutting down..."))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
071
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
072
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="7 out of 7 forms covered">
|
||||||
|
073 (def app (app-handler
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
074 ;; add your application routes here
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
075 [home-routes app-routes]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
076 ;; add custom middleware here
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
077 :middleware (load-middleware)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
078 ;; timeout sessions after 30 minutes
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="6 out of 6 forms covered">
|
||||||
|
079 :session-options {:timeout (* 60 30)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
080 :timeout-response (redirect "/")}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
081 ;; add access rules here
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
082 :access-rules []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
083 ;; serialize/deserialize the following data formats
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
084 ;; available formats:
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
085 ;; :json :json-kw :yaml :yaml-kw :edn :yaml-in-html
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
086 :formats [:json-kw :edn]))
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
161
docs/cloverage/mw_ui/layout.clj.html
Normal file
161
docs/cloverage/mw_ui/layout.clj.html
Normal file
|
@ -0,0 +1,161 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/layout.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "Layout content as HTML."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.layout
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [selmer.parser :as parser]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [clojure.string :as s]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [ring.util.response :refer [content-type response]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [compojure.response :refer [Renderable]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
008
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
031
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
032
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
033 (def template-path "templates/")
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
034
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 8 forms covered">
|
||||||
|
035 (deftype RenderableTemplate [template params]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
036 Renderable
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
037 (render [_ request]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
038 (content-type
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="12 out of 12 forms covered">
|
||||||
|
039 (->> (assoc (merge params {:version (System/getProperty "mw-ui.version")})
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="7 out of 7 forms covered">
|
||||||
|
040 (keyword (s/replace template #".html" "-selected")) "active"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
041 :servlet-context
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="6 out of 9 forms covered">
|
||||||
|
042 (when-let [context (:servlet-context request)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
043 (.getContextPath context)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="6 out of 6 forms covered">
|
||||||
|
044 (parser/render-file (str template-path template))
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
045 response)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
046 "text/html; charset=utf-8")))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
047
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
048
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
049 (defn render [template & [params]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
050 (RenderableTemplate. template params))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
051
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
164
docs/cloverage/mw_ui/middleware.clj.html
Normal file
164
docs/cloverage/mw_ui/middleware.clj.html
Normal file
|
@ -0,0 +1,164 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/middleware.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "In truth, boilerplate from Luminus."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.middleware
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [taoensso.timbre :as timbre]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [environ.core :refer [env]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [selmer.middleware :refer [wrap-error-page]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [noir-exception.core
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 :refer [wrap-internal-error wrap-exceptions]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
009
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
032
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
033
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
034 (defn log-request [handler]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
035 (fn [req]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="16 out of 16 forms covered">
|
||||||
|
036 (timbre/debug req)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
037 (handler req)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
038
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
039
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
040 (def development-middleware
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
041 [log-request
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
042 wrap-error-page
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
043 wrap-exceptions])
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
044
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
045
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
046 (def production-middleware
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="7 out of 23 forms covered">
|
||||||
|
047 [#(wrap-internal-error % :log (fn [e] (timbre/error e)))])
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
048
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
049
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
050 (defn load-middleware []
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="8 out of 8 forms covered">
|
||||||
|
051 (concat (when (env :dev) development-middleware)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
052 production-middleware))
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
320
docs/cloverage/mw_ui/render_world.clj.html
Normal file
320
docs/cloverage/mw_ui/render_world.clj.html
Normal file
|
@ -0,0 +1,320 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/render_world.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "Render the state of the world as an HTML table."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.render-world
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [mw-engine.core :as engine]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [mw-engine.heightmap :as heightmap]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [mw-parser.bulk :as compiler]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [noir.io :as io]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 [noir.session :as session]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
009
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
032
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
033
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
034 (defn format-css-class
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
035 "Format this statekey, assumed to be a keyword indicating a state in the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
036 world, into a CSS class"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
037 [statekey]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
038 (subs (str statekey) 1))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
039
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
040
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
041 (defn format-image-path
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
042 "Render this statekey, assumed to be a keyword indicating a state in the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
043 world, into a path which should recover the corresponding image file."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
044 [statekey]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
045 (format "img/tiles/%s.png" (format-css-class statekey)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
046
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
047
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
048 (defn format-mouseover [cell]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
049 (str cell))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
050
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
051
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
052 (defn render-cell
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
053 "Render this world cell as a Hiccup table cell."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
054 [cell]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
055 (let [state (:state cell)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 11 forms covered">
|
||||||
|
056 [:td {:class (format-css-class state) :title (format-mouseover cell)}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 13 forms covered">
|
||||||
|
057 [:a {:href (format "inspect?x=%d&y=%d" (:x cell) (:y cell))}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 11 forms covered">
|
||||||
|
058 [:img {:alt (:state cell) :src (format-image-path state)}]]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
059
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
060
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
061 (defn render-world-row
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
062 "Render this world row as a Hiccup table row."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
063 [row]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 10 forms covered">
|
||||||
|
064 (apply vector (cons :tr (map render-cell row))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
065
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
066
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
067 (defn render-world-table
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
068 "Render the world implied by the current session as a complete HTML table in a DIV."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
069 []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 9 forms covered">
|
||||||
|
070 (let [world (or (session/get :world)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
071 (heightmap/apply-heightmap
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
072 (io/get-resource "/img/heightmaps/small_hill.png")))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
073 rules (or (session/get :rules)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
074 (do (session/put! :rules
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
075 (compiler/compile-file
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
076 (io/get-resource "/rulesets/basic.txt")))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
077 (session/get :rules)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 9 forms covered">
|
||||||
|
078 generation (inc (or (session/get :generation) 0))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
079 w2 (engine/transform-world world rules)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
080 ]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
081 (session/put! :world w2)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
082 (session/put! :generation generation)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
083 [:div {:class "world"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
084 (apply vector
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
085 (cons :table
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
086 (map render-world-row w2)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
087 [:p
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
088 (str "Generation " generation)]]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
089
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
090
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
091 (defn render-inspector
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
092 "Render in Hiccup format the HTML content of an inspector on this cell."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
093 ([cell _] (render-inspector cell))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
094 ([cell]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
095 [:table {:class "music-ruled"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
096 [:tr
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 7 forms covered">
|
||||||
|
097 [:td {:colspan 2 :style "text-align: center;"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 17 forms covered">
|
||||||
|
098 [:img {:src (str "img/tiles/" (name (:state cell)) ".png")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
099 :width 64
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
100 :height 64}]]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
101 [:tr [:th "Key"][:th "Value"]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 19 forms covered">
|
||||||
|
102 (map #(vector :tr (vector :th %)(vector :td (cell %))) (keys cell))]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
103
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
104
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
206
docs/cloverage/mw_ui/repl.clj.html
Normal file
206
docs/cloverage/mw_ui/repl.clj.html
Normal file
|
@ -0,0 +1,206 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/repl.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "In truth, boilerplate from Luminus."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.repl
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [mw-ui.handler :as handler]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [ring.server.standalone :refer [serve]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [ring.middleware.file :refer [wrap-file]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [ring.middleware.file-info :refer [wrap-file-info]])
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 (:gen-class))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
009
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
032
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
033
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="9 out of 10 forms covered">
|
||||||
|
034 (defonce server (atom nil))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
035
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
036 (defn get-handler []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
037 ;; #'app expands to (var app) so that when we reload our code,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
038 ;; the server is forced to re-resolve the symbol in the var
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
039 ;; rather than having its own copy. When the root binding
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
040 ;; changes, the server picks it up without having to restart.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
041 (-> #'handler/app
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
042 ; Makes static assets in $PROJECT_DIR/resources/public/ available.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
043 (wrap-file "resources")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
044 ; Content-Type, Content-Length, and Last Modified headers for files in body
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
045 (wrap-file-info)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
046
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
047 (defn start-server
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
048 "used for starting the server in development mode from REPL"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
049 [& [port]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
050 (let [port (if port (Integer/parseInt port) 3000)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
051 (reset! server
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
052 (serve (get-handler)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 9 forms covered">
|
||||||
|
053 {:port port
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
054 :init handler/init
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
055 :auto-reload? true
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
056 :destroy handler/destroy
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
057 :join? false}))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
058 (println (str "You can view the site at http://localhost:" port))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
059
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
060 (defn stop-server []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
061 (.stop @server)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
062 (reset! server nil))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
063
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
064 (defn -main []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
065 (start-server))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
066
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
407
docs/cloverage/mw_ui/routes/home.clj.html
Normal file
407
docs/cloverage/mw_ui/routes/home.clj.html
Normal file
|
@ -0,0 +1,407 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/home.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "Routes which serve the main pages of the application."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.routes.home
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [clojure.java.io :refer [file]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [clojure.walk :refer [keywordize-keys]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [compojure.core :refer [defroutes GET POST]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [hiccup.core :refer [html]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 [mw-engine.utils :as engine-utils]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 [mw-ui.layout :as layout]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 [mw-ui.render-world :as world]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 [mw-ui.routes.load :as load]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 [mw-ui.routes.rules :as rules]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 [mw-ui.routes.params :as params]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 [mw-ui.routes.save :as save]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 [mw-ui.util :as util]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 [noir.session :as session]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 [ring.util.response :as response]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
018
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
032 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
033 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
034 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
035 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
036 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
037 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
038 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
039 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
040 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
041
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
042
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
043 (defn list-states []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
044 (sort
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
045 (filter #(not (nil? %))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 11 forms covered">
|
||||||
|
046 (map #(first (rest (re-matches #"([0-9a-z-]+).png" (.getName %))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
047 ;; TODO: this will not work when running from jar; see utils.clj
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
048 (file-seq (file "resources/public/img/tiles"))))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
049
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
050
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
051 (defn about-page []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
052 (layout/render "trusted-content.html"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 7 forms covered">
|
||||||
|
053 {:title "About MicroWorld"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
054 :about-selected "active"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
055 :content (util/md->html "/md/about.md")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
056 :version (System/getProperty "mw-ui.version")}))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
057
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
058 (defn docs-page []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 11 forms covered">
|
||||||
|
059 (layout/render "docs.html" {:title "Documentation"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
060 :parser (util/md->html "/md/mw-parser.md" )
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
061 :states (util/list-resources "/img/tiles" #"([0-9a-z-_]+).png")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
062 :lessons (util/list-resources "/md/lesson-plans" #"([0-9a-z-_]+).md")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
063 :components ["mw-engine" "mw-parser" "mw-ui"]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
064 :version (System/getProperty "mw-ui.version")}))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
065
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
066 (defn home-page
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
067 "Render the home page."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
068 []
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="8 out of 8 forms covered">
|
||||||
|
069 (layout/render "trusted-content.html" {:title "Welcome to MicroWorld"
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
070 :content (util/md->html "/md/mw-ui.md")
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
071 :version (System/getProperty "mw-ui.version")}))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
072
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
073 (defn inspect-page
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
074 "Open an inspector on the cell at the co-ordinates specified in this request"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
075 [request]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
076 (let [params (keywordize-keys (:params request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
077 xs (:x params)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
078 ys (:y params)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
079 x (if (seq xs) (read-string xs) 0)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
080 y (if (seq ys) (read-string ys) 0)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
081 world (session/get :world)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
082 cell (engine-utils/get-cell world x y)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
083 state (:state params)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
084 (cond state
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
085 (do
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 11 forms covered">
|
||||||
|
086 (session/put! :world (engine-utils/set-property world cell :state (keyword state)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
087 (response/redirect "world"))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
088 true
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
089 (layout/render "inspector.html"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 12 forms covered">
|
||||||
|
090 {:title (format "Inspect cell at %d, %d" x y)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 7 forms covered">
|
||||||
|
091 :content (html (world/render-inspector cell))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
092 :cell cell
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
093 :x (:x cell)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
094 :y (:y cell)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
095 :states (util/list-resources
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
096 "/img/tiles" #"([0-9a-z-_]+).png")}))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
097
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
098 (defn md-page
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
099 "Render the markdown page specified in this request, if any. Probably undesirable,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
100 should be removed."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
101 [request]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
102 (let [params (keywordize-keys (:params request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
103 content (or (:content params) "missing.md")]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
104 (layout/render "trusted-content.html"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
105 {:title "Welcome to MicroWorld"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
106 :content (util/md->html (str "/md/" content))})))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
107
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="1 out of 2 forms covered">
|
||||||
|
108 (defn world-page []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
109 "Render the world in the current session (or a default one if none)."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
110 (layout/render "trusted-content.html"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 9 forms covered">
|
||||||
|
111 {:title "Watch your world grow"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
112 :world-selected "active"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
113 :content (html (world/render-world-table))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
114 :pause (or (session/get :pause) 5)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
115 :maybe-refresh "refresh"}))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
116
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
117
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
118 (defroutes home-routes
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="8 out of 8 forms covered">
|
||||||
|
119 (GET "/" [] (home-page))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 8 forms covered">
|
||||||
|
120 (GET "/about" [] (about-page))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 8 forms covered">
|
||||||
|
121 (GET "/docs" [] (docs-page))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 10 forms covered">
|
||||||
|
122 (GET "/inspect" request (inspect-page request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 10 forms covered">
|
||||||
|
123 (POST "/inspect" request (inspect-page request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 8 forms covered">
|
||||||
|
124 (GET "/load" [] (load/load-page))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 10 forms covered">
|
||||||
|
125 (POST "/load" request (load/load-page request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 10 forms covered">
|
||||||
|
126 (GET "/md" request (md-page request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 8 forms covered">
|
||||||
|
127 (GET "/params" [] (params/params-page))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 10 forms covered">
|
||||||
|
128 (POST "/params" request (params/params-page request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 10 forms covered">
|
||||||
|
129 (GET "/rules" request (rules/rules-page request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 10 forms covered">
|
||||||
|
130 (POST "/rules" request (rules/rules-page request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 8 forms covered">
|
||||||
|
131 (GET "/saved-map.mwm" [] (save/save-page))
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="5 out of 8 forms covered">
|
||||||
|
132 (GET "/world" [] (world-page))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
133 )
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
194
docs/cloverage/mw_ui/routes/load.clj.html
Normal file
194
docs/cloverage/mw_ui/routes/load.clj.html
Normal file
|
@ -0,0 +1,194 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/load.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "Route which handles the upload of worlds/rules from the client."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.routes.load
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [clojure.walk :refer [keywordize-keys]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [noir.io :as io]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [noir.session :as session]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [mw-ui.layout :as layout]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
008
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
031
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
032
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
033 (defn- upload [file]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
034 (io/upload-file "/tmp/" file)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
035 (cond
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
036 (session/put! :world
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 10 forms covered">
|
||||||
|
037 (with-open [_ (java.io.FileReader. (:tempfile file))] (read)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
038 (str "Successfully loaded your world from " (:filename file))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
039
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
040
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
041 (defn load-page
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
042 "If no args, show the load form; with args, load a world file from the client.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
043
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
044 *NOTE* that this reads a Clojure form from an untrusted client and should almost
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
045 certainly NOT be enabled on a public-facing site, especially not on the Internet.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
046
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
047 *TODO* doesn't work yet."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
048 ([]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
049 (load-page nil))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
050 ([request]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
051 (let [file (:file request)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
052 (try
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
053 (layout/render "load.html"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
054 {:title "Load World"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
055 :message (upload file)})
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
056
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
057 (catch Exception any
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
058 (layout/render "load.html"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
059 {:title "Load World"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
060 :message "Failed to load your world"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
061 :error (str (.getName (.getClass any)) ": " (.getMessage any))}))))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
062
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
248
docs/cloverage/mw_ui/routes/params.clj.html
Normal file
248
docs/cloverage/mw_ui/routes/params.clj.html
Normal file
|
@ -0,0 +1,248 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/params.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "Route which serves and handles the parameters page."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.routes.params
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [clojure.walk :refer [keywordize-keys]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [mw-engine.heightmap :as heightmap]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [mw-parser.bulk :as compiler]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [mw-ui.layout :as layout]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 [mw-ui.util :as util]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 [noir.io :as io]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 [noir.session :as session]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
011
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
032 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
033 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
034
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
035
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
036 (defn- send-params []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
037 {:title "Choose your world"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
038 :heightmaps (util/list-resources "/img/heightmaps" #"/?([0-9a-z-_]+).png")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
039 :pause (or (session/get :pause) 5)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
040 :rulesets (util/list-resources "/rulesets" #"/?([0-9a-z-_]+).txt")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
041 })
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
042
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
043
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
044 (defn params-page
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
045 "Handler for params request. If no `request` passed, show empty params form.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
046 If `request` is passed, put parameters from request into session and show
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
047 the world page."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
048 ([]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
049 (layout/render "params.html" (send-params)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
050 ([request]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
051 (try
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
052 (let [params (keywordize-keys (:form-params request))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
053 map (:heightmap params)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
054 pause (:pause params)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
055 rulefile (:ruleset params)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
056 rulepath (str "/rulesets/" rulefile ".txt")]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
057 (when (not= map "")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
058 (session/put! :world
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
059 (heightmap/apply-heightmap
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 7 forms covered">
|
||||||
|
060 (io/get-resource (str "/img/heightmaps/" map ".png")))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
061 (when (not= rulefile "")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
062 (session/put! :rule-text (io/slurp-resource rulepath))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
063 (session/put! :rules (compiler/compile-file (io/get-resource rulepath))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
064 (when (not= pause "")
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
065 (session/put! :pause pause))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
066 (layout/render "params.html"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
067 (merge (send-params)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
068 {:r rulefile
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
069 :h map
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
070 :message "Your parameters are saved, now look at your world"})))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
071 (catch Exception e
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
072 (let [params (keywordize-keys (:form-params request))]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
073 (layout/render "params.html"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
074 (merge (send-params)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
075 {:title "Choose your world"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
076 :r (:ruleset params)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
077 :h (:heightmap params)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
078 :message "Your paramters are not saved"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 8 forms covered">
|
||||||
|
079 :error (str (.getName (.getClass e)) ": " (.getMessage e) "; " params)}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
080 )))))))
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
224
docs/cloverage/mw_ui/routes/rules.clj.html
Normal file
224
docs/cloverage/mw_ui/routes/rules.clj.html
Normal file
|
@ -0,0 +1,224 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/rules.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "Route which serves and handles the rules page."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.routes.rules
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [clojure.walk :refer [keywordize-keys]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [mw-parser.bulk :as compiler]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [mw-ui.layout :as layout]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [noir.io :as io]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 [noir.session :as session]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
009
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
032
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
033
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
034 (defn process-rules-request
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
035 [request]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="8 out of 8 forms covered">
|
||||||
|
036 (let [src (:src (keywordize-keys (:form-params request)))]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
037 (try
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="2 out of 3 forms covered">
|
||||||
|
038 (cond src
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="4 out of 4 forms covered">
|
||||||
|
039 (let [rules (compiler/compile-string src)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="5 out of 5 forms covered">
|
||||||
|
040 {:rule-text src
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
041 :rules rules
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="4 out of 4 forms covered">
|
||||||
|
042 :message (str "Successfully compiled "
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
043 (count rules)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
044 " rules") })
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 10 forms covered">
|
||||||
|
045 :else {:rule-text (or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
046 (session/get :rule-text)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
047 (io/slurp-resource "/rulesets/basic.txt"))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
048 :message "No rules found in request; loading defaults"})
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
049 (catch Exception e
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
050 {:rule-text src
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
051 :message "An error occurred during compilation"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
052 :error (str (.getName (.getClass e)) ": " (.getMessage e))}))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
053
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
054
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
055 (defn rules-page
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
056 "Request handler for the `rules` request. If the `request` contains a value
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
057 for `:src`, treat that as rule source and try to compile it. If compilation
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
058 succeeds, stash the compiled rules and the rule text on the session, and
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
059 provide feedback; if not, provide feedback.
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
060
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
061 If `request` doesn't contain a value for `:src`, load basic rule source from
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
062 the session or from `resources/rulesets/basic.txt` and pass that back."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
063 ([request]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
064 (let [processed (process-rules-request request)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
065 (when (:rules processed)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
066 (session/put! :rules (:rules processed)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
067 (when (:rule-text processed)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
068 (session/put! :rule-text (:rule-text processed)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
069 (layout/render "rules.html"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
070 (merge {:title "Edit Rules"} processed))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
071 ([]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
072 (rules-page nil)))
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
131
docs/cloverage/mw_ui/routes/save.clj.html
Normal file
131
docs/cloverage/mw_ui/routes/save.clj.html
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../../coverage.css"/> <title> mw_ui/routes/save.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "Route which handles the saving of world state the client."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.routes.save
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [clojure.pprint :refer [pprint]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [noir.session :as session]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [noir.response :as response]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
007
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
010 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
030
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
031
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
032 (defn save-page
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
033 "Save the current world to the browser, using our own custom mime-type in
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
034 an attempt to prevent the browser trying to do anything clever with it.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
035 Note that it is saved as a raw Clojure data structure, not as XML or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
036 any proprietary format."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
037 []
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
038 (response/content-type
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
039 "application/journeyman-mwm; charset=utf-8"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 20 forms covered">
|
||||||
|
040 (with-out-str (pprint (session/get :world)))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
041
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
281
docs/cloverage/mw_ui/util.clj.html
Normal file
281
docs/cloverage/mw_ui/util.clj.html
Normal file
|
@ -0,0 +1,281 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../coverage.css"/> <title> mw_ui/util.clj </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
001 (ns ^{:doc "Utility functions used by other namespaces in this package."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
002 :author "Simon Brooke"}
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
003 mw-ui.util
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
004 (:require [clojure.java.io :refer [file]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
005 [clojure.string :refer [starts-with?]]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
006 [markdown.core :as md]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
007 [noir.io :as io]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
008 [noir.session :as session]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
009 [taoensso.timbre :as timbre]))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
010
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
011 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
012 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
013 ;;;; mw-ui: a servlet user/visualisation interface for MicroWorld.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
014 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
015 ;;;; This program is free software; you can redistribute it and/or
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
016 ;;;; modify it under the terms of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
017 ;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
018 ;;;; of the License, or (at your option) any later version.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
019 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
020 ;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
021 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
022 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
023 ;;;; GNU General Public License for more details.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
024 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
025 ;;;; You should have received a copy of the GNU General Public License
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
026 ;;;; along with this program; if not, write to the Free Software
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
027 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
028 ;;;; USA.
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
029 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
030 ;;;; Copyright (C) 2014 Simon Brooke
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
031 ;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
032 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
033
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
034 (def running-from-filesystem
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
035 "We assume we're running from the filesystem unless we find we're not."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
036 (atom true))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
037
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
038
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
039 (def compile-time-resources
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
040 "The resources which were visible at compile time. If we are running from
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
041 a JAR file, it is highly likely that these are all the resources available
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
042 at run time."
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="4 out of 4 forms covered">
|
||||||
|
043 (let [f (file "resources/public")
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="2 out of 2 forms covered">
|
||||||
|
044 n (count (.getCanonicalPath f))]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
045 (remove nil?
|
||||||
|
</span><br/>
|
||||||
|
<span class="partial" title="3 out of 5 forms covered">
|
||||||
|
046 (map #(let [s (.getCanonicalPath %)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
047 (when (> (count s) n)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
048 (subs s n)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
049 (file-seq f)))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
050
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
051
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
052 (defn md->html
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
053 "reads a markdown file from public/md and returns an HTML string"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
054 [filename]
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
055 (->>
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="3 out of 3 forms covered">
|
||||||
|
056 (io/slurp-resource filename)
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
057 (md/md-to-html-string)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
058
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
059
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
060 (defn cache-seq-match
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
061 "Do the same processing that list-resources does on names fetched from
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
062 the file system, except on the resource list cached at compile time."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
063 [path pattern]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 16 forms covered">
|
||||||
|
064 (timbre/info compile-time-resources)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
065 (let [n (count path)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
066 (remove nil?
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 9 forms covered">
|
||||||
|
067 (map #(when (> (count %) n)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
068 (let [name (subs % n)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 6 forms covered">
|
||||||
|
069 (last (re-matches pattern name))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 7 forms covered">
|
||||||
|
070 (filter #(starts-with? % path)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
071 compile-time-resources)))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
072
|
||||||
|
</span><br/>
|
||||||
|
<span class="blank" title="0 out of 0 forms covered">
|
||||||
|
073
|
||||||
|
</span><br/>
|
||||||
|
<span class="covered" title="1 out of 1 forms covered">
|
||||||
|
074 (defn list-resources
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
075 "List resource files matching `pattern` in `directory`."
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
076 [directory pattern]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
077 (let
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
078 [path (str (io/resource-path) directory)]
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
079 (session/put! :list-resources-path path)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 1 forms covered">
|
||||||
|
080 (try
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
081 (sort
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 3 forms covered">
|
||||||
|
082 (remove nil?
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
083 (if @running-from-filesystem
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 11 forms covered">
|
||||||
|
084 (map #(first (rest (re-matches pattern (.getName %))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 5 forms covered">
|
||||||
|
085 (file-seq (file path)))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
086 (cache-seq-match directory pattern))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||||
|
087 (catch Exception any
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 17 forms covered">
|
||||||
|
088 (timbre/log (str "Not running from filesystem?"
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 2 forms covered">
|
||||||
|
089 (.getName (.getClass any))))
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
090 (reset! running-from-filesystem false)
|
||||||
|
</span><br/>
|
||||||
|
<span class="not-covered" title="0 out of 4 forms covered">
|
||||||
|
091 (cache-seq-match directory pattern)))))
|
||||||
|
</span><br/>
|
||||||
|
</body>
|
||||||
|
</html>
|
551
docs/codox/css/default.css
Normal file
551
docs/codox/css/default.css
Normal file
|
@ -0,0 +1,551 @@
|
||||||
|
body {
|
||||||
|
font-family: Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre, code {
|
||||||
|
font-family: Monaco, DejaVu Sans Mono, Consolas, monospace;
|
||||||
|
font-size: 9pt;
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 29px;
|
||||||
|
margin: 10px 0 2px 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5.license {
|
||||||
|
margin: 9px 0 22px 0;
|
||||||
|
color: #555;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.document h1, .namespace-index h1 {
|
||||||
|
font-size: 32px;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header, #content, .sidebar {
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 22px;
|
||||||
|
color: #f5f5f5;
|
||||||
|
padding: 5px 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
top: 32px;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: auto;
|
||||||
|
background: #fff;
|
||||||
|
color: #333;
|
||||||
|
padding: 0 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
position: fixed;
|
||||||
|
top: 32px;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.primary {
|
||||||
|
background: #e2e2e2;
|
||||||
|
border-right: solid 1px #cccccc;
|
||||||
|
left: 0;
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.secondary {
|
||||||
|
background: #f2f2f2;
|
||||||
|
border-right: solid 1px #d7d7d7;
|
||||||
|
left: 251px;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content.namespace-index, #content.document {
|
||||||
|
left: 251px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content.namespace-docs {
|
||||||
|
left: 452px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content.document {
|
||||||
|
padding-bottom: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
background: #3f3f3f;
|
||||||
|
box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header h1 {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: lighter;
|
||||||
|
text-shadow: -1px -1px 0px #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header h1 .project-version {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-version {
|
||||||
|
padding-left: 0.15em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header a, .sidebar a {
|
||||||
|
display: block;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header a {
|
||||||
|
color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar a {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header h2 {
|
||||||
|
float: right;
|
||||||
|
font-size: 9pt;
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 4px 3px;
|
||||||
|
padding: 0;
|
||||||
|
color: #bbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header h2 a {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar h3 {
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 13px 0 13px;
|
||||||
|
font-size: 19px;
|
||||||
|
font-weight: lighter;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar h3 a {
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar h3.no-link {
|
||||||
|
color: #636363;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar ul {
|
||||||
|
padding: 7px 0 6px 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar ul.index-link {
|
||||||
|
padding-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li {
|
||||||
|
display: block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li a, .sidebar li .no-link {
|
||||||
|
border-left: 3px solid transparent;
|
||||||
|
padding: 0 10px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .no-link {
|
||||||
|
display: block;
|
||||||
|
color: #777;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .inner {
|
||||||
|
display: inline-block;
|
||||||
|
padding-top: 7px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li a, .sidebar li .tree {
|
||||||
|
height: 31px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.depth-1 .inner { padding-left: 2px; }
|
||||||
|
.depth-2 .inner { padding-left: 6px; }
|
||||||
|
.depth-3 .inner { padding-left: 20px; }
|
||||||
|
.depth-4 .inner { padding-left: 34px; }
|
||||||
|
.depth-5 .inner { padding-left: 48px; }
|
||||||
|
.depth-6 .inner { padding-left: 62px; }
|
||||||
|
|
||||||
|
.sidebar li .tree {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
position: relative;
|
||||||
|
top: -10px;
|
||||||
|
margin: 0 4px 0 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li.depth-1 .tree {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .tree .top, .sidebar li .tree .bottom {
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
width: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .tree .top {
|
||||||
|
border-left: 1px solid #aaa;
|
||||||
|
border-bottom: 1px solid #aaa;
|
||||||
|
height: 19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .tree .bottom {
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li.branch .tree .bottom {
|
||||||
|
border-left: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.primary li.current a {
|
||||||
|
border-left: 3px solid #a33;
|
||||||
|
color: #a33;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.secondary li.current a {
|
||||||
|
border-left: 3px solid #33a;
|
||||||
|
color: #33a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index h2 {
|
||||||
|
margin: 30px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index h3 {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index .topics {
|
||||||
|
padding-left: 30px;
|
||||||
|
margin: 11px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index .topics li {
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-docs h3 {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public h3 {
|
||||||
|
margin: 0;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.usage {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public {
|
||||||
|
margin: 0;
|
||||||
|
border-top: 1px solid #e0e0e0;
|
||||||
|
padding-top: 14px;
|
||||||
|
padding-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public:last-child {
|
||||||
|
margin-bottom: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members .public:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members {
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members h4 {
|
||||||
|
color: #555;
|
||||||
|
font-weight: normal;
|
||||||
|
font-variant: small-caps;
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members .inner {
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-left: 12px;
|
||||||
|
margin-top: 2px;
|
||||||
|
margin-left: 7px;
|
||||||
|
border-left: 1px solid #bbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content .members .inner h3 {
|
||||||
|
font-size: 12pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members .public {
|
||||||
|
border-top: none;
|
||||||
|
margin-top: 0;
|
||||||
|
padding-top: 6px;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members .public:first-child {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.type,
|
||||||
|
h4.dynamic,
|
||||||
|
h4.added,
|
||||||
|
h4.deprecated {
|
||||||
|
float: left;
|
||||||
|
margin: 3px 10px 15px 0;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-variant: small-caps;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public h4.type,
|
||||||
|
.public h4.dynamic,
|
||||||
|
.public h4.added,
|
||||||
|
.public h4.deprecated {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 3px 0 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members h4.type,
|
||||||
|
.members h4.added,
|
||||||
|
.members h4.deprecated {
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.type {
|
||||||
|
color: #717171;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.dynamic {
|
||||||
|
color: #9933aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.added {
|
||||||
|
color: #508820;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.deprecated {
|
||||||
|
color: #880000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace:last-child {
|
||||||
|
margin-bottom: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index {
|
||||||
|
padding: 0;
|
||||||
|
font-size: 80%;
|
||||||
|
margin: 15px 0;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index * {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index p {
|
||||||
|
padding-right: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index li {
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index ul {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.type-sig {
|
||||||
|
clear: both;
|
||||||
|
color: #088;
|
||||||
|
}
|
||||||
|
|
||||||
|
.type-sig pre {
|
||||||
|
padding-top: 10px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.usage code {
|
||||||
|
display: block;
|
||||||
|
color: #008;
|
||||||
|
margin: 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.usage code:first-child {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public p:first-child, .public pre.plaintext {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc {
|
||||||
|
margin: 0 0 26px 0;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public .doc {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index .doc {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index .namespace .doc {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown p, .markdown li, .markdown dt, .markdown dd, .markdown td {
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown li {
|
||||||
|
padding: 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown h2 {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 25px;
|
||||||
|
margin: 30px 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown h3 {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 20px;
|
||||||
|
margin: 30px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown h4 {
|
||||||
|
font-size: 15px;
|
||||||
|
margin: 22px 0 -4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc, .public, .namespace .index {
|
||||||
|
max-width: 680px;
|
||||||
|
overflow-x: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown pre > code {
|
||||||
|
display: block;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown pre > code, .src-link a {
|
||||||
|
border: 1px solid #e4e4e4;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown code:not(.hljs), .src-link a {
|
||||||
|
background: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.deps {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px;
|
||||||
|
border: 1px solid #e4e4e4;
|
||||||
|
border-radius: 2px;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown hr {
|
||||||
|
border-style: solid;
|
||||||
|
border-top: none;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc ul, .doc ol {
|
||||||
|
padding-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc table td, .doc table th {
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
padding: 4px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc table th {
|
||||||
|
background: #f2f2f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc dl {
|
||||||
|
margin: 0 10px 20px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc dl dt {
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0;
|
||||||
|
padding: 3px 0;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc dl dd {
|
||||||
|
padding: 5px 0;
|
||||||
|
margin: 0 0 5px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc abbr {
|
||||||
|
border-bottom: 1px dotted #333;
|
||||||
|
font-variant: none;
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-link {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-link a {
|
||||||
|
font-size: 70%;
|
||||||
|
padding: 1px 4px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: #5555bb;
|
||||||
|
}
|
97
docs/codox/css/highlight.css
Normal file
97
docs/codox/css/highlight.css
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
/*
|
||||||
|
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
.hljs {
|
||||||
|
display: block;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding: 0.5em;
|
||||||
|
color: #333;
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-comment,
|
||||||
|
.hljs-quote {
|
||||||
|
color: #998;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-keyword,
|
||||||
|
.hljs-selector-tag,
|
||||||
|
.hljs-subst {
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-number,
|
||||||
|
.hljs-literal,
|
||||||
|
.hljs-variable,
|
||||||
|
.hljs-template-variable,
|
||||||
|
.hljs-tag .hljs-attr {
|
||||||
|
color: #008080;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-string,
|
||||||
|
.hljs-doctag {
|
||||||
|
color: #d14;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-title,
|
||||||
|
.hljs-section,
|
||||||
|
.hljs-selector-id {
|
||||||
|
color: #900;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-subst {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-type,
|
||||||
|
.hljs-class .hljs-title {
|
||||||
|
color: #458;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-tag,
|
||||||
|
.hljs-name,
|
||||||
|
.hljs-attribute {
|
||||||
|
color: #000080;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-regexp,
|
||||||
|
.hljs-link {
|
||||||
|
color: #009926;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-symbol,
|
||||||
|
.hljs-bullet {
|
||||||
|
color: #990073;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-built_in,
|
||||||
|
.hljs-builtin-name {
|
||||||
|
color: #0086b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-meta {
|
||||||
|
color: #999;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-deletion {
|
||||||
|
background: #fdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-addition {
|
||||||
|
background: #dfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-emphasis {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
14
docs/codox/index.html
Normal file
14
docs/codox/index.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>Mw-ui 0.2.0-SNAPSHOT</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 current"><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="namespace-index" id="content"><h1><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></h1><div class="doc"><p>Web-based user interface for MicroWorld.</p></div><h2>Installation</h2><p>To install, add the following dependency to your project or build file:</p><pre class="deps">[mw-ui "0.2.0-SNAPSHOT"]</pre><h2>Namespaces</h2><div class="namespace"><h3><a href="mw-ui.handler.html">mw-ui.handler</a></h3><div class="doc"><div class="markdown"><p>Set up and tear down the request handler.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.handler.html#var-app">app</a> </li><li> <a href="mw-ui.handler.html#var-app-routes">app-routes</a> </li><li> <a href="mw-ui.handler.html#var-destroy">destroy</a> </li><li> <a href="mw-ui.handler.html#var-init">init</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.layout.html">mw-ui.layout</a></h3><div class="doc"><div class="markdown"><p>Layout content as HTML.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.layout.html#var-render">render</a> </li><li> <a href="mw-ui.layout.html#var-template-path">template-path</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.middleware.html">mw-ui.middleware</a></h3><div class="doc"><div class="markdown"><p>In truth, boilerplate from Luminus.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.middleware.html#var-development-middleware">development-middleware</a> </li><li> <a href="mw-ui.middleware.html#var-load-middleware">load-middleware</a> </li><li> <a href="mw-ui.middleware.html#var-log-request">log-request</a> </li><li> <a href="mw-ui.middleware.html#var-production-middleware">production-middleware</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.render-world.html">mw-ui.render-world</a></h3><div class="doc"><div class="markdown"><p>Render the state of the world as an HTML table.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.render-world.html#var-format-css-class">format-css-class</a> </li><li> <a href="mw-ui.render-world.html#var-format-image-path">format-image-path</a> </li><li> <a href="mw-ui.render-world.html#var-format-mouseover">format-mouseover</a> </li><li> <a href="mw-ui.render-world.html#var-render-cell">render-cell</a> </li><li> <a href="mw-ui.render-world.html#var-render-inspector">render-inspector</a> </li><li> <a href="mw-ui.render-world.html#var-render-world-row">render-world-row</a> </li><li> <a href="mw-ui.render-world.html#var-render-world-table">render-world-table</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.repl.html">mw-ui.repl</a></h3><div class="doc"><div class="markdown"><p>In truth, boilerplate from Luminus.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.repl.html#var--main">-main</a> </li><li> <a href="mw-ui.repl.html#var-get-handler">get-handler</a> </li><li> <a href="mw-ui.repl.html#var-server">server</a> </li><li> <a href="mw-ui.repl.html#var-start-server">start-server</a> </li><li> <a href="mw-ui.repl.html#var-stop-server">stop-server</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.home.html">mw-ui.routes.home</a></h3><div class="doc"><div class="markdown"><p>Routes which serve the main pages of the application.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.home.html#var-about-page">about-page</a> </li><li> <a href="mw-ui.routes.home.html#var-docs-page">docs-page</a> </li><li> <a href="mw-ui.routes.home.html#var-home-page">home-page</a> </li><li> <a href="mw-ui.routes.home.html#var-home-routes">home-routes</a> </li><li> <a href="mw-ui.routes.home.html#var-inspect-page">inspect-page</a> </li><li> <a href="mw-ui.routes.home.html#var-list-states">list-states</a> </li><li> <a href="mw-ui.routes.home.html#var-md-page">md-page</a> </li><li> <a href="mw-ui.routes.home.html#var-world-page">world-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.load.html">mw-ui.routes.load</a></h3><div class="doc"><div class="markdown"><p>Route which handles the upload of worlds/rules from the client.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.load.html#var-load-page">load-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.params.html">mw-ui.routes.params</a></h3><div class="doc"><div class="markdown"><p>Route which serves and handles the parameters page.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.params.html#var-params-page">params-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.rules.html">mw-ui.routes.rules</a></h3><div class="doc"><div class="markdown"><p>Route which serves and handles the rules page.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.rules.html#var-process-rules-request">process-rules-request</a> </li><li> <a href="mw-ui.routes.rules.html#var-rules-page">rules-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.routes.save.html">mw-ui.routes.save</a></h3><div class="doc"><div class="markdown"><p>Route which handles the saving of world state the client.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.routes.save.html#var-save-page">save-page</a> </li></ul></div></div><div class="namespace"><h3><a href="mw-ui.util.html">mw-ui.util</a></h3><div class="doc"><div class="markdown"><p>Utility functions used by other namespaces in this package.</p>
|
||||||
|
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="mw-ui.util.html#var-cache-seq-match">cache-seq-match</a> </li><li> <a href="mw-ui.util.html#var-compile-time-resources">compile-time-resources</a> </li><li> <a href="mw-ui.util.html#var-list-resources">list-resources</a> </li><li> <a href="mw-ui.util.html#var-md-.3Ehtml">md->html</a> </li><li> <a href="mw-ui.util.html#var-running-from-filesystem">running-from-filesystem</a> </li></ul></div></div></div></body></html>
|
2
docs/codox/js/highlight.min.js
vendored
Normal file
2
docs/codox/js/highlight.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
docs/codox/js/jquery.min.js
vendored
Normal file
4
docs/codox/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
112
docs/codox/js/page_effects.js
Normal file
112
docs/codox/js/page_effects.js
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
function visibleInParent(element) {
|
||||||
|
var position = $(element).position().top
|
||||||
|
return position > -50 && position < ($(element).offsetParent().height() - 50)
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasFragment(link, fragment) {
|
||||||
|
return $(link).attr("href").indexOf("#" + fragment) != -1
|
||||||
|
}
|
||||||
|
|
||||||
|
function findLinkByFragment(elements, fragment) {
|
||||||
|
return $(elements).filter(function(i, e) { return hasFragment(e, fragment)}).first()
|
||||||
|
}
|
||||||
|
|
||||||
|
function scrollToCurrentVarLink(elements) {
|
||||||
|
var elements = $(elements);
|
||||||
|
var parent = elements.offsetParent();
|
||||||
|
|
||||||
|
if (elements.length == 0) return;
|
||||||
|
|
||||||
|
var top = elements.first().position().top;
|
||||||
|
var bottom = elements.last().position().top + elements.last().height();
|
||||||
|
|
||||||
|
if (top >= 0 && bottom <= parent.height()) return;
|
||||||
|
|
||||||
|
if (top < 0) {
|
||||||
|
parent.scrollTop(parent.scrollTop() + top);
|
||||||
|
}
|
||||||
|
else if (bottom > parent.height()) {
|
||||||
|
parent.scrollTop(parent.scrollTop() + bottom - parent.height());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCurrentVarLink() {
|
||||||
|
$('.secondary a').parent().removeClass('current')
|
||||||
|
$('.anchor').
|
||||||
|
filter(function(index) { return visibleInParent(this) }).
|
||||||
|
each(function(index, element) {
|
||||||
|
findLinkByFragment(".secondary a", element.id).
|
||||||
|
parent().
|
||||||
|
addClass('current')
|
||||||
|
});
|
||||||
|
scrollToCurrentVarLink('.secondary .current');
|
||||||
|
}
|
||||||
|
|
||||||
|
var hasStorage = (function() { try { return localStorage.getItem } catch(e) {} }())
|
||||||
|
|
||||||
|
function scrollPositionId(element) {
|
||||||
|
var directory = window.location.href.replace(/[^\/]+\.html$/, '')
|
||||||
|
return 'scroll::' + $(element).attr('id') + '::' + directory
|
||||||
|
}
|
||||||
|
|
||||||
|
function storeScrollPosition(element) {
|
||||||
|
if (!hasStorage) return;
|
||||||
|
localStorage.setItem(scrollPositionId(element) + "::x", $(element).scrollLeft())
|
||||||
|
localStorage.setItem(scrollPositionId(element) + "::y", $(element).scrollTop())
|
||||||
|
}
|
||||||
|
|
||||||
|
function recallScrollPosition(element) {
|
||||||
|
if (!hasStorage) return;
|
||||||
|
$(element).scrollLeft(localStorage.getItem(scrollPositionId(element) + "::x"))
|
||||||
|
$(element).scrollTop(localStorage.getItem(scrollPositionId(element) + "::y"))
|
||||||
|
}
|
||||||
|
|
||||||
|
function persistScrollPosition(element) {
|
||||||
|
recallScrollPosition(element)
|
||||||
|
$(element).scroll(function() { storeScrollPosition(element) })
|
||||||
|
}
|
||||||
|
|
||||||
|
function sidebarContentWidth(element) {
|
||||||
|
var widths = $(element).find('.inner').map(function() { return $(this).innerWidth() })
|
||||||
|
return Math.max.apply(Math, widths)
|
||||||
|
}
|
||||||
|
|
||||||
|
function calculateSize(width, snap, margin, minimum) {
|
||||||
|
if (width == 0) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Math.max(minimum, (Math.ceil(width / snap) * snap) + (margin * 2))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function resizeSidebars() {
|
||||||
|
var primaryWidth = sidebarContentWidth('.primary')
|
||||||
|
var secondaryWidth = 0
|
||||||
|
|
||||||
|
if ($('.secondary').length != 0) {
|
||||||
|
secondaryWidth = sidebarContentWidth('.secondary')
|
||||||
|
}
|
||||||
|
|
||||||
|
// snap to grid
|
||||||
|
primaryWidth = calculateSize(primaryWidth, 32, 13, 160)
|
||||||
|
secondaryWidth = calculateSize(secondaryWidth, 32, 13, 160)
|
||||||
|
|
||||||
|
$('.primary').css('width', primaryWidth)
|
||||||
|
$('.secondary').css('width', secondaryWidth).css('left', primaryWidth + 1)
|
||||||
|
|
||||||
|
if (secondaryWidth > 0) {
|
||||||
|
$('#content').css('left', primaryWidth + secondaryWidth + 2)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#content').css('left', primaryWidth + 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(window).ready(resizeSidebars)
|
||||||
|
$(window).ready(setCurrentVarLink)
|
||||||
|
$(window).ready(function() { persistScrollPosition('.primary')})
|
||||||
|
$(window).ready(function() {
|
||||||
|
$('#content').scroll(setCurrentVarLink)
|
||||||
|
$(window).resize(setCurrentVarLink)
|
||||||
|
})
|
8
docs/codox/mw-ui.handler.html
Normal file
8
docs/codox/mw-ui.handler.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.handler documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch current"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.handler.html#var-app"><div class="inner"><span>app</span></div></a></li><li class="depth-1"><a href="mw-ui.handler.html#var-app-routes"><div class="inner"><span>app-routes</span></div></a></li><li class="depth-1"><a href="mw-ui.handler.html#var-destroy"><div class="inner"><span>destroy</span></div></a></li><li class="depth-1"><a href="mw-ui.handler.html#var-init"><div class="inner"><span>init</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.handler</h1><div class="doc"><div class="markdown"><p>Set up and tear down the request handler.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-app"><h3>app</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/handler.clj#L73">view source</a></div></div><div class="public anchor" id="var-app-routes"><h3>app-routes</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/handler.clj#L38">view source</a></div></div><div class="public anchor" id="var-destroy"><h3>destroy</h3><div class="usage"><code>(destroy)</code></div><div class="doc"><div class="markdown"><p>destroy will be called when your application shuts down, put any clean up code here</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/handler.clj#L66">view source</a></div></div><div class="public anchor" id="var-init"><h3>init</h3><div class="usage"><code>(init)</code></div><div class="doc"><div class="markdown"><p>init will be called once when app is deployed as a servlet on an app server such as Tomcat put any initialization code here</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/handler.clj#L43">view source</a></div></div></div></body></html>
|
6
docs/codox/mw-ui.layout.html
Normal file
6
docs/codox/mw-ui.layout.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.layout documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch current"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.layout.html#var-render"><div class="inner"><span>render</span></div></a></li><li class="depth-1"><a href="mw-ui.layout.html#var-template-path"><div class="inner"><span>template-path</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.layout</h1><div class="doc"><div class="markdown"><p>Layout content as HTML.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-render"><h3>render</h3><div class="usage"><code>(render template & [params])</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/layout.clj#L49">view source</a></div></div><div class="public anchor" id="var-template-path"><h3>template-path</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/layout.clj#L33">view source</a></div></div></div></body></html>
|
8
docs/codox/mw-ui.middleware.html
Normal file
8
docs/codox/mw-ui.middleware.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.middleware documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch current"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.middleware.html#var-development-middleware"><div class="inner"><span>development-middleware</span></div></a></li><li class="depth-1"><a href="mw-ui.middleware.html#var-load-middleware"><div class="inner"><span>load-middleware</span></div></a></li><li class="depth-1"><a href="mw-ui.middleware.html#var-log-request"><div class="inner"><span>log-request</span></div></a></li><li class="depth-1"><a href="mw-ui.middleware.html#var-production-middleware"><div class="inner"><span>production-middleware</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.middleware</h1><div class="doc"><div class="markdown"><p>In truth, boilerplate from Luminus.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-development-middleware"><h3>development-middleware</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/middleware.clj#L40">view source</a></div></div><div class="public anchor" id="var-load-middleware"><h3>load-middleware</h3><div class="usage"><code>(load-middleware)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/middleware.clj#L50">view source</a></div></div><div class="public anchor" id="var-log-request"><h3>log-request</h3><div class="usage"><code>(log-request handler)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/middleware.clj#L34">view source</a></div></div><div class="public anchor" id="var-production-middleware"><h3>production-middleware</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/middleware.clj#L46">view source</a></div></div></div></body></html>
|
11
docs/codox/mw-ui.render-world.html
Normal file
11
docs/codox/mw-ui.render-world.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.render-world documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch current"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.render-world.html#var-format-css-class"><div class="inner"><span>format-css-class</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-format-image-path"><div class="inner"><span>format-image-path</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-format-mouseover"><div class="inner"><span>format-mouseover</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-render-cell"><div class="inner"><span>render-cell</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-render-inspector"><div class="inner"><span>render-inspector</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-render-world-row"><div class="inner"><span>render-world-row</span></div></a></li><li class="depth-1"><a href="mw-ui.render-world.html#var-render-world-table"><div class="inner"><span>render-world-table</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.render-world</h1><div class="doc"><div class="markdown"><p>Render the state of the world as an HTML table.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-format-css-class"><h3>format-css-class</h3><div class="usage"><code>(format-css-class statekey)</code></div><div class="doc"><div class="markdown"><p>Format this statekey, assumed to be a keyword indicating a state in the world, into a CSS class</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L34">view source</a></div></div><div class="public anchor" id="var-format-image-path"><h3>format-image-path</h3><div class="usage"><code>(format-image-path statekey)</code></div><div class="doc"><div class="markdown"><p>Render this statekey, assumed to be a keyword indicating a state in the world, into a path which should recover the corresponding image file.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L41">view source</a></div></div><div class="public anchor" id="var-format-mouseover"><h3>format-mouseover</h3><div class="usage"><code>(format-mouseover cell)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L48">view source</a></div></div><div class="public anchor" id="var-render-cell"><h3>render-cell</h3><div class="usage"><code>(render-cell cell)</code></div><div class="doc"><div class="markdown"><p>Render this world cell as a Hiccup table cell.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L52">view source</a></div></div><div class="public anchor" id="var-render-inspector"><h3>render-inspector</h3><div class="usage"><code>(render-inspector cell _)</code><code>(render-inspector cell)</code></div><div class="doc"><div class="markdown"><p>Render in Hiccup format the HTML content of an inspector on this cell.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L91">view source</a></div></div><div class="public anchor" id="var-render-world-row"><h3>render-world-row</h3><div class="usage"><code>(render-world-row row)</code></div><div class="doc"><div class="markdown"><p>Render this world row as a Hiccup table row.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L61">view source</a></div></div><div class="public anchor" id="var-render-world-table"><h3>render-world-table</h3><div class="usage"><code>(render-world-table)</code></div><div class="doc"><div class="markdown"><p>Render the world implied by the current session as a complete HTML table in a DIV.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/render_world.clj#L67">view source</a></div></div></div></body></html>
|
9
docs/codox/mw-ui.repl.html
Normal file
9
docs/codox/mw-ui.repl.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.repl documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch current"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.repl.html#var--main"><div class="inner"><span>-main</span></div></a></li><li class="depth-1"><a href="mw-ui.repl.html#var-get-handler"><div class="inner"><span>get-handler</span></div></a></li><li class="depth-1"><a href="mw-ui.repl.html#var-server"><div class="inner"><span>server</span></div></a></li><li class="depth-1"><a href="mw-ui.repl.html#var-start-server"><div class="inner"><span>start-server</span></div></a></li><li class="depth-1"><a href="mw-ui.repl.html#var-stop-server"><div class="inner"><span>stop-server</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.repl</h1><div class="doc"><div class="markdown"><p>In truth, boilerplate from Luminus.</p>
|
||||||
|
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L64">view source</a></div></div><div class="public anchor" id="var-get-handler"><h3>get-handler</h3><div class="usage"><code>(get-handler)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L36">view source</a></div></div><div class="public anchor" id="var-server"><h3>server</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L34">view source</a></div></div><div class="public anchor" id="var-start-server"><h3>start-server</h3><div class="usage"><code>(start-server & [port])</code></div><div class="doc"><div class="markdown"><p>used for starting the server in development mode from REPL</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L47">view source</a></div></div><div class="public anchor" id="var-stop-server"><h3>stop-server</h3><div class="usage"><code>(stop-server)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/repl.clj#L60">view source</a></div></div></div></body></html>
|
12
docs/codox/mw-ui.routes.home.html
Normal file
12
docs/codox/mw-ui.routes.home.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.home documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch current"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.home.html#var-about-page"><div class="inner"><span>about-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-docs-page"><div class="inner"><span>docs-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-home-page"><div class="inner"><span>home-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-home-routes"><div class="inner"><span>home-routes</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-inspect-page"><div class="inner"><span>inspect-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-list-states"><div class="inner"><span>list-states</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-md-page"><div class="inner"><span>md-page</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.home.html#var-world-page"><div class="inner"><span>world-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.home</h1><div class="doc"><div class="markdown"><p>Routes which serve the main pages of the application.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-about-page"><h3>about-page</h3><div class="usage"><code>(about-page)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L51">view source</a></div></div><div class="public anchor" id="var-docs-page"><h3>docs-page</h3><div class="usage"><code>(docs-page)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L58">view source</a></div></div><div class="public anchor" id="var-home-page"><h3>home-page</h3><div class="usage"><code>(home-page)</code></div><div class="doc"><div class="markdown"><p>Render the home page.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L66">view source</a></div></div><div class="public anchor" id="var-home-routes"><h3>home-routes</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L118">view source</a></div></div><div class="public anchor" id="var-inspect-page"><h3>inspect-page</h3><div class="usage"><code>(inspect-page request)</code></div><div class="doc"><div class="markdown"><p>Open an inspector on the cell at the co-ordinates specified in this request</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L73">view source</a></div></div><div class="public anchor" id="var-list-states"><h3>list-states</h3><div class="usage"><code>(list-states)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L43">view source</a></div></div><div class="public anchor" id="var-md-page"><h3>md-page</h3><div class="usage"><code>(md-page request)</code></div><div class="doc"><div class="markdown"><p>Render the markdown page specified in this request, if any. Probably undesirable, should be removed.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L98">view source</a></div></div><div class="public anchor" id="var-world-page"><h3>world-page</h3><div class="usage"><code>(world-page)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/home.clj#L108">view source</a></div></div></div></body></html>
|
7
docs/codox/mw-ui.routes.load.html
Normal file
7
docs/codox/mw-ui.routes.load.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.load documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch current"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.load.html#var-load-page"><div class="inner"><span>load-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.load</h1><div class="doc"><div class="markdown"><p>Route which handles the upload of worlds/rules from the client.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-load-page"><h3>load-page</h3><div class="usage"><code>(load-page)</code><code>(load-page request)</code></div><div class="doc"><div class="markdown"><p>If no args, show the load form; with args, load a world file from the client.</p>
|
||||||
|
<p><em>NOTE</em> that this reads a Clojure form from an untrusted client and should almost certainly NOT be enabled on a public-facing site, especially not on the Internet.</p>
|
||||||
|
<p><em>TODO</em> doesn’t work yet.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/load.clj#L41">view source</a></div></div></div></body></html>
|
5
docs/codox/mw-ui.routes.params.html
Normal file
5
docs/codox/mw-ui.routes.params.html
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.params documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch current"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.params.html#var-params-page"><div class="inner"><span>params-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.params</h1><div class="doc"><div class="markdown"><p>Route which serves and handles the parameters page.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-params-page"><h3>params-page</h3><div class="usage"><code>(params-page)</code><code>(params-page request)</code></div><div class="doc"><div class="markdown"><p>Handler for params request. If no <code>request</code> passed, show empty params form. If <code>request</code> is passed, put parameters from request into session and show the world page.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/params.clj#L44">view source</a></div></div></div></body></html>
|
7
docs/codox/mw-ui.routes.rules.html
Normal file
7
docs/codox/mw-ui.routes.rules.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.rules documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch current"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.rules.html#var-process-rules-request"><div class="inner"><span>process-rules-request</span></div></a></li><li class="depth-1"><a href="mw-ui.routes.rules.html#var-rules-page"><div class="inner"><span>rules-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.rules</h1><div class="doc"><div class="markdown"><p>Route which serves and handles the rules page.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-process-rules-request"><h3>process-rules-request</h3><div class="usage"><code>(process-rules-request request)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/rules.clj#L34">view source</a></div></div><div class="public anchor" id="var-rules-page"><h3>rules-page</h3><div class="usage"><code>(rules-page request)</code><code>(rules-page)</code></div><div class="doc"><div class="markdown"><p>Request handler for the <code>rules</code> request. If the <code>request</code> contains a value for <code>:src</code>, treat that as rule source and try to compile it. If compilation succeeds, stash the compiled rules and the rule text on the session, and provide feedback; if not, provide feedback.</p>
|
||||||
|
<p>If <code>request</code> doesn’t contain a value for <code>:src</code>, load basic rule source from the session or from <code>resources/rulesets/basic.txt</code> and pass that back.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/rules.clj#L55">view source</a></div></div></div></body></html>
|
5
docs/codox/mw-ui.routes.save.html
Normal file
5
docs/codox/mw-ui.routes.save.html
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.routes.save documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3 current"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.routes.save.html#var-save-page"><div class="inner"><span>save-page</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.routes.save</h1><div class="doc"><div class="markdown"><p>Route which handles the saving of world state the client.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-save-page"><h3>save-page</h3><div class="usage"><code>(save-page)</code></div><div class="doc"><div class="markdown"><p>Save the current world to the browser, using our own custom mime-type in an attempt to prevent the browser trying to do anything clever with it. Note that it is saved as a raw Clojure data structure, not as XML or any proprietary format.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/routes/save.clj#L32">view source</a></div></div></div></body></html>
|
9
docs/codox/mw-ui.util.html
Normal file
9
docs/codox/mw-ui.util.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>mw-ui.util documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Mw-ui</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw-ui</span></div></div></li><li class="depth-2 branch"><a href="mw-ui.handler.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.render-world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>render-world</span></div></a></li><li class="depth-2 branch"><a href="mw-ui.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></div></li><li class="depth-3 branch"><a href="mw-ui.routes.home.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>home</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.load.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>load</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.params.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>params</span></div></a></li><li class="depth-3 branch"><a href="mw-ui.routes.rules.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rules</span></div></a></li><li class="depth-3"><a href="mw-ui.routes.save.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>save</span></div></a></li><li class="depth-2 current"><a href="mw-ui.util.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="mw-ui.util.html#var-cache-seq-match"><div class="inner"><span>cache-seq-match</span></div></a></li><li class="depth-1"><a href="mw-ui.util.html#var-compile-time-resources"><div class="inner"><span>compile-time-resources</span></div></a></li><li class="depth-1"><a href="mw-ui.util.html#var-list-resources"><div class="inner"><span>list-resources</span></div></a></li><li class="depth-1"><a href="mw-ui.util.html#var-md-.3Ehtml"><div class="inner"><span>md->html</span></div></a></li><li class="depth-1"><a href="mw-ui.util.html#var-running-from-filesystem"><div class="inner"><span>running-from-filesystem</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">mw-ui.util</h1><div class="doc"><div class="markdown"><p>Utility functions used by other namespaces in this package.</p>
|
||||||
|
</div></div><div class="public anchor" id="var-cache-seq-match"><h3>cache-seq-match</h3><div class="usage"><code>(cache-seq-match path pattern)</code></div><div class="doc"><div class="markdown"><p>Do the same processing that list-resources does on names fetched from the file system, except on the resource list cached at compile time.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L60">view source</a></div></div><div class="public anchor" id="var-compile-time-resources"><h3>compile-time-resources</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The resources which were visible at compile time. If we are running from a JAR file, it is highly likely that these are all the resources available at run time.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L39">view source</a></div></div><div class="public anchor" id="var-list-resources"><h3>list-resources</h3><div class="usage"><code>(list-resources directory pattern)</code></div><div class="doc"><div class="markdown"><p>List resource files matching <code>pattern</code> in <code>directory</code>.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L74">view source</a></div></div><div class="public anchor" id="var-md-.3Ehtml"><h3>md->html</h3><div class="usage"><code>(md->html filename)</code></div><div class="doc"><div class="markdown"><p>reads a markdown file from public/md and returns an HTML string</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L52">view source</a></div></div><div class="public anchor" id="var-running-from-filesystem"><h3>running-from-filesystem</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>We assume we’re running from the filesystem unless we find we’re not.</p>
|
||||||
|
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/mw-ui/blob/master/src/mw_ui/util.clj#L34">view source</a></div></div></div></body></html>
|
40
project.clj
40
project.clj
|
@ -1,5 +1,9 @@
|
||||||
(defproject mw-ui "0.2.0-SNAPSHOT"
|
(defproject mw-ui "0.2.0-SNAPSHOT"
|
||||||
:description "Web-based user interface for MicroWorld"
|
:cloverage {:output "docs/cloverage"}
|
||||||
|
:codox {:metadata {:doc "**TODO**: write docs"
|
||||||
|
:doc/format :markdown}
|
||||||
|
:output-path "docs/codox"
|
||||||
|
:source-uri "https://github.com/simon-brooke/mw-ui/blob/master/{filepath}#L{line}"}
|
||||||
:dependencies [[org.clojure/clojure "1.11.1"]
|
:dependencies [[org.clojure/clojure "1.11.1"]
|
||||||
[clj-time "0.15.2"] ;; this is a hack. Something in libnoir requires
|
[clj-time "0.15.2"] ;; this is a hack. Something in libnoir requires
|
||||||
;; JodaTime, but doesn't request it. clj-time does.
|
;; JodaTime, but doesn't request it. clj-time does.
|
||||||
|
@ -14,17 +18,20 @@
|
||||||
[markdown-clj "1.11.4"]
|
[markdown-clj "1.11.4"]
|
||||||
[environ "1.2.0"]
|
[environ "1.2.0"]
|
||||||
[noir-exception "0.2.5"]]
|
[noir-exception "0.2.5"]]
|
||||||
:docker {:image-name "simonbrooke/microworld"
|
:description "Web-based user interface for MicroWorld"
|
||||||
:dockerfile "Dockerfile"}
|
:docker {:image-name "simonbrooke/microworld"
|
||||||
|
:dockerfile "Dockerfile"}
|
||||||
:main mw-ui.repl
|
:main mw-ui.repl
|
||||||
:manifest {"build-signature-version" "0.1.6-SNAPSHOT"
|
:manifest {"build-signature-version" "0.1.6-SNAPSHOT"
|
||||||
"build-signature-user" "Simon Brooke"
|
"build-signature-user" "Simon Brooke"
|
||||||
"build-signature-email" "unset"
|
"build-signature-email" "unset"
|
||||||
"build-signature-timestamp" "2021-05-17 13:31:22+01:00"
|
"build-signature-timestamp" "2021-05-17 13:31:22+01:00"
|
||||||
"Implementation-Version" "0.1.6-SNAPSHOT built by Simon Brooke on 2021-05-17 13:31:22+01:00"}
|
"Implementation-Version" "0.1.6-SNAPSHOT built by Simon Brooke on 2021-05-17 13:31:22+01:00"}
|
||||||
:min-lein-version "2.0.0"
|
:min-lein-version "2.0.0"
|
||||||
|
|
||||||
:plugins [[lein-ring "0.12.6"]
|
:plugins [[lein-ring "0.12.6"]
|
||||||
|
[lein-cloverage "1.2.2"]
|
||||||
|
[lein-codox "0.10.8"]
|
||||||
[lein-environ "1.2.0"]
|
[lein-environ "1.2.0"]
|
||||||
[lein-marginalia "0.9.1"]
|
[lein-marginalia "0.9.1"]
|
||||||
[gorillalabs/lein-docker "1.6.0"]]
|
[gorillalabs/lein-docker "1.6.0"]]
|
||||||
|
@ -39,13 +46,12 @@
|
||||||
:injections [(require 'pjstadig.humane-test-output)
|
:injections [(require 'pjstadig.humane-test-output)
|
||||||
(pjstadig.humane-test-output/activate!)]
|
(pjstadig.humane-test-output/activate!)]
|
||||||
:env {:dev true}}}
|
:env {:dev true}}}
|
||||||
:repl-options {:init-ns mw-ui.repl}
|
:repl-options {:init-ns mw-ui.repl}
|
||||||
:ring {:handler mw-ui.handler/app
|
:ring {:handler mw-ui.handler/app
|
||||||
:init mw-ui.handler/init
|
:init mw-ui.handler/init
|
||||||
:destroy mw-ui.handler/destroy
|
:destroy mw-ui.handler/destroy
|
||||||
:resources-path "resources"
|
:resources-path "resources"
|
||||||
:war-resources-path "war-resources"
|
:war-resources-path "war-resources"
|
||||||
:uberwar-name "microworld.war"}
|
:uberwar-name "microworld.war"}
|
||||||
|
|
||||||
:url "http://www.journeyman.cc/microworld"
|
:url "http://www.journeyman.cc/microworld")
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in a new issue