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'
|
||||
else ''
|
||||
)
|
||||
+ (root.templates.index % root.index(package.sections))
|
||||
+ '\n## Fields\n\n'
|
||||
+ root.renderValues(package.values)
|
||||
+ root.renderSections(package.sections),
|
||||
+ (if std.length(package.sections) > 0
|
||||
then (root.templates.index % root.index(package.sections))
|
||||
else '')
|
||||
+ (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=[])::
|
||||
std.join('\n', [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue