forked from thebeansgroup/styledocco-haml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.coffee
48 lines (37 loc) · 1.19 KB
/
run.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
###
StyleDocco (with haml and fixtures) and Paperboy
###
path = require 'path'
fs = require 'fs'
dir = path.dirname fs.realpathSync(__filename)
lib = path.join dir , './lib'
#
# Dependencies
#
optimist = require('optimist');
server = require( lib+'/server.js');
docs = require( lib+'/main.js');
#
# Configuration
#
options = optimist
.usage('Usage: $0 [options] [INPUT]')
.describe('name', 'Name of the project').alias('n', 'name').demand('name')
.describe('out', 'Output directory').alias('o', 'out').default('out', 'docs')
.describe('nocss', 'Hide CSS code pane').boolean('nocss').default('nocss', false)
.describe('tmpl', 'Template directory').default('tmpl', "#{__dirname}/resources/")
.describe('overwrite', 'Overwrite existing files in target dir').boolean('overwrite')
.describe('pass', 'Pass argument through to CSS preprocessor')
.describe('server', 'Run node server to display docs').alias('s', 'server').boolean('server').default('server', false)
.describe('port', 'Port to run paperboy').default('port', 3000)
.argv
options.in = options._[0] or './'
#
# Create docs
#
docs.run options
#
# run paperboy
#
console.log options
if options.server then server.start options