mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Better handling of multiple variations with the same name.
This commit is contained in:
parent
8ccb4189a3
commit
7ae6d436ad
@ -446,6 +446,13 @@
|
||||
}
|
||||
});
|
||||
|
||||
dictionary.defineTag('variation', {
|
||||
mustHaveValue: true,
|
||||
onTagged: function(doclet, tag) {
|
||||
doclet.variation = tag.value;
|
||||
}
|
||||
});
|
||||
|
||||
dictionary.defineTag('version', {
|
||||
mustHaveValue: true,
|
||||
onTagged: function(doclet, tag) {
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
|
||||
function linkto(longname, linktext) {
|
||||
var url = longnameToUrl[longname];
|
||||
return url? '<a href="'+url+'">'+linktext+'</a>' : (linktext || longname);
|
||||
return url? '<a href="'+url+'">'+(linktext || longname)+'</a>' : (linktext || longname);
|
||||
}
|
||||
|
||||
var urlToLongname = {},
|
||||
|
||||
@ -41,10 +41,14 @@ section
|
||||
|
||||
background-color: #fff;
|
||||
padding: 12px 24px;
|
||||
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin-right: 240px;
|
||||
}
|
||||
|
||||
sup {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
nav
|
||||
{
|
||||
display: block;
|
||||
@ -92,6 +96,7 @@ footer {
|
||||
padding: 6px;
|
||||
margin-top: 12px;
|
||||
font-style: italic;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
h1
|
||||
@ -151,8 +156,8 @@ h6
|
||||
color: #950B02;
|
||||
}
|
||||
|
||||
.ancestor-name {
|
||||
color: #ccc;
|
||||
.yes-def {
|
||||
text-indent: -1000px;
|
||||
}
|
||||
|
||||
.type-signature {
|
||||
|
||||
@ -26,15 +26,14 @@
|
||||
|
||||
<header>
|
||||
<?js
|
||||
if (doc.variation) {
|
||||
print('<h2 id="'+doc.variation+'" class="variation">'+doc.name+'<sup>'+doc.variation+'</sup></h2>');
|
||||
}
|
||||
|
||||
if (doc.classdesc) {
|
||||
print('<p class="class-description">'+doc.classdesc+'</p>');
|
||||
}
|
||||
?>
|
||||
|
||||
<!--
|
||||
var displayname = htmlsafe(doc.longname).replace(doc.name, '</span><b>'+doc.name+'</b>');
|
||||
/*print('<span class="ancestor-name">' + displayname + doc.signature);*/
|
||||
-->
|
||||
</header>
|
||||
|
||||
<article>
|
||||
@ -42,12 +41,13 @@
|
||||
if (doc.kind === 'class') {
|
||||
print(render('method.tmpl', doc));
|
||||
}
|
||||
|
||||
else {
|
||||
if (doc.description) {
|
||||
print('<p class="description">' + doc.description + '</p>');
|
||||
}
|
||||
|
||||
print(render('details.tmpl', doc));
|
||||
|
||||
if (doc.examples && doc.examples.length) {
|
||||
print('<h3>Example' + (doc.examples.length > 1? 's':'') + '</h3>');
|
||||
print( render('examples.tmpl', doc.examples) );
|
||||
@ -71,11 +71,6 @@
|
||||
}
|
||||
?>
|
||||
|
||||
<h3 class="subsection-title">Details</h3>
|
||||
<?js
|
||||
print(render('details.tmpl', doc));
|
||||
?>
|
||||
|
||||
<?js
|
||||
if (doc.requires && doc.requires.length) {
|
||||
?>
|
||||
@ -192,8 +187,8 @@
|
||||
print(render('method.tmpl', e));
|
||||
});
|
||||
?></dl>
|
||||
</article>
|
||||
<?js } ?>
|
||||
</article>
|
||||
|
||||
</section>
|
||||
<?js }); ?>
|
||||
@ -203,7 +198,7 @@
|
||||
</nav>
|
||||
<br clear="both">
|
||||
<footer>
|
||||
Generated by JSDoc 3 at <?js= (new Date()) ?>
|
||||
Documentation generated by JSDoc 3 on <?js= (new Date()) ?>
|
||||
</footer>
|
||||
<script> sh_highlightDocument(); </script>
|
||||
|
||||
|
||||
@ -9,10 +9,13 @@
|
||||
<dd><?js= since ?></dd>
|
||||
<?js } ?>
|
||||
|
||||
<?js if (this.deprecated) {?>
|
||||
<dt>Deprecated:</dt>
|
||||
<dd class="yesDef">Yes</dd>
|
||||
<?js } ?>
|
||||
<?js if (this.deprecated) { ?>
|
||||
<dt class="important">Deprecated<?js
|
||||
if (this.deprecated === true) print('</dt><dd class="yes-def">Yes</dd>');
|
||||
else print(':</dt><dd>'+this.deprecated+'</dd>');
|
||||
?>
|
||||
|
||||
<?js } ?>
|
||||
|
||||
<?js if (this.author) {?>
|
||||
<dt>Author:</dt>
|
||||
@ -37,7 +40,7 @@
|
||||
<dd>
|
||||
<ul><?js
|
||||
see.forEach(function(s) {
|
||||
print('<li>'+s+'</li>');
|
||||
print('<li>'+linkto(s)+'</li>');
|
||||
});
|
||||
?></ul>
|
||||
</dd>
|
||||
|
||||
@ -14,29 +14,7 @@
|
||||
</p>
|
||||
<?js } ?>
|
||||
|
||||
<?js if (this.version || this.deprecated || this.since) { ?>
|
||||
<dl>
|
||||
<?js if (this.version) { ?>
|
||||
<dt>Version</dt>
|
||||
<dd><?js= this.version ?></dd>
|
||||
<?js } ?>
|
||||
|
||||
<?js if (this.deprecated) { ?>
|
||||
<dt class="important">Deprecated</dt>
|
||||
<?js
|
||||
if (this.deprecated === true) print('<dd class="yesDef">Yes</dd>');
|
||||
else print('<dd>'+this.deprecated+'</dd>');
|
||||
?>
|
||||
|
||||
<?js } ?>
|
||||
|
||||
<?js if (this.since) { ?>
|
||||
<dt>Since</dt>
|
||||
<dd><?js= this.since ?></dd>
|
||||
<?js } ?>
|
||||
</dl>
|
||||
<?js } ?>
|
||||
|
||||
<?js print(render('details.tmpl', this)); ?>
|
||||
|
||||
|
||||
<?js
|
||||
|
||||
@ -13,33 +13,7 @@
|
||||
</p>
|
||||
<?js } ?>
|
||||
|
||||
<?js if (this.version || this.deprecated || this.since || typeof this.defaultvalue !== 'undefined') { ?>
|
||||
<dl>
|
||||
<?js if (this.version) { ?>
|
||||
<dt>Version</dt>
|
||||
<dd><?js= this.version ?></dd>
|
||||
<?js } ?>
|
||||
|
||||
<?js if (this.deprecated) { ?>
|
||||
<dt class="important">Deprecated</dt>
|
||||
<?js
|
||||
if (this.deprecated === true) print('<dd class="yesDef">Yes</dd>');
|
||||
else print('<dd>'+this.deprecated+'</dd>');
|
||||
?>
|
||||
|
||||
<?js } ?>
|
||||
|
||||
<?js if (this.since) { ?>
|
||||
<dt>Since</dt>
|
||||
<dd><?js= this.since ?></dd>
|
||||
<?js } ?>
|
||||
|
||||
<?js if (typeof this.defaultvalue !== 'undefined') { ?>
|
||||
<dt>Default Value</dt>
|
||||
<dd><?js= this.defaultvalue ?></dd>
|
||||
<?js } ?>
|
||||
</dl>
|
||||
<?js } ?>
|
||||
<?js print(render('details.tmpl', this)); ?>
|
||||
|
||||
<?js
|
||||
if (this.examples && examples.length) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user