Skip to content

Commit e11a5a5

Browse files
committed
updates to genstdlib.jl
1 parent 04dc806 commit e11a5a5

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

doc/genstdlib.jl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@ isrst(md) =
3030
isa(flatten(md).content[1], Markdown.Code) &&
3131
flatten(md).content[1].language == "rst"
3232

33-
torst(md) = isrst(md) ? flatten(md).content[1].code : Markdown.rst(md)
33+
function tryrst(md)
34+
try
35+
Markdown.rst(md)
36+
catch e
37+
warn("Error converting docstring:")
38+
display(md)
39+
return
40+
end
41+
end
42+
43+
torst(md) = isrst(md) ? flatten(md).content[1].code : tryrst(md)
3444

3545
function remsig(l, doc)
3646
sig = l[15:end]
@@ -59,10 +69,8 @@ function translate(file)
5969
func = func.captures[1]
6070
doc = getdoc(mod, func)
6171

62-
if doc == nothing || !isrst(doc)
63-
doc == nothing ?
64-
info("no docs for $(ident(mod, func))") :
65-
info("can't convert docs for $(ident(mod, func))")
72+
if doc == nothing || torst(doc) == nothing
73+
info("no docs for $(ident(mod, func))")
6674
println(io, l)
6775
doccing = false
6876
continue

0 commit comments

Comments
 (0)