hy/site/templates/repl.html

52 lines
1.3 KiB
HTML
Raw Normal View History

2013-03-12 03:02:30 +01:00
{% extends "base.html" %}
{% block title %}Welcome!{% endblock %}
{% block head %}
<script src="{{url_for("static", filename="js/codemirror.js")}}"></script>
<link rel="stylesheet" href="{{url_for("static", filename="css/codemirror.css")}}">
2013-03-14 02:13:23 +01:00
<link rel="stylesheet" href="{{url_for("static", filename="css/themes/elegant.css")}}">
2013-03-12 03:02:30 +01:00
<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 %}
{% block tail %}
<script src="{{url_for("static", filename="js/main.js")}}"></script>
{% endblock %}
2013-03-14 01:18:08 +01:00
{% block content %}
2013-03-14 02:13:23 +01:00
<div class='repl-root' >
2013-03-12 03:02:30 +01:00
<div class='repl' id='hython-repl'>
<textarea id="hython-target">
2013-03-14 02:13:23 +01:00
;;;; 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
2013-03-12 03:02:30 +01:00
;;;; AST looks like using the `codegen` module.
2013-03-14 02:13:23 +01:00
;;;;
;;;; star the repo @ http://git.io/hy
;;;;
2013-03-12 03:02:30 +01:00
(defn square [x]
"This function will square a number"
(* x x))
(print (square 2))
2013-03-14 02:13:23 +01:00
(defn add-two-numbers [x y]
(+ x y))
2013-03-12 03:02:30 +01:00
2013-03-14 02:13:23 +01:00
;; (dashes turn to underscores)
2013-03-12 03:02:30 +01:00
2013-03-14 02:13:23 +01:00
(print (add-two-numbers 1 2))
2013-03-12 03:02:30 +01:00
</textarea>
</div>
<div class='repl' id='python-repl'></div>
<div class='clear'></div>
<div class='msgs' id='build-msgs'></div>
2013-03-14 02:13:23 +01:00
</div>
2013-03-12 03:02:30 +01:00
{% endblock %}