forked from jacobrask/styledocco
-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.js
34 lines (18 loc) · 1.23 KB
/
run.js
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
/*
StyleDocco (with haml and fixtures) and Paperboy
*/
(function() {
var dir, docs, fs, lib, optimist, options, path, server;
path = require('path');
fs = require('fs');
dir = path.dirname(fs.realpathSync(__filename));
lib = path.join(dir, './lib');
optimist = require('optimist');
server = require(lib + '/server.js');
docs = require(lib + '/main.js');
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] || './';
docs.run(options);
console.log(options);
if (options.server) server.start(options);
}).call(this);