Update to default template to show property attributes.

This commit is contained in:
Michael Mathews 2011-02-05 11:31:02 +00:00
parent 9f58b0fed1
commit 3fb43f45c2
3 changed files with 58 additions and 8 deletions

View File

@ -27,20 +27,28 @@
json = JSON.parse(json); json = JSON.parse(json);
/** The name of this package. */ /** The name of this package.
@type {string}
*/
this.name = json.name; this.name = json.name;
/** The longname of this package. */ /** The longname of this package.
@type {string}
*/
this.longname = this.kind + ':' + this.name; this.longname = this.kind + ':' + this.name;
/** The description of this package. */ /** The description of this package.
@type {string}
*/
this.description = json.description; this.description = json.description;
/** The version of this package. */ /** The version of this package.
@type {string}
*/
this.version = json.version; this.version = json.version;
/** The licenses of this package. /** The licenses of this package.
@type {Array<Object>}
@example @example
"licenses": [ "licenses": [
{ {

View File

@ -45,6 +45,8 @@
data.remove({undocumented: true}); data.remove({undocumented: true});
var packageInfo = (data.get( data.find({kind: 'package'}) ) || []) [0];
// add template helpers // add template helpers
data.forEach(function(doclet) { data.forEach(function(doclet) {
doclet.hasParams = doclet.params && doclet.params.length > 0; doclet.hasParams = doclet.params && doclet.params.length > 0;
@ -160,6 +162,9 @@
} }
var outdir = opts.destination; var outdir = opts.destination;
if (packageInfo) {
outdir += '/' + packageInfo.name + '/' + packageInfo.version + '/';
}
fs.mkPath(outdir); fs.mkPath(outdir);
// containers // containers

View File

@ -3,6 +3,43 @@
<h4 class="property-title">{{name}}</h4> <h4 class="property-title">{{name}}</h4>
</dt> </dt>
<dd> <dd>
{{#summary}}<p class="shortDesc">{{{summary}}}</p>{{/summary}} <dl class="type-details">
{{#summary}}
<dt>
Summary
</dt>
<dd>
{{{summary}}}
</dd> </dd>
{{/summary}}
{{#type}}
<dt>
Type
</dt>
<dd>
{{#names}}
<span class="param-type">{{#linkTo}}{{.}}{{/linkTo}}</span>{{^last?}} | {{/last?}}{{#last?}} {{/last?}}
{{/names}}
</dd>
{{/type}}
{{#nullable}}
<dt>
Nullable
</dt>
<dd class="yesDef">
Yes
</dd>
{{/nullable}}
{{#defaultvalue}}
<dt>
Default Value
</dt>
<dd class="yesDef">
{{defaultvalue}}
</dd>
{{/defaultvalue}}
</dl>
</dd>