Skip to content

Commit dbdc9b9

Browse files
committed
do not display the parameter section if the function doesn't take any
1 parent 3b48d1c commit dbdc9b9

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

arkdoc/generator/html.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,7 @@ def generate_one(self, path: str, functions: List[spec.Function]):
149149
if func.desc.authors
150150
else ""
151151
)
152-
content = html.div(
153-
html.inline_code(func.signature),
154-
"<br>",
155-
html.div(func.desc.brief),
156-
html.div(html.b("Note"), ": ", func.desc.details),
152+
parameters = (
157153
html.div(
158154
html.h4(html.plural("Parameter", len(func.desc.params))),
159155
html.ul(
@@ -162,7 +158,16 @@ def generate_one(self, path: str, functions: List[spec.Function]):
162158
for p in func.desc.params
163159
]
164160
),
165-
),
161+
)
162+
if func.desc.params
163+
else ""
164+
)
165+
content = html.div(
166+
html.inline_code(func.signature),
167+
"<br>",
168+
html.div(func.desc.brief),
169+
html.div(html.b("Note"), ": ", func.desc.details),
170+
parameters,
166171
authors,
167172
)
168173
if func.desc.code:

0 commit comments

Comments
 (0)