diff --git a/conf.json b/conf.json index 4978ae7f..2ff04b4c 100644 --- a/conf.json +++ b/conf.json @@ -9,6 +9,7 @@ }, "plugins": [ - ] + ], + "jsVersion": 180 } \ No newline at end of file diff --git a/jsdoc.js b/jsdoc.js index 6f2d5b81..3bf4a802 100644 --- a/jsdoc.js +++ b/jsdoc.js @@ -129,7 +129,6 @@ function exit(n) { java.lang.System.exit(n); } - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// @@ -161,6 +160,11 @@ function main() { env.opts.query = require('query').toObject(env.opts.query); } + // which version of javascript will be supported? (rhino only) + if (typeof version === 'function') { + version(env.conf.jsVersion || 180); + } + if (env.opts.help) { console.log( jsdoc.opts.parser.help() ); exit(0); diff --git a/rhino_modules/jsdoc/tag/dictionary/definitions.js b/rhino_modules/jsdoc/tag/dictionary/definitions.js index 95815693..783e6403 100644 --- a/rhino_modules/jsdoc/tag/dictionary/definitions.js +++ b/rhino_modules/jsdoc/tag/dictionary/definitions.js @@ -221,6 +221,7 @@ setDocletNameToValue(doclet, tag); } }) + .synonym('func') .synonym('method'); dictionary.defineTag('global', { @@ -332,7 +333,9 @@ doclet.type = tag.value.type; } } - }); + }) + .synonym('prop') + .synonym('var'); dictionary.defineTag('protected', { mustNotHaveValue: true, diff --git a/templates/default/publish.js b/templates/default/publish.js index ae99d8ad..ddaec7d7 100644 --- a/templates/default/publish.js +++ b/templates/default/publish.js @@ -75,7 +75,7 @@ }); } - f.signature = (f.signature || '') + ''+htmlsafe(returnTypes.length? ' ⇒ '+returnTypes.join('|') : '')+''; + f.signature = (f.signature || '') + ''+htmlsafe(returnTypes.length? ' → {'+returnTypes.join('|')+'}' : '')+''; } function addSignatureType(f) { @@ -110,9 +110,9 @@ var packageInfo = (data.get( data.find({kind: 'package'}) ) || []) [0]; - function renderLinks(text) { - return helper.resolveLinks(text); - } + //function renderLinks(text) { + // return helper.resolveLinks(text); + //} data.forEach(function(doclet) { doclet.signature = ''; @@ -146,8 +146,7 @@ } else if (doclet.see) { doclet.see.forEach(function(seeItem, i) { - doclet.see[i] = urlToLink(seeItem); - doclet.see[i] = renderLinks(doclet.see[i]); + doclet.see[i] = hashToLink(doclet, seeItem); }); } }); @@ -189,8 +188,8 @@ // do this after the urls have all been generated data.forEach(function(doclet) { - if (doclet.classdesc) doclet.classdesc = renderLinks(doclet.classdesc); - if (doclet.description) doclet.description = renderLinks(doclet.description); + //if (doclet.classdesc) doclet.classdesc = renderLinks(doclet.classdesc); + //if (doclet.description) doclet.description = renderLinks(doclet.description); doclet.ancestors = generateAncestry(doclet); }); @@ -279,17 +278,20 @@ var path = outdir + '/' + filename, html = containerTemplate.call(data, data); - + + html = helper.resolveLinks(html); // turn {@link foo} into foo + fs.writeFileSync(path, html) } } - function urlToLink(text) { - var replacedText = text.replace(urlToLink.webUrl, '$1'); - - return replacedText + function hashToLink(doclet, hash) { + if ( !/^(#.+)/.test(hash) ) { return hash; } + + var url = helper.createLink(doclet); + + url = url.replace(/(#.+|$)/, hash); + return ''+hash+''; } - // looks like a URL starting with http:// or https:// - urlToLink.webUrl = /(\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim })(); \ No newline at end of file diff --git a/templates/default/static/styles/jsdoc-default.css b/templates/default/static/styles/jsdoc-default.css index 23a79857..8b1736a1 100644 --- a/templates/default/static/styles/jsdoc-default.css +++ b/templates/default/static/styles/jsdoc-default.css @@ -150,6 +150,13 @@ h6 font-style: italic; } +.ancestors { color: #999; } +.ancestors a +{ + color: #999 !important; + text-decoration: none; +} + .important { font-weight: bold; diff --git a/templates/default/tmpl/container.tmpl b/templates/default/tmpl/container.tmpl index edc6ebf1..811602a3 100644 --- a/templates/default/tmpl/container.tmpl +++ b/templates/default/tmpl/container.tmpl @@ -1,7 +1,7 @@ - + - + JSDoc: <?js= title ?> @@ -9,198 +9,199 @@ -
- -

- - - -
- -
- '); - if (doc.ancestors && doc.ancestors.length) { - print(''+doc.ancestors.join(' » ')+''); - print(' » '+doc.name); +

+ + + +
+ +
+

'); + print( doc.ancestors.join(' ⟩ ') ); + print(' ⟩ ' + doc.name); + } + else { + print(doc.name) + } + + if (doc.variation) { + print(''+doc.variation+''); + } + + ?>

+ '+doc.classdesc+'

'); + } + ?> +
+ +
+ ' + doc.description + '

'); + } + + print(render('details.tmpl', doc)); + + if (doc.examples && doc.examples.length) { + print('

Example' + (doc.examples.length > 1? 's':'') + '

'); + print( render('examples.tmpl', doc.examples) ); + } } - - if (doc.variation) { - print(''+doc.variation+''); - } - - print(''); - - if (doc.classdesc) { - print('

'+doc.classdesc+'

'); - } - ?> -
- -
- ' + doc.description + '

'); - } - - print(render('details.tmpl', doc)); - - if (doc.examples && doc.examples.length) { - print('

Example' + (doc.examples.length > 1? 's':'') + '

'); - print( render('examples.tmpl', doc.examples) ); - } - } - ?> - - -

Extends

- -
    -
  • -
- - - -

Requires

-
    -
  • -
- - - - -

Classes

- -
Extends + +
    +
  • +
+ -
-
+
- - - - - -

Namespaces

- -
-
-
+

Requires

+ +
    +
  • +
+ +
+ var classes = find({kind: 'class', memberof: doc.longname}); + if (doc.kind !== 'globalobj' && classes && classes.length) { + ?> + +

Classes

+ +
+
+
+
+ + - + + +

Namespaces

+ +
+
+
+
+ + + + + +

Properties

+ +
+ + + + + +

Methods

+ +
+ + + + + +

Events

+ +
+ +
- - -

Properties

- -
- - - - - -

Methods

- -
- - - - - -

Events

- -
- - - -
- + +
+ -
- - +
+ + + + \ No newline at end of file diff --git a/test/cases/destructuring.js b/test/cases/destructuring.js new file mode 100644 index 00000000..2b13f928 --- /dev/null +++ b/test/cases/destructuring.js @@ -0,0 +1,5 @@ +/** + A builder function for the Stick application; + @var {function} Application + */ +var {Application} = require("stick"); \ No newline at end of file