aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-10-28 00:07:12 -0700
committerbnewbold <bnewbold@robocracy.org>2016-10-28 00:07:12 -0700
commit360a3f82c02fdbe2c2d317e01f01fc69adbf4ab5 (patch)
tree6d87639cef6b31ec069d259d9a119e14e7f241a7
parentadf41d8d3dcbc21806475bc652d560c7483fbcfb (diff)
downloadmodelthing-360a3f82c02fdbe2c2d317e01f01fc69adbf4ab5.tar.gz
modelthing-360a3f82c02fdbe2c2d317e01f01fc69adbf4ab5.zip
webface front page
-rw-r--r--notes/webface.txt1
-rw-r--r--src/bin/modelthing-webface.rs12
-rw-r--r--webface/templates/base.html7
-rw-r--r--webface/templates/home.html40
-rw-r--r--webface/templates/raw.html6
5 files changed, 60 insertions, 6 deletions
diff --git a/notes/webface.txt b/notes/webface.txt
index 0011b41..9f8f915 100644
--- a/notes/webface.txt
+++ b/notes/webface.txt
@@ -8,6 +8,7 @@ editing markdown etc:
- https://github.com/benweet/stackedit: markdown, very fancy
- https://ace.c9.io: simple code-oriented
- http://dillinger.io/
+- https://github.com/benweet/stackedit
- vue.js
### Dynamic Essay
diff --git a/src/bin/modelthing-webface.rs b/src/bin/modelthing-webface.rs
index 5dc98f8..0940ea0 100644
--- a/src/bin/modelthing-webface.rs
+++ b/src/bin/modelthing-webface.rs
@@ -13,10 +13,11 @@ fn home(r: &mut Request) -> PencilResult {
return r.app.render_template("home.html", &context);
}
-fn about(_: &mut Request) -> PencilResult {
- let mut response = Response::from(include_str!("../../README.txt"));
- response.set_content_type("text/plain");
- Ok(response)
+fn readme(r: &mut Request) -> PencilResult {
+ let mut context = BTreeMap::new();
+ let raw_text = include_str!("../../README.txt");
+ context.insert("raw_text".to_string(), raw_text.to_string());
+ return r.app.render_template("raw.html", &context);
}
fn model_list(_: &mut Request) -> PencilResult {
@@ -57,8 +58,9 @@ fn main() {
app.register_template("base.html");
app.register_template("home.html");
+ app.register_template("raw.html");
app.get("/", "home", home);
- app.get("/about/", "about", about);
+ app.get("/readme/", "readme", readme);
app.get("/model_list/", "model_list", model_list);
app.register_template("model_view.html");
app.get("/model/<model_id:string>", "model", model_view);
diff --git a/webface/templates/base.html b/webface/templates/base.html
index 59060ed..db49004 100644
--- a/webface/templates/base.html
+++ b/webface/templates/base.html
@@ -3,10 +3,17 @@
<head>
<meta charset="UTF-8">
<title>{{#block title}}modelthing{{/block}}</title>
+<style>
+html, body, div{ margin: 0; padding: 0; }
+body { font-family: monospace; font-size: larger; line-height: 1.3; }
+#content { max-width: 700px; margin: 0 auto; margin-top: 4em; }
+</style>
</head>
<body>
+<div id="content">
{{~#block content}}{{/block~}}
+</div><!-- content -->
</body>
</html>
diff --git a/webface/templates/home.html b/webface/templates/home.html
index 6068c99..0860e77 100644
--- a/webface/templates/home.html
+++ b/webface/templates/home.html
@@ -1,6 +1,44 @@
{{# partial content}}
+<pre style="font-weight: bold;">
+ _ _ _ _ _ _
+ _ __ ___ ___ __| | ___| | |_| |__ (_)_ __ __ _| |
+ | '_ ` _ \ / _ \ / _` |/ _ \ | __| '_ \| | '_ \ / _` | |
+ | | | | | | (_) | (_| | __/ | |_| | | | | | | | (_| |_|
+ |_| |_| |_|\___/ \__,_|\___|_|\__|_| |_|_|_| |_|\__, (_)
+ |___/
-<a href="/about/">about</a>
+ an experimental systems-modeling-wiki-thing
+</pre><br><br>
+
+<p>modelthing is a set of software tools for collaboratively editing
+symbolic models of real world systems.
+
+<p><b>What kind of real world systems?</b> any system that can be described by
+algebraic differential equations. Examples: a double pendulum, population
+dynamics in ecology, Moore's Law of increasing transistor density, the light
+emited by an LED as a factor of current and voltage, real estate prices as a
+factor of rent control, etc.
+
+<p><b>What kind of symbolic models?</b> models which both hold semantic meaning
+and can be computed. machines should be able to translate the models between
+different symbolic, graphical, and interactive mediums, and both humans and
+machines should be able reason with and judge the appropriateness of the
+models.
+
+<p><b>What kind of collaborative editing?</b> aspirationally, rational discourse
+between strangers on the internet who come to progressively more accurate
+consensus. The models should be re-usable by hierarchal reference, with
+automated tooling to cross-check for compatibility.
+
+<p><b>Does it work?</b> there's no "here" here, yet, just some sketches and
+experiments.
+
+<br><br>
+<center>
+<a href="/readme/">full readme</a> -
+<a href="https://git.bnewbold.net/modelthing">source code</a>
+</center>
+<br>
{{/partial}}
{{> base.html}}
diff --git a/webface/templates/raw.html b/webface/templates/raw.html
new file mode 100644
index 0000000..5e10ff4
--- /dev/null
+++ b/webface/templates/raw.html
@@ -0,0 +1,6 @@
+{{# partial content}}
+<pre>
+{{ raw_text }}
+</pre>
+{{/partial}}
+{{> base.html}}