forked from jashkenas/journo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCakefile
20 lines (15 loc) · 790 Bytes
/
Cakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{spawn, exec} = require 'child_process'
fs = require 'fs'
task "build", "watch and build the Journo source", ->
compiler = spawn 'coffee', ['-cw', '.']
compiler.stdout.on 'data', (data) -> console.log data.toString().trim()
compiler.stderr.on 'data', (data) -> console.error data.toString().trim()
task "doc", "generate documentation", ->
exec "docco -l linear journo.litcoffee"
# Until GitHub has proper Literate CoffeeScript highlighting support, let's
# manually futz the README ourselves.
task "readme", "rebuild the readme file", ->
source = fs.readFileSync('journo.litcoffee').toString()
source = source.replace /\n\n ([\s\S]*?)\n\n(?! )/mg, (match, code) ->
"\n```coffeescript\n#{code.replace(/^ /mg, '')}\n```\n"
fs.writeFileSync 'README.md', source