Skip to content

Commit 4af7ba8

Browse files
authored
feat(render): add ability to igore a docstring while rendering (#55)
* feat(render): add ability to igore a docstring while rendering * fix: correcly filter on package
1 parent 220d3e6 commit 4af7ba8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

doc-util/render.libsonnet

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
+ (
1515
// If matches a package but warn if also has an object docstring
1616
if '#' in obj[k] && '#' + k in obj
17+
&& !std.objectHasAll(obj[k]['#'], 'ignore')
1718
then std.trace(
1819
'warning: %s both defined as object and package' % k,
1920
[root.package(obj[k], path + [k], parentWasPackage)]
2021
)
2122
// If matches a package, return it
2223
else if '#' in obj[k]
24+
&& !std.objectHasAll(obj[k]['#'], 'ignore')
2325
then [root.package(obj[k], path + [k], parentWasPackage)]
2426
// If not, keep looking
2527
else find(obj[k], path + [k], parentWasPackage=false)
@@ -150,6 +152,7 @@
150152
std.all([
151153
!std.startsWith(k, '#'),
152154
std.isObject(obj[k]),
155+
!std.objectHasAll(obj[k], 'ignore'),
153156
!('#' + k in obj), // not documented in parent
154157
!('#' in obj[k]), // not a sub package
155158
]),
@@ -390,6 +393,7 @@
390393
std.all([
391394
std.startsWith(k, '#'),
392395
std.isObject(obj[k]),
396+
!std.objectHasAll(obj[k], 'ignore'),
393397
type in obj[k],
394398
root.util.realkey(k) in obj,
395399
]),

0 commit comments

Comments
 (0)