Adding in better makefiles.

This commit is contained in:
Paul R. Tagliamonte 2013-03-10 15:17:16 -04:00
parent cbf9aa17c4
commit 016e8a59a0
7 changed files with 82 additions and 12 deletions

View File

@ -1,9 +1,8 @@
#
LESSC = lessc
LESSCFLAGS = -x
STATIC = static
STATIC_CSS = $(STATIC)/css
STATIC_JS = $(STATIC)/js
all: build
@ -12,11 +11,15 @@ all: build
build: clean less coffee
less:
$(LESSC) $(LESSCFLAGS) less/hy.less > $(STATIC_CSS)/hy.css
make -C less
mv less/*css $(STATIC_CSS)
coffee:
coffee -o static/js -c ./coffee/*
make -C coffee
mv coffee/*js $(STATIC_JS)
clean:
rm -f $(STATIC_CSS)/hy.css

18
site/coffee/Makefile Normal file
View File

@ -0,0 +1,18 @@
.SUFFIXES:
.SUFFIXES: .coffee .js
COFFEE_SCRIPTS = main.js
all: build
build: $(COFFEE_SCRIPTS)
.coffee.js:
coffee -c $<
uglifyjs --no-copyright --overwrite $@
.PHONY: build

View File

@ -1,6 +1,18 @@
foo = (x) ->
if x < 2
return x
foo(x - 1) + foo(x - 2)
reload = ->
input = $("#repl-input").val()
$('#repl-output').load('/hy2pycol', {'code': input})
alert(foo(10))
$(document).ready(->
count = 0
$("#repl-input").keyup((e) ->
curcount = 0
count += 1
curcount = count
window.setTimeout(->
if curcount == count
console.log("trigger")
reload()
, 500)
)
reload()
);

21
site/less/Makefile Normal file
View File

@ -0,0 +1,21 @@
LESS_SCRIPTS = hy.css
LESSC = lessc
LESSCFLAGS = -x
STATIC = static
.SUFFIXES:
.SUFFIXES: .less .css
all: build
build: $(LESS_SCRIPTS)
.less.css:
$(LESSC) $(LESSCFLAGS) $< > $@
.PHONY: build

View File

@ -2,5 +2,5 @@
* terms and conditions of Hy it's self. */
body {
color: #DFCDCDC;
}

View File

@ -8,8 +8,11 @@
<link
rel="stylesheet"
href="{{ url_for("static", filename="css/hy.css") }}" ></link>
<script src="{{ url_for("static", filename="js/jquery-1.9.1.min.js") }}"
type="text/javascript" ></script>
<script src="{{ url_for("static", filename="js/main.js") }}"
type="text/javascript" ></script>
</head>
<body>
{% block content %}

View File

@ -4,8 +4,21 @@
{% block content %}
{% autoescape off %}{% code "clojure" %}
{# {% autoescape off %}{% code "clojure" %}
(print "foo bar")
{% endcode %}{% endautoescape %}
{% endcode %}{% endautoescape %} #}
<div class = 'repl' >
<textarea id = 'repl-input' class = 'repl-pane repl-left' >
(defn square [x]
(* x x))
(print (square 4))
</textarea>
<pre
id = 'repl-output'
class = 'repl-pane repl-right'
></pre>
</div>
{% endblock %}