diff --git a/main.js b/main.js index d68d6716..b3fe9106 100644 --- a/main.js +++ b/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 diff --git a/modules/jsdoc/tag/dictionary/definitions.js b/modules/jsdoc/tag/dictionary/definitions.js index a673658d..67be2c2c 100644 --- a/modules/jsdoc/tag/dictionary/definitions.js +++ b/modules/jsdoc/tag/dictionary/definitions.js @@ -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'); diff --git a/templates/default/publish.js b/templates/default/publish.js index 6120e4fe..9c233e09 100644 --- a/templates/default/publish.js +++ b/templates/default/publish.js @@ -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 diff --git a/templates/default/tmpl/index.mustache b/templates/default/tmpl/index.mustache index d9188b5d..b5ba8b80 100644 --- a/templates/default/tmpl/index.mustache +++ b/templates/default/tmpl/index.mustache @@ -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}}

Parameters:

- {{>param}} + {{>paramsTemplate}} {{/hasParams}} - {{#returns}} -

Returns:

-
    - {{>returns}} -
- {{/returns}} + {{#hasReturns}} +

Returns:

+ {{>returnsTemplate}} + {{/hasReturns}} {{/docs}} diff --git a/templates/default/tmpl/param.mustache b/templates/default/tmpl/param.mustache deleted file mode 100644 index 3d9a114d..00000000 --- a/templates/default/tmpl/param.mustache +++ /dev/null @@ -1,35 +0,0 @@ -
- {{#params}} - - - {{name}} - - -
-
- {{#type}} -
Type
-
{{#names}}{{#linkTo}}{{.}}{{/linkTo}}{{^last?}} | {{/last?}}{{#last?}} {{/last?}}{{/names}}
- {{/type}} - - {{#defaultvalue}} -
Default
-
{{defaultvalue}}
- {{/defaultvalue}} - - {{#optional}} -
Optional
-
Yes
- {{/optional}} - - {{#nullable}} -
Nullable
-
Yes
- {{/nullable}} -
- -
{{description}}
-
- - {{/params}} -
\ No newline at end of file diff --git a/templates/default/tmpl/params.mustache b/templates/default/tmpl/params.mustache new file mode 100644 index 00000000..5a59d1eb --- /dev/null +++ b/templates/default/tmpl/params.mustache @@ -0,0 +1,53 @@ +
+ {{#params}} + + + {{name}} + + +
+
+ {{#type}} +
+ Type +
+
+ {{#names}} + {{#linkTo}}{{.}}{{/linkTo}}{{^last?}} | {{/last?}}{{#last?}} {{/last?}} + {{/names}} +
+ {{/type}} + + {{#defaultvalue}} +
+ Default +
+
+ {{defaultvalue}} +
+ {{/defaultvalue}} + + {{#optional}} +
+ Optional +
+
Yes
+ {{/optional}} + + {{#nullable}} +
+ Nullable +
+
Yes
+ {{/nullable}} +
+ + {{#description}} +
+ {{description}} +
+ {{/description}} +
+ + {{/params}} +
\ No newline at end of file diff --git a/templates/default/tmpl/returns.mustache b/templates/default/tmpl/returns.mustache index 2c4b41ba..c9d1dc69 100644 --- a/templates/default/tmpl/returns.mustache +++ b/templates/default/tmpl/returns.mustache @@ -1,8 +1,28 @@ -
  • - {{#type}} - { - {{#names}}{{#linkTo}}{{.}}{{/linkTo}}{{^last?}} | {{/last?}}{{#last?}} {{/last?}}{{/names}} - } - {{/type}} - {{description}} -
  • +
    + {{#returns}} + + + +
    +
    + {{#type}} +
    + Type +
    +
    + {{#names}} + {{#linkTo}}{{.}}{{/linkTo}}{{^last?}} | {{/last?}}{{#last?}} {{/last?}} + {{/names}} +
    + {{/type}} +
    + + {{#description}} +
    + {{description}} +
    + {{/description}} +
    + + {{/returns}} +
    \ No newline at end of file