fix(doc-util): print info message when docstring can't get parsed (#33)

This commit is contained in:
Jeroen Op 't Eynde 2022-10-24 09:12:44 +02:00 committed by GitHub
parent 794fed0c46
commit be3cfab4d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -244,11 +244,20 @@
(depth == 0) (depth == 0)
) )
// Field definition // Field definition
else if std.startsWith(key, '#') else if std.startsWith(key, '#')
then ( then (
local realKey = key[1:]; local realKey = key[1:];
if 'value' in obj[key]
if !std.isObject(obj[key])
then
std.trace(
'INFO: docstring "%s" cannot be parsed, ignored while rendering.' % key,
{}
)
else if 'value' in obj[key]
then { then {
values+: [root.sections.value( values+: [root.sections.value(
key, key,
@ -272,7 +281,11 @@
depth depth
)], )],
} }
else {} else
std.trace(
'INFO: docstring "%s" cannot be parsed, ignored while rendering.' % key,
{}
)
) )
// subPackage definition // subPackage definition