Skip to content

Commit 4eca09d

Browse files
authored
Fix: Make standalone function pages show parameters, returns tables (#166)
And also hide summary / right sidebar if no children to show
1 parent 3e11986 commit 4eca09d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/webdoc-default-template/tmpl/components/members-explorer/index.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
const doc = obj;
1313
const members = doc.members;
1414

15+
if (members.length === 0) return;
16+
1517
const publicProperties = this.plugins.categoryFilter(doc, {
1618
access: "public",
1719
type: "PropertyDoc"

packages/webdoc-default-template/tmpl/document.tmpl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,14 @@
5353
require,
5454
sources,
5555
}) ?>
56+
<?js } else if (doc.type === "FunctionDoc") { ?>
57+
<?js if (doc.params) { ?><?js= this.partial("components/member/params.tmpl", doc.params) ?><?js } ?>
58+
<?js if (doc.returns) { ?><?js= this.partial("components/member/returns.tmpl", doc.returns) ?><?js } ?>
5659
<?js } ?>
5760

58-
<?js= this.partial("components/summary/index.tmpl", doc) ?>
61+
<?js if (doc.members.length > 0) { ?>
62+
<?js= this.partial("components/summary/index.tmpl", doc) ?>
63+
<?js } ?>
5964

6065
<?js= this.partial("components/members.tmpl", {
6166
title: "Public Properties",
@@ -110,4 +115,4 @@
110115
<div class="footer-gap" style="min-height: 48px;"></div>
111116
<?js= this.partial("footer") ?>
112117
</main>
113-
<?js= this.partial("components/members-explorer/index.tmpl", doc) ?>
118+
<?js= this.partial("components/members-explorer/index.tmpl", doc) ?>

0 commit comments

Comments
 (0)