mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Added @var @prop as synonyms for @property. Added configuration for jsVersion, to control the version of JavaScript that is parsable by rhino.
This commit is contained in:
parent
2c38b21159
commit
c6bae386ba
6
jsdoc.js
6
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);
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
f.signature = (f.signature || '') + '<span class="type-signature">'+htmlsafe(returnTypes.length? ' ⇒ '+returnTypes.join('|') : '')+'</span>';
|
||||
f.signature = (f.signature || '') + '<span class="type-signature">'+htmlsafe(returnTypes.length? ' → {'+returnTypes.join('|')+'}' : '')+'</span>';
|
||||
}
|
||||
|
||||
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);
|
||||
});
|
||||
@ -280,16 +279,19 @@
|
||||
var path = outdir + '/' + filename,
|
||||
html = containerTemplate.call(data, data);
|
||||
|
||||
html = helper.resolveLinks(html); // turn {@link foo} into <a href="foodoc.html">foo</a>
|
||||
|
||||
fs.writeFileSync(path, html)
|
||||
}
|
||||
}
|
||||
|
||||
function urlToLink(text) {
|
||||
var replacedText = text.replace(urlToLink.webUrl, '<a href="$1" target="_blank">$1</a>');
|
||||
function hashToLink(doclet, hash) {
|
||||
if ( !/^(#.+)/.test(hash) ) { return hash; }
|
||||
|
||||
return replacedText
|
||||
var url = helper.createLink(doclet);
|
||||
|
||||
url = url.replace(/(#.+|$)/, hash);
|
||||
return '<a href="'+url+'">'+hash+'</a>';
|
||||
}
|
||||
// looks like a URL starting with http:// or https://
|
||||
urlToLink.webUrl = /(\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim
|
||||
|
||||
})();
|
||||
@ -150,6 +150,13 @@ h6
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.ancestors { color: #999; }
|
||||
.ancestors a
|
||||
{
|
||||
color: #999 !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.important
|
||||
{
|
||||
font-weight: bold;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: <?js= title ?></title>
|
||||
|
||||
<script src="http://shjs.sourceforge.net/sh_main.min.js"> </script>
|
||||
@ -9,7 +9,6 @@
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="styles/node-dark.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -25,12 +24,11 @@
|
||||
<section>
|
||||
|
||||
<header>
|
||||
<?js
|
||||
print('<h2>');
|
||||
|
||||
<h2><?js
|
||||
if (doc.ancestors && doc.ancestors.length) {
|
||||
print('<span class="ancestors">'+doc.ancestors.join(' » ')+'</span>');
|
||||
print(' » '+doc.name);
|
||||
print('<span class="ancestors">');
|
||||
print( doc.ancestors.join(' ⟩ ') );
|
||||
print(' ⟩ </span>' + doc.name);
|
||||
}
|
||||
else {
|
||||
print(doc.name)
|
||||
@ -40,8 +38,8 @@
|
||||
print('<sup>'+doc.variation+'</sup>');
|
||||
}
|
||||
|
||||
print('</h2>');
|
||||
|
||||
?></h2>
|
||||
<?js
|
||||
if (doc.classdesc) {
|
||||
print('<p class="class-description">'+doc.classdesc+'</p>');
|
||||
}
|
||||
@ -193,14 +191,17 @@
|
||||
</section>
|
||||
<?js }); ?>
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<?js= nav ?>
|
||||
</nav>
|
||||
<br clear="both">
|
||||
<footer>
|
||||
Documentation generated by JSDoc 3 on <?js= (new Date()) ?>
|
||||
</footer>
|
||||
<script> sh_highlightDocument(); </script>
|
||||
|
||||
<br clear="both">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/micmath/jsdoc">JSDoc 3</a> on <?js= (new Date()) ?>
|
||||
</footer>
|
||||
|
||||
<script> sh_highlightDocument(); </script>
|
||||
</body>
|
||||
</html>
|
||||
5
test/cases/destructuring.js
Normal file
5
test/cases/destructuring.js
Normal file
@ -0,0 +1,5 @@
|
||||
/**
|
||||
A builder function for the Stick application;
|
||||
@var {function} Application
|
||||
*/
|
||||
var {Application} = require("stick");
|
||||
Loading…
x
Reference in New Issue
Block a user