mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Made returns property an array.
This commit is contained in:
parent
bedb2d749d
commit
a0cb357397
1
main.js
1
main.js
@ -16,6 +16,7 @@ const BASEDIR = arguments[0].replace(/([\/\\])main\.js$/, '$1'); // jsdoc.jar se
|
||||
|
||||
/** Include a JavaScript module, defined in the CommonJS way.
|
||||
@param {string} id The identifier of the module you require.
|
||||
@returns {mixed} The value exported by the module.
|
||||
@see http://wiki.commonjs.org/wiki/Modules/1.1
|
||||
*/
|
||||
function require(id) { // like commonjs
|
||||
|
||||
@ -304,7 +304,8 @@
|
||||
mustHaveValue: true,
|
||||
canHaveType: true,
|
||||
onTagged: function(doclet, tag) {
|
||||
doclet.returns = tag.value;
|
||||
if (!doclet.returns) { doclet.returns = []; }
|
||||
doclet.returns.push(tag.value);
|
||||
}
|
||||
})
|
||||
.synonym('return');
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
var out = '',
|
||||
templateSource = {
|
||||
index: readFile(BASEDIR + 'templates/default/tmpl/index.mustache'),
|
||||
param: readFile(BASEDIR + 'templates/default/tmpl/param.mustache'),
|
||||
returns: readFile(BASEDIR + 'templates/default/tmpl/returns.mustache')
|
||||
paramsTemplate: readFile(BASEDIR + 'templates/default/tmpl/params.mustache'),
|
||||
returnsTemplate: readFile(BASEDIR + 'templates/default/tmpl/returns.mustache')
|
||||
};
|
||||
|
||||
var helpers = {
|
||||
@ -52,16 +52,17 @@
|
||||
// add template helpers
|
||||
data.forEach(function(doclet) {
|
||||
doclet.hasParams = doclet.params && doclet.params.length > 0;
|
||||
doclet.hasReturns = doclet.returns && doclet.returns.length > 0;
|
||||
doclet.hasBorrowed = doclet.borrowed && doclet.borrowed.length > 0;
|
||||
|
||||
|
||||
summarize(doclet);
|
||||
});
|
||||
|
||||
data.orderBy(['longname', 'kind']);
|
||||
|
||||
var partials = {
|
||||
param: templateSource.param,
|
||||
returns: templateSource.returns
|
||||
paramsTemplate: templateSource.paramsTemplate,
|
||||
returnsTemplate: templateSource.returnsTemplate
|
||||
};
|
||||
|
||||
// apply template
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
font-family: verdana, sans-serif;
|
||||
/*overflow: hidden;*/
|
||||
zoom: 1;
|
||||
background: url(images/pagebg.png) 0 73px repeat-x;
|
||||
/*background: url(images/pagebg.png) 0 73px repeat-x;*/
|
||||
color: #333333;
|
||||
}
|
||||
a:link, a:visited {
|
||||
@ -70,8 +70,8 @@
|
||||
border-bottom: 1px dotted #356a8b;
|
||||
}
|
||||
a:hover, a:active {
|
||||
color: #3B607B;
|
||||
border-color: #3B607B;
|
||||
color: #298FB2;
|
||||
border-color: #298FB2;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
a.image {
|
||||
@ -94,7 +94,7 @@
|
||||
}
|
||||
h4 {
|
||||
margin: 1em 0;
|
||||
color: #3B607B;
|
||||
color: #298FB2;
|
||||
}
|
||||
h5 {
|
||||
margin: 1em 0;
|
||||
@ -106,7 +106,7 @@
|
||||
|
||||
dl.params dt {
|
||||
border-top: 1px solid #b2b1b1;
|
||||
color: #3B607B;
|
||||
color: #298FB2;
|
||||
font-weight: bold;
|
||||
padding-top: 8px;
|
||||
margin-bottom: 5px;
|
||||
@ -193,15 +193,13 @@
|
||||
|
||||
{{#hasParams}}
|
||||
<h3>Parameters:</h3>
|
||||
{{>param}}
|
||||
{{>paramsTemplate}}
|
||||
{{/hasParams}}
|
||||
|
||||
{{#returns}}
|
||||
<h3>Returns:</h3>
|
||||
<ol class="returns detail-list">
|
||||
{{>returns}}
|
||||
</ol>
|
||||
{{/returns}}
|
||||
{{#hasReturns}}
|
||||
<h3>Returns:</h3>
|
||||
{{>returnsTemplate}}
|
||||
{{/hasReturns}}
|
||||
</div>
|
||||
</div>
|
||||
{{/docs}}
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
<dl class="params detail-list">
|
||||
{{#params}}
|
||||
|
||||
<dt{{#first?}} class="first"{{/first?}}>
|
||||
<span class="param-name">{{name}}</span>
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
<dl class="param-properties">
|
||||
{{#type}}
|
||||
<dt><span>Type</span></dt>
|
||||
<dd>{{#names}}<span class="param-type">{{#linkTo}}{{.}}{{/linkTo}}</span>{{^last?}} | {{/last?}}{{#last?}} {{/last?}}{{/names}}</dd>
|
||||
{{/type}}
|
||||
|
||||
{{#defaultvalue}}
|
||||
<dt><span>Default</span></dt>
|
||||
<dd>{{defaultvalue}}</dd>
|
||||
{{/defaultvalue}}
|
||||
|
||||
{{#optional}}
|
||||
<dt><span>Optional</span></dt>
|
||||
<dd class="yesDef">Yes</dd>
|
||||
{{/optional}}
|
||||
|
||||
{{#nullable}}
|
||||
<dt><span>Nullable</span></dt>
|
||||
<dd class="yesDef">Yes</dd>
|
||||
{{/nullable}}
|
||||
</dl>
|
||||
|
||||
<div class="param-desc">{{description}}</div>
|
||||
</dd>
|
||||
|
||||
{{/params}}
|
||||
</dl>
|
||||
53
templates/default/tmpl/params.mustache
Normal file
53
templates/default/tmpl/params.mustache
Normal file
@ -0,0 +1,53 @@
|
||||
<dl class="params detail-list">
|
||||
{{#params}}
|
||||
|
||||
<dt{{#first?}} class="first"{{/first?}}>
|
||||
<span class="param-name">{{name}}</span>
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
<dl class="param-properties">
|
||||
{{#type}}
|
||||
<dt>
|
||||
<span>Type</span>
|
||||
</dt>
|
||||
<dd>
|
||||
{{#names}}
|
||||
<span class="param-type">{{#linkTo}}{{.}}{{/linkTo}}</span>{{^last?}} | {{/last?}}{{#last?}} {{/last?}}
|
||||
{{/names}}
|
||||
</dd>
|
||||
{{/type}}
|
||||
|
||||
{{#defaultvalue}}
|
||||
<dt>
|
||||
<span>Default</span>
|
||||
</dt>
|
||||
<dd>
|
||||
{{defaultvalue}}
|
||||
</dd>
|
||||
{{/defaultvalue}}
|
||||
|
||||
{{#optional}}
|
||||
<dt>
|
||||
<span>Optional</span>
|
||||
</dt>
|
||||
<dd class="yesDef">Yes</dd>
|
||||
{{/optional}}
|
||||
|
||||
{{#nullable}}
|
||||
<dt>
|
||||
<span>Nullable</span>
|
||||
</dt>
|
||||
<dd class="yesDef">Yes</dd>
|
||||
{{/nullable}}
|
||||
</dl>
|
||||
|
||||
{{#description}}
|
||||
<div class="param-desc">
|
||||
{{description}}
|
||||
</div>
|
||||
{{/description}}
|
||||
</dd>
|
||||
|
||||
{{/params}}
|
||||
</dl>
|
||||
@ -1,8 +1,28 @@
|
||||
<li>
|
||||
{{#type}}
|
||||
{
|
||||
{{#names}}<span class="returns-type">{{#linkTo}}{{.}}{{/linkTo}}</span>{{^last?}} | {{/last?}}{{#last?}} {{/last?}}{{/names}}
|
||||
}
|
||||
{{/type}}
|
||||
<span class="returns-desc">{{description}}</span>
|
||||
</li>
|
||||
<dl class="params detail-list">
|
||||
{{#returns}}
|
||||
|
||||
<dt{{#first?}} class="first"{{/first?}}></dt>
|
||||
|
||||
<dd>
|
||||
<dl class="param-properties">
|
||||
{{#type}}
|
||||
<dt>
|
||||
<span>Type</span>
|
||||
</dt>
|
||||
<dd>
|
||||
{{#names}}
|
||||
<span class="param-type">{{#linkTo}}{{.}}{{/linkTo}}</span>{{^last?}} | {{/last?}}{{#last?}} {{/last?}}
|
||||
{{/names}}
|
||||
</dd>
|
||||
{{/type}}
|
||||
</dl>
|
||||
|
||||
{{#description}}
|
||||
<div class="param-desc">
|
||||
{{description}}
|
||||
</div>
|
||||
{{/description}}
|
||||
</dd>
|
||||
|
||||
{{/returns}}
|
||||
</dl>
|
||||
Loading…
x
Reference in New Issue
Block a user