updating the repl
This commit is contained in:
parent
0bc2dd8d00
commit
1a9e2f66d8
@ -18,15 +18,17 @@
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
|
||||
theme = "elegant"
|
||||
|
||||
HyCodeMirror = CodeMirror.fromTextArea($('#hython-target')[0], {
|
||||
mode: "clojure",
|
||||
theme: "twilight",
|
||||
theme: theme,
|
||||
autofocus: true,
|
||||
})
|
||||
|
||||
PyCodeMirror = CodeMirror($('#python-repl')[0], {
|
||||
mode: "python",
|
||||
theme: "twilight",
|
||||
theme: theme,
|
||||
readOnly: true,
|
||||
})
|
||||
|
||||
|
@ -5,8 +5,7 @@
|
||||
|
||||
body, html {
|
||||
height: 100%;
|
||||
background-color: #141414;
|
||||
color: #DCDCDC;
|
||||
color: #000000;
|
||||
font-family: monospace;
|
||||
.reset;
|
||||
}
|
||||
@ -26,6 +25,24 @@ h1 {
|
||||
.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 {
|
||||
.repl;
|
||||
float: right;
|
||||
@ -34,7 +51,7 @@ h1 {
|
||||
#hython-repl {
|
||||
.repl;
|
||||
float: left;
|
||||
border-right: 1px solid #DCDCDC;
|
||||
border-right: 1px solid rgba(82, 168, 236, 0.2);
|
||||
}
|
||||
|
||||
#hython-target {
|
||||
@ -46,6 +63,8 @@ h1 {
|
||||
}
|
||||
|
||||
#build-msgs {
|
||||
border-top: 1px solid #DCDCDC;
|
||||
border-top: 1px solid rgba(82, 168, 236, 0.2);
|
||||
height: 10%;
|
||||
padding: 5px;
|
||||
color: #777777;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
{% block head %}
|
||||
<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/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/python/python.js")}}"></script>
|
||||
{% endblock %}
|
||||
@ -15,11 +15,19 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class='repl-root' >
|
||||
<div class='repl' id='hython-repl'>
|
||||
<textarea id="hython-target">
|
||||
;;;; This is Hy. Hy is a Lisp variant that "compiles" to Python ASTs.
|
||||
;;;; This pane is the Hy lisp variant, and the left side is what the output
|
||||
;;;; This is Hy. Hy is a Lisp variant that
|
||||
;;;; "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.
|
||||
;;;;
|
||||
;;;; star the repo @ http://git.io/hy
|
||||
;;;;
|
||||
|
||||
|
||||
(defn square [x]
|
||||
"This function will square a number"
|
||||
@ -28,16 +36,16 @@
|
||||
(print (square 2))
|
||||
|
||||
|
||||
;; we even do some minor mangling:
|
||||
(defn add-two-numbers [x y]
|
||||
(+ x y))
|
||||
|
||||
;; (dashes turn to underscores)
|
||||
|
||||
;(defn add-two-numbers [x y]
|
||||
; (+ x y))
|
||||
;(print (add-two-numbers 1 2))
|
||||
|
||||
(print (add-two-numbers 1 2))
|
||||
</textarea>
|
||||
</div>
|
||||
<div class='repl' id='python-repl'></div>
|
||||
<div class='clear'></div>
|
||||
<div class='msgs' id='build-msgs'></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user