-
Notifications
You must be signed in to change notification settings - Fork 1
/
nofile.coffee
33 lines (27 loc) · 1.01 KB
/
nofile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
util = require 'util'
nodoc = require './src/index.coffee'
kit = require 'nokit'
_ = require 'underscore'
$ = require('dracupid-no')(kit)
module.exports = (task) ->
task 'build', ->
$.coffee()
task 'doc', ->
data = {}
kit.readFile 'Readme.tpl'
.then (doc) ->
nodoc.generate './src/index.coffee', moduleName: ''
.then (api) ->
data.api = api
nodoc.generate './src/parser/index.coffee', moduleName: ''
.then (parser) ->
data.parser = parser
nodoc.generate './src/parser/coffee.coffee', moduleName: ''
.then (parserApi) ->
data.parserAPI = parserApi
data.alias = JSON.stringify require('./src/language/name'), null, 4
data.coffeeRule = util.inspect require('./src/parser/coffee').getRule()
_.template(doc + '') data
.then (md)->
kit.writeFile 'Readme.md', md
task 'default', ['build', 'doc']