1
0
David Peter 2 жил өмнө
parent
commit
2e84b3a7d6

+ 11 - 0
book/deploy.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -euo pipefail
+
+SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+
+cd "$SCRIPT_DIR"
+
+bash build.sh
+
+rsync --delete --archive --stats --progress --human-readable book/html/ shark.fish:numbat.dev/doc/

+ 2 - 1
book/src/web-usage.md

@@ -1,6 +1,6 @@
 # Usage
 
-The browser-based version of Numbat is online at <https://numbat.dev/>.
+The browser-based version of Numbat is available at <https://numbat.dev/>.
 
 ## Interactive terminal
 
@@ -25,6 +25,7 @@ There is a set of special commands that only work in the web version:
 | Command | Action |
 |---------|--------|
 | `clear` | Clear screen |
+| `reset` | Reset state (clear constants, functions, units, …) |
 
 ### Key bindings
 

+ 3 - 0
numbat-wasm/www/index.js

@@ -28,6 +28,9 @@ function interpret(input) {
   if (input_trimmed == "clear") {
     this.clear();
     var output = "";
+  } else if (input_trimmed == "reset") {
+    numbat = Numbat.new();
+    this.clear();
   } else {
     var output = numbat.interpret(input);
     updateUrlQuery(input);