Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
97fd4b88
Unverified
Commit
97fd4b88
authored
2 years ago
by
Tobias
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
docs: render default objects and arrays in config (#15637)
parent
9afdb739
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/docs/config.ts
+10
-1
10 additions, 1 deletion
tools/docs/config.ts
with
10 additions
and
1 deletion
tools/docs/config.ts
+
10
−
1
View file @
97fd4b88
...
...
@@ -28,7 +28,12 @@ function genTable(obj: [string, string][], type: string, def: any): string {
}
if
(
!
ignoredKeys
.
includes
(
el
[
0
])
||
(
el
[
0
]
===
'
default
'
&&
typeof
el
[
1
]
!==
'
object
'
&&
name
!==
'
prBody
'
)
(
el
[
0
]
===
'
default
'
&&
typeof
el
[
1
]
!==
'
object
'
&&
name
!==
'
prBody
'
)
||
// only show array and object defaults if they are not null and are not empty
(
el
[
0
]
===
'
default
'
&&
(
type
===
'
array
'
||
type
===
'
object
'
)
&&
el
[
1
]
!==
null
&&
Object
.
keys
(
el
[
1
]).
length
>
0
)
)
{
if
(
type
===
'
string
'
&&
el
[
0
]
===
'
default
'
)
{
el
[
1
]
=
`
\`
"
${
el
[
1
]}
"
\`
`
;
...
...
@@ -43,6 +48,10 @@ function genTable(obj: [string, string][], type: string, def: any): string {
if
(
type
===
'
string
'
&&
el
[
0
]
===
'
default
'
&&
el
[
1
].
length
>
200
)
{
el
[
1
]
=
`[template]`
;
}
// objects and arrays should be printed in JSON notation
if
((
type
===
'
object
'
||
type
===
'
array
'
)
&&
el
[
0
]
===
'
default
'
)
{
el
[
1
]
=
`
\`
${
JSON
.
stringify
(
el
[
1
])}
\`
`
;
}
data
.
push
(
el
);
}
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment