mirror of
https://github.com/TECHNOFAB11/docsonnet.git
synced 2025-12-12 06:20:12 +01:00
fix(render): only render index/fields sections if needed (#31)
This commit is contained in:
parent
be3cfab4d8
commit
0486f08fc1
1 changed files with 10 additions and 4 deletions
|
|
@ -102,10 +102,16 @@
|
||||||
]) + '\n\n'
|
]) + '\n\n'
|
||||||
else ''
|
else ''
|
||||||
)
|
)
|
||||||
+ (root.templates.index % root.index(package.sections))
|
+ (if std.length(package.sections) > 0
|
||||||
+ '\n## Fields\n\n'
|
then (root.templates.index % root.index(package.sections))
|
||||||
+ root.renderValues(package.values)
|
else '')
|
||||||
+ root.renderSections(package.sections),
|
+ (if std.length(package.values) > 0
|
||||||
|
|| std.length(package.sections) > 0
|
||||||
|
then
|
||||||
|
'\n## Fields\n\n'
|
||||||
|
+ root.renderValues(package.values)
|
||||||
|
+ root.renderSections(package.sections)
|
||||||
|
else ''),
|
||||||
|
|
||||||
index(sections, depth=0, prefixes=[])::
|
index(sections, depth=0, prefixes=[])::
|
||||||
std.join('\n', [
|
std.join('\n', [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue