mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Update to default template to show property attributes.
This commit is contained in:
parent
9f58b0fed1
commit
3fb43f45c2
@ -27,20 +27,28 @@
|
||||
|
||||
json = JSON.parse(json);
|
||||
|
||||
/** The name of this package. */
|
||||
/** The name of this package.
|
||||
@type {string}
|
||||
*/
|
||||
this.name = json.name;
|
||||
|
||||
/** The longname of this package. */
|
||||
/** The longname of this package.
|
||||
@type {string}
|
||||
*/
|
||||
this.longname = this.kind + ':' + this.name;
|
||||
|
||||
/** The description of this package. */
|
||||
/** The description of this package.
|
||||
@type {string}
|
||||
*/
|
||||
this.description = json.description;
|
||||
|
||||
/** The version of this package. */
|
||||
/** The version of this package.
|
||||
@type {string}
|
||||
*/
|
||||
this.version = json.version;
|
||||
|
||||
/** The licenses of this package.
|
||||
|
||||
@type {Array<Object>}
|
||||
@example
|
||||
"licenses": [
|
||||
{
|
||||
|
||||
@ -45,6 +45,8 @@
|
||||
|
||||
data.remove({undocumented: true});
|
||||
|
||||
var packageInfo = (data.get( data.find({kind: 'package'}) ) || []) [0];
|
||||
|
||||
// add template helpers
|
||||
data.forEach(function(doclet) {
|
||||
doclet.hasParams = doclet.params && doclet.params.length > 0;
|
||||
@ -160,13 +162,16 @@
|
||||
}
|
||||
|
||||
var outdir = opts.destination;
|
||||
if (packageInfo) {
|
||||
outdir += '/' + packageInfo.name + '/' + packageInfo.version + '/';
|
||||
}
|
||||
fs.mkPath(outdir);
|
||||
|
||||
// containers
|
||||
generate('Modules', modules, 'modules.html');
|
||||
generate('Classes', classes, 'classes.html');
|
||||
generate('Namespaces', namespaces, 'namespaces.html');
|
||||
|
||||
|
||||
function generate(title, docs, filename) {
|
||||
var path = outdir + '/' + filename,
|
||||
html = Mustache.to_html(
|
||||
|
||||
@ -3,6 +3,43 @@
|
||||
<h4 class="property-title">{{name}}</h4>
|
||||
</dt>
|
||||
<dd>
|
||||
{{#summary}}<p class="shortDesc">{{{summary}}}</p>{{/summary}}
|
||||
<dl class="type-details">
|
||||
{{#summary}}
|
||||
<dt>
|
||||
Summary
|
||||
</dt>
|
||||
<dd>
|
||||
{{{summary}}}
|
||||
</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>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user