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);
|
java.lang.System.exit(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
|
||||||
|
|
||||||
@ -161,6 +160,11 @@ function main() {
|
|||||||
env.opts.query = require('query').toObject(env.opts.query);
|
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) {
|
if (env.opts.help) {
|
||||||
console.log( jsdoc.opts.parser.help() );
|
console.log( jsdoc.opts.parser.help() );
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|||||||
@ -221,6 +221,7 @@
|
|||||||
setDocletNameToValue(doclet, tag);
|
setDocletNameToValue(doclet, tag);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.synonym('func')
|
||||||
.synonym('method');
|
.synonym('method');
|
||||||
|
|
||||||
dictionary.defineTag('global', {
|
dictionary.defineTag('global', {
|
||||||
@ -332,7 +333,9 @@
|
|||||||
doclet.type = tag.value.type;
|
doclet.type = tag.value.type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.synonym('prop')
|
||||||
|
.synonym('var');
|
||||||
|
|
||||||
dictionary.defineTag('protected', {
|
dictionary.defineTag('protected', {
|
||||||
mustNotHaveValue: true,
|
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) {
|
function addSignatureType(f) {
|
||||||
@ -110,9 +110,9 @@
|
|||||||
|
|
||||||
var packageInfo = (data.get( data.find({kind: 'package'}) ) || []) [0];
|
var packageInfo = (data.get( data.find({kind: 'package'}) ) || []) [0];
|
||||||
|
|
||||||
function renderLinks(text) {
|
//function renderLinks(text) {
|
||||||
return helper.resolveLinks(text);
|
// return helper.resolveLinks(text);
|
||||||
}
|
//}
|
||||||
|
|
||||||
data.forEach(function(doclet) {
|
data.forEach(function(doclet) {
|
||||||
doclet.signature = '';
|
doclet.signature = '';
|
||||||
@ -146,8 +146,7 @@
|
|||||||
}
|
}
|
||||||
else if (doclet.see) {
|
else if (doclet.see) {
|
||||||
doclet.see.forEach(function(seeItem, i) {
|
doclet.see.forEach(function(seeItem, i) {
|
||||||
doclet.see[i] = urlToLink(seeItem);
|
doclet.see[i] = hashToLink(doclet, seeItem);
|
||||||
doclet.see[i] = renderLinks(doclet.see[i]);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -189,8 +188,8 @@
|
|||||||
|
|
||||||
// do this after the urls have all been generated
|
// do this after the urls have all been generated
|
||||||
data.forEach(function(doclet) {
|
data.forEach(function(doclet) {
|
||||||
if (doclet.classdesc) doclet.classdesc = renderLinks(doclet.classdesc);
|
//if (doclet.classdesc) doclet.classdesc = renderLinks(doclet.classdesc);
|
||||||
if (doclet.description) doclet.description = renderLinks(doclet.description);
|
//if (doclet.description) doclet.description = renderLinks(doclet.description);
|
||||||
|
|
||||||
doclet.ancestors = generateAncestry(doclet);
|
doclet.ancestors = generateAncestry(doclet);
|
||||||
});
|
});
|
||||||
@ -280,16 +279,19 @@
|
|||||||
var path = outdir + '/' + filename,
|
var path = outdir + '/' + filename,
|
||||||
html = containerTemplate.call(data, data);
|
html = containerTemplate.call(data, data);
|
||||||
|
|
||||||
|
html = helper.resolveLinks(html); // turn {@link foo} into <a href="foodoc.html">foo</a>
|
||||||
|
|
||||||
fs.writeFileSync(path, html)
|
fs.writeFileSync(path, html)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function urlToLink(text) {
|
function hashToLink(doclet, hash) {
|
||||||
var replacedText = text.replace(urlToLink.webUrl, '<a href="$1" target="_blank">$1</a>');
|
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;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ancestors { color: #999; }
|
||||||
|
.ancestors a
|
||||||
|
{
|
||||||
|
color: #999 !important;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
.important
|
.important
|
||||||
{
|
{
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta charset="utf-8">
|
||||||
<title>JSDoc: <?js= title ?></title>
|
<title>JSDoc: <?js= title ?></title>
|
||||||
|
|
||||||
<script src="http://shjs.sourceforge.net/sh_main.min.js"> </script>
|
<script src="http://shjs.sourceforge.net/sh_main.min.js"> </script>
|
||||||
@ -9,28 +9,26 @@
|
|||||||
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/node-dark.css">
|
<link type="text/css" rel="stylesheet" href="styles/node-dark.css">
|
||||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<h1 class="page-title"><?js= title ?></h1>
|
<h1 class="page-title"><?js= title ?></h1>
|
||||||
|
|
||||||
<?js
|
|
||||||
docs.forEach(function(doc, i) {
|
|
||||||
?>
|
|
||||||
|
|
||||||
<section>
|
|
||||||
|
|
||||||
<header>
|
|
||||||
<?js
|
<?js
|
||||||
print('<h2>');
|
docs.forEach(function(doc, i) {
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<h2><?js
|
||||||
if (doc.ancestors && doc.ancestors.length) {
|
if (doc.ancestors && doc.ancestors.length) {
|
||||||
print('<span class="ancestors">'+doc.ancestors.join(' » ')+'</span>');
|
print('<span class="ancestors">');
|
||||||
print(' » '+doc.name);
|
print( doc.ancestors.join(' ⟩ ') );
|
||||||
|
print(' ⟩ </span>' + doc.name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print(doc.name)
|
print(doc.name)
|
||||||
@ -40,15 +38,15 @@
|
|||||||
print('<sup>'+doc.variation+'</sup>');
|
print('<sup>'+doc.variation+'</sup>');
|
||||||
}
|
}
|
||||||
|
|
||||||
print('</h2>');
|
?></h2>
|
||||||
|
<?js
|
||||||
if (doc.classdesc) {
|
if (doc.classdesc) {
|
||||||
print('<p class="class-description">'+doc.classdesc+'</p>');
|
print('<p class="class-description">'+doc.classdesc+'</p>');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<article>
|
<article>
|
||||||
<?js
|
<?js
|
||||||
if (doc.kind === 'module' && doc.module) {
|
if (doc.kind === 'module' && doc.module) {
|
||||||
print(render('method.tmpl', doc.module));
|
print(render('method.tmpl', doc.module));
|
||||||
@ -188,19 +186,22 @@
|
|||||||
});
|
});
|
||||||
?></dl>
|
?></dl>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
<?js }); ?>
|
<?js }); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<?js= nav ?>
|
<?js= nav ?>
|
||||||
</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>
|
</body>
|
||||||
</html>
|
</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