html
head
body
h1 例えばCanvasだったらこうなる
canvas#canvas-chan(
width = 500
height = 500
)
script
:coffee
canvas = document.getElementById "canvas-chan"
c = canvas.getContext '2d'
w = c.canvas.width
h = c.canvas.height
c.strokeText "hello world from jade", w / 2, h / 2
gruntでプリコンパイル環境作って気付いた。
coffeescriptインストールしてないと通らないらしい。
そもそも
yahoo.jade
:coffee
console.log "hello"
これが
(function() {
console.log("hello");
})();
になる。実質coffeescriptファイルですね。
なので上のyahoo.jadeは
index.jade
html
head
body
script
include yahoo
読み込めます。