Open navidcy opened 1 year ago
The issue here is that you are doing a jldoctest but you do not include the julia>
prompt. Doing it as:
"""
foo(x)
A function called foo.
Example
=======
```jldoctest
julia> foo(2) # <------------- note julia>
# output
2
"""
foo(x) = x
Makes it work. I'll try fix this nonetheless.
True. But without OhMyREPL it works both ways. So I was getting confused and puzzled why I wasn't seeing the docstring examples but others could see them.
I've been struggling with this for a bit and I think it has something to do with OhMyREPL.
I define a function
foo
with a docstring that includes a doctest with a "script" example. Then I ask for thehelp?> foo
and if OhMyREPL is loaded then the doctest does not appear!(Note that if I used a REPL example doctest then all is good!)
Here's a MWE.
Af first I load Julia without OhMyREPL. Everything looks OK. If then I load OhMyREPL and ask again of the docstring of
foo
the example is disappeared!foo
help?> foo search: foo floor pointer_from_objref OverflowError RoundFromZero unsafe_copyto! functionloc
foo(x)
A function called foo.
Example ≡≡≡≡≡≡≡≡≡
foo(2)
output
2
julia> using OhMyREPL
help?> foo search: foo floor pointer_from_objref OverflowError RoundFromZero unsafe_copyto! functionloc
foo(x)
A function called foo.
Example ≡≡≡≡≡≡≡≡≡
julia>