hy/site/templates/index.html

44 lines
1.4 KiB
HTML
Raw Normal View History

2013-03-10 04:54:29 +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")}}">
<link rel="stylesheet" href="{{url_for("static", filename="css/themes/twilight.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 %}
{% block tail %}
<script src="{{url_for("static", filename="js/main.js")}}"></script>
{% endblock %}
{% block content %}{#{% autoescape off %}{% code "clojure" %} (print "foo bar") {% endcode %}{% endautoescape %}#}
<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
;;;; AST looks like using the `codegen` module.
2013-03-10 17:59:16 +01:00
(defn square [x]
"This function will square a number"
(* x x))
2013-03-10 20:17:16 +01:00
(print (square 2))
;; we even do some minor mangling:
;; (dashes turn to underscores)
;(defn add-two-numbers [x y]
; (+ x y))
;(print (add-two-numbers 1 2))
2013-03-10 20:39:27 +01:00
2013-03-10 20:17:16 +01:00
</textarea>
2013-03-10 20:30:49 +01:00
</div>
<div class='repl' id='python-repl'></div>
<div class='clear'></div>
<div class='msgs' id='build-msgs'></div>
2013-03-10 04:54:29 +01:00
{% endblock %}