Use short name for exported functions

This commit is contained in:
Tim Schaub
2022-08-11 15:39:41 -06:00
committed by Tim Schaub
parent 9c0e2f35d1
commit 73baef60e3
3 changed files with 3 additions and 2 deletions

View File

@@ -597,6 +597,7 @@ exports.publish = function (taffyData, opts, tutorials) {
// add template helpers // add template helpers
view.find = find; view.find = find;
view.linkto = linkto; view.linkto = linkto;
view.getShortName = getShortName;
view.resolveAuthorLinks = resolveAuthorLinks; view.resolveAuthorLinks = resolveAuthorLinks;
view.tutoriallink = tutoriallink; view.tutoriallink = tutoriallink;
view.htmlsafe = htmlsafe; view.htmlsafe = htmlsafe;

View File

@@ -162,7 +162,7 @@
var methods = self.find({kind: 'function', memberof: title === 'Global' ? {isUndefined: true} : doc.longname}); var methods = self.find({kind: 'function', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
if (methods && methods.length && methods.forEach) { if (methods && methods.length && methods.forEach) {
?> ?>
<h3 class="subsection-title">Methods</h3> <h3 class="subsection-title"><?js= doc.kind === 'module' ? 'Functions' : 'Methods' ?></h3>
<dl><?js methods.forEach(function(m) { ?> <dl><?js methods.forEach(function(m) { ?>
<?js m.parent = doc ?> <?js m.parent = doc ?>

View File

@@ -14,7 +14,7 @@ if (/-dev$/.test(version)) {
<div class="anchor" id="<?js= id ?>"> <div class="anchor" id="<?js= id ?>">
</div> </div>
<h4 class="name"> <h4 class="name">
<?js= data.attribs + (kind === 'class' ? 'new ' : '') + (data.scope === 'static' ? longname : name) + (kind !== 'event' ? data.signature : '') ?> <?js= data.attribs + (kind === 'class' ? 'new ' : '') + this.getShortName(longname) + (kind !== 'event' ? data.signature : '') ?>
<?js if (data.inherited || data.inherits) { ?> <?js if (data.inherited || data.inherits) { ?>
<span class="inherited"><?js= this.linkto(data.inherits, 'inherited') ?></span> <span class="inherited"><?js= this.linkto(data.inherits, 'inherited') ?></span>
<?js } ?> <?js } ?>