mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
11 lines
514 B
CoffeeScript
11 lines
514 B
CoffeeScript
fs = require 'fs'
|
|
_ = require 'underscore'
|
|
CoffeeScript = require '../../lib/coffee-script'
|
|
|
|
|
|
module.exports = ->
|
|
(file, run = no) ->
|
|
cs = fs.readFileSync "documentation/examples/#{file}.coffee", 'utf-8'
|
|
js = CoffeeScript.compile cs, bare: yes # This is just the initial JavaScript output; it is replaced by dynamic compilation on changes of the CoffeeScript pane
|
|
render = _.template fs.readFileSync('documentation/v2/code.html', 'utf-8')
|
|
output = render {file, cs, js, run}
|