Skip to content

Commit

Permalink
Fix: Make standalone function pages show parameters, returns tables (#…
Browse files Browse the repository at this point in the history
…166)

And also hide summary / right sidebar if no children to show
  • Loading branch information
ShukantPal authored Jun 7, 2022
1 parent 3e11986 commit 4eca09d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
const doc = obj;
const members = doc.members;

if (members.length === 0) return;

const publicProperties = this.plugins.categoryFilter(doc, {
access: "public",
type: "PropertyDoc"
Expand Down
9 changes: 7 additions & 2 deletions packages/webdoc-default-template/tmpl/document.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@
require,
sources,
}) ?>
<?js } else if (doc.type === "FunctionDoc") { ?>
<?js if (doc.params) { ?><?js= this.partial("components/member/params.tmpl", doc.params) ?><?js } ?>
<?js if (doc.returns) { ?><?js= this.partial("components/member/returns.tmpl", doc.returns) ?><?js } ?>
<?js } ?>

<?js= this.partial("components/summary/index.tmpl", doc) ?>
<?js if (doc.members.length > 0) { ?>
<?js= this.partial("components/summary/index.tmpl", doc) ?>
<?js } ?>

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

0 comments on commit 4eca09d

Please sign in to comment.