updating the repl

This commit is contained in:
Paul R. Tagliamonte 2013-03-13 21:13:23 -04:00
parent 0bc2dd8d00
commit 1a9e2f66d8
3 changed files with 43 additions and 14 deletions

View File

@ -18,15 +18,17 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
theme = "elegant"
HyCodeMirror = CodeMirror.fromTextArea($('#hython-target')[0], { HyCodeMirror = CodeMirror.fromTextArea($('#hython-target')[0], {
mode: "clojure", mode: "clojure",
theme: "twilight", theme: theme,
autofocus: true, autofocus: true,
}) })
PyCodeMirror = CodeMirror($('#python-repl')[0], { PyCodeMirror = CodeMirror($('#python-repl')[0], {
mode: "python", mode: "python",
theme: "twilight", theme: theme,
readOnly: true, readOnly: true,
}) })

View File

@ -5,8 +5,7 @@
body, html { body, html {
height: 100%; height: 100%;
background-color: #141414; color: #000000;
color: #DCDCDC;
font-family: monospace; font-family: monospace;
.reset; .reset;
} }
@ -26,6 +25,24 @@ h1 {
.reset; .reset;
} }
.blueshade {
border-color: rgba(82, 168, 236, 0.8);
outline: 0;
outline: thin dotted \9;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
.repl-root {
margin-top: 2%;
width: 90%;
height: 90%;
margin-left: auto;
margin-right: auto;
.blueshade;
}
#python-repl { #python-repl {
.repl; .repl;
float: right; float: right;
@ -34,7 +51,7 @@ h1 {
#hython-repl { #hython-repl {
.repl; .repl;
float: left; float: left;
border-right: 1px solid #DCDCDC; border-right: 1px solid rgba(82, 168, 236, 0.2);
} }
#hython-target { #hython-target {
@ -46,6 +63,8 @@ h1 {
} }
#build-msgs { #build-msgs {
border-top: 1px solid #DCDCDC; border-top: 1px solid rgba(82, 168, 236, 0.2);
height: 10%; height: 10%;
padding: 5px;
color: #777777;
} }

View File

@ -5,7 +5,7 @@
{% block head %} {% block head %}
<script src="{{url_for("static", filename="js/codemirror.js")}}"></script> <script src="{{url_for("static", filename="js/codemirror.js")}}"></script>
<link rel="stylesheet" href="{{url_for("static", filename="css/codemirror.css")}}"> <link rel="stylesheet" href="{{url_for("static", filename="css/codemirror.css")}}">
<link rel="stylesheet" href="{{url_for("static", filename="css/themes/twilight.css")}}"> <link rel="stylesheet" href="{{url_for("static", filename="css/themes/elegant.css")}}">
<script src="{{url_for("static", filename="js/mode/clojure/clojure.js")}}"></script> <script src="{{url_for("static", filename="js/mode/clojure/clojure.js")}}"></script>
<script src="{{url_for("static", filename="js/mode/python/python.js")}}"></script> <script src="{{url_for("static", filename="js/mode/python/python.js")}}"></script>
{% endblock %} {% endblock %}
@ -15,11 +15,19 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class='repl-root' >
<div class='repl' id='hython-repl'> <div class='repl' id='hython-repl'>
<textarea id="hython-target"> <textarea id="hython-target">
;;;; This is Hy. Hy is a Lisp variant that "compiles" to Python ASTs. ;;;; This is Hy. Hy is a Lisp variant that
;;;; This pane is the Hy lisp variant, and the left side is what the output ;;;; "compiles" to Python ASTs.
;;;;
;;;; This pane is the Hy lisp variant,
;;;; and the left side is what the output
;;;; AST looks like using the `codegen` module. ;;;; AST looks like using the `codegen` module.
;;;;
;;;; star the repo @ http://git.io/hy
;;;;
(defn square [x] (defn square [x]
"This function will square a number" "This function will square a number"
@ -28,16 +36,16 @@
(print (square 2)) (print (square 2))
;; we even do some minor mangling: (defn add-two-numbers [x y]
(+ x y))
;; (dashes turn to underscores) ;; (dashes turn to underscores)
;(defn add-two-numbers [x y] (print (add-two-numbers 1 2))
; (+ x y))
;(print (add-two-numbers 1 2))
</textarea> </textarea>
</div> </div>
<div class='repl' id='python-repl'></div> <div class='repl' id='python-repl'></div>
<div class='clear'></div> <div class='clear'></div>
<div class='msgs' id='build-msgs'></div> <div class='msgs' id='build-msgs'></div>
</div>
{% endblock %} {% endblock %}