Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Julia: fix filename quoting in docstring (#13894)
Browse files Browse the repository at this point in the history
Quoting filename with backticks to prevent
markdown mis-rendering some of them with underscore.
  • Loading branch information
iblislin authored and szha committed Jan 19, 2019
1 parent de5948b commit 1e607a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions julia/src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,14 @@ end
Extract the line of `Defined in ...`
julia> mx._getdocdefine("sgd_update")
"Defined in src/operator/optimizer_op.cc:L53"
```
"Defined in `src/operator/optimizer_op.cc:L53`"
"""
function _getdocdefine(name::String)
op = _get_libmx_op_handle(name)
str = _get_libmx_op_description(name, op)[1]
lines = split(str, '\n')
for m match.(Ref(r"^Defined in .*$"), lines)
m != nothing && return m.match
for m match.(Ref(r"^Defined in ([\S]+)$"), lines)
m != nothing && return "Defined in `$(m.captures[1])`"
end
""
end
Expand Down

0 comments on commit 1e607a9

Please sign in to comment.