Skip to content

Commit

Permalink
Added -C/--nocode parameter to not provide source code with the API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Mar 5, 2012
1 parent f3961d3 commit 034fdc7
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 11 deletions.
6 changes: 4 additions & 2 deletions lib/builder.js
Expand Up @@ -412,7 +412,7 @@ YUI.add('doc-builder', function(Y) {
},
addFoundAt: function(a) {
var self = this;
if (a.file && a.line) {
if (a.file && a.line && !self.options.nocode) {
a.foundAt = 'files/' + self.filterFileName(a.file) + '.html#l' + a.line;
}
return a;
Expand Down Expand Up @@ -1231,7 +1231,9 @@ YUI.add('doc-builder', function(Y) {

self.writeModules(cstack.add(noop));
self.writeClasses(cstack.add(noop));
self.writeFiles(cstack.add(noop));
if (!self.options.nocode) {
self.writeFiles(cstack.add(noop));
}
self.writeIndex(cstack.add(noop));
self.writeAPIMeta(cstack.add(noop));

Expand Down
7 changes: 6 additions & 1 deletion lib/cli.js
Expand Up @@ -16,7 +16,8 @@ var Y = require('./index'),

var args = Y.Array(process.argv, 2),
options = {
port: 3000
port: 3000,
nocode: false
};

while (args.length > 0) {
Expand Down Expand Up @@ -49,6 +50,10 @@ while (args.length > 0) {
Y.config.useColor = false;
options.nocolor = true;
break;
case "-C":
case "--no-code":
options.nocode = true;
break;
case "-n":
case "--norecurse":
options.norecurse = true;
Expand Down
1 change: 1 addition & 0 deletions lib/help.js
Expand Up @@ -25,6 +25,7 @@ YUI.add('help', function(Y) {
" -v, --version Show the current YUIDoc version",
" --project-version Set the doc version for the template",
" -N, --no-color Turn off terminal colors (for automation)",
" -C, --no-code Turn off code generation (don't include source files in output)",
" -n, --norecurse Do not recurse directories (default is to recurse)",
" -S, --selleck Look for Selleck component data and attach to API meta data",
" -V, --view Dump the Handlebars.js view data instead of writing template files",
Expand Down
12 changes: 10 additions & 2 deletions themes/default/partials/attrs.handlebars
Expand Up @@ -25,7 +25,9 @@
<a href="{{overwritten_from/class}}.html#attr_{{overwritten_from/name}}">
{{overwritten_from/class}}
</a>
{{#if foundAt}}
but overwritten in
{{/if}}
{{else}}
{{#if extended_from}}
<p>Inherited from
Expand All @@ -34,10 +36,16 @@
{{#providedBy}}
<p>Provided by the <a href="../modules/{{.}}.html">{{.}}</a> module.</p>
{{/providedBy}}
<p>Defined in
<p>
{{#if foundAt}}
Defined in
{{/if}}
{{/if}}
{{/if}}
<a href="../{{foundAt}}">`{{{file}}}:{{{line}}}`</a></p>
{{#if foundAt}}
<a href="../{{foundAt}}">`{{{file}}}:{{{line}}}`</a>
{{/if}}
</p>

{{#if deprecationMessage}}
<p>Deprecated: {{deprecationMessage}}</p>
Expand Down
12 changes: 10 additions & 2 deletions themes/default/partials/events.handlebars
Expand Up @@ -24,7 +24,9 @@
<a href="{{overwritten_from/class}}.html#event_{{overwritten_from/name}}">
{{overwritten_from/class}}
</a>
{{#if foundAt}}
but overwritten in
{{/if}}
{{else}}
{{#if extended_from}}
<p>Inherited from
Expand All @@ -33,10 +35,16 @@
{{#providedBy}}
<p>Provided by the <a href="../modules/{{.}}.html">{{.}}</a> module.</p>
{{/providedBy}}
<p>Defined in
<p>
{{#if foundAt}}
Defined in
{{/if}}
{{/if}}
{{/if}}
<a href="../{{foundAt}}">`{{{file}}}:{{{line}}}`</a></p>
{{#if foundAt}}
<a href="../{{foundAt}}">`{{{file}}}:{{{line}}}`</a>
{{/if}}
</p>

{{#if deprecationMessage}}
<p>Deprecated: {{deprecationMessage}}</p>
Expand Down
13 changes: 11 additions & 2 deletions themes/default/partials/method.handlebars
Expand Up @@ -51,7 +51,9 @@
<a href="{{overwritten_from/class}}.html#method_{{overwritten_from/name}}">
{{overwritten_from/class}}
</a>
{{#if foundAt}}
but overwritten in
{{/if}}
{{else}}
{{#if extended_from}}
<p>Inherited from
Expand All @@ -60,10 +62,17 @@
{{#providedBy}}
<p>Provided by the <a href="../modules/{{.}}.html">{{.}}</a> module.</p>
{{/providedBy}}
<p>Defined in
<p>
{{#if foundAt}}
Defined in
{{/if}}
{{/if}}
{{/if}}
<a href="../{{foundAt}}">`{{{file}}}:{{{line}}}`</a></p>
{{#if foundAt}}
<a href="../{{foundAt}}">`{{{file}}}:{{{line}}}`</a>
{{/if}}
</p>


{{#if deprecationMessage}}
<p>Deprecated: {{deprecationMessage}}</p>
Expand Down
12 changes: 10 additions & 2 deletions themes/default/partials/props.handlebars
Expand Up @@ -24,7 +24,9 @@
<a href="{{overwritten_from/class}}.html#property_{{overwritten_from/name}}">
{{overwritten_from/class}}
</a>
{{#if foundAt}}
but overwritten in
{{/if}}
{{else}}
{{#if extended_from}}
<p>Inherited from
Expand All @@ -33,10 +35,16 @@
{{#providedBy}}
<p>Provided by the <a href="../modules/{{.}}.html">{{.}}</a> module.</p>
{{/providedBy}}
<p>Defined in
<p>
{{#if foundAt}}
Defined in
{{/if}}
{{/if}}
{{/if}}
<a href="../{{foundAt}}">`{{{file}}}:{{{line}}}`</a></p>
{{#if foundAt}}
<a href="../{{foundAt}}">`{{{file}}}:{{{line}}}`</a>
{{/if}}
</p>

{{#if deprecationMessage}}
<p>Deprecated: {{deprecationMessage}}</p>
Expand Down

0 comments on commit 034fdc7

Please sign in to comment.