Permalink
Browse files

Fixes #156 -- re-enable programmatic usage

  • Loading branch information...
1 parent 74f7316 commit bd041a17a976b31ba1b48cdc1ba8b6a81c581d39 @jashkenas committed Mar 18, 2013
Showing with 14 additions and 6 deletions.
  1. +6 −2 docco.js
  2. +4 −2 docco.litcoffee
  3. +4 −2 index.html
View
Oops, something went wrong.
View
@@ -73,7 +73,9 @@ assets, reading all the source files in, splitting them up into prose+code
sections, highlighting each file in the appropriate language, and printing them
out in an HTML template.
- document = ->
+ document = (options = {}) ->
+ configure options
+
exec "mkdir -p #{config.output}", ->
exec "cp -f #{config.css} #{config.output}"
@@ -274,7 +276,7 @@ Parse options using [Commander](https://github.com/visionmedia/commander.js).
.parse(args)
.name = "docco"
if commander.args.length
- document configure commander
+ document commander
else
console.log commander.helpInformation()
View
@@ -112,7 +112,9 @@
</p>
- <div class='highlight'><pre><span class="function"><span class="title">document</span></span> = -&gt;
+ <div class='highlight'><pre><span class="function"><span class="title">document</span></span> = (options = {}) -&gt;
+ configure options
+
exec <span class="string">"mkdir -p <span class="subst">#{config.output}</span>"</span>, -&gt;
exec <span class="string">"cp -f <span class="subst">#{config.css}</span> <span class="subst">#{config.output}</span>"</span>
@@ -391,7 +393,7 @@
.parse(args)
.name = <span class="string">"docco"</span>
<span class="keyword">if</span> commander.args.length
- document configure commander
+ document commander
<span class="keyword">else</span>
console.log commander.helpInformation()</pre></div>

0 comments on commit bd041a1

Please sign in to comment.