Displaying docstrings in Notebook in VSCode (errors)

I found this SO post that makes think it should work on VSC but when I try it (in notebook cell)

@doc sin

ParseError: KaTeX parse error: No such environment: verbatim at position 7: \begin{̲v̲e̲r̲b̲a̲t̲i̲m̲}̲ sin(x) \end{ve…

Compute sine of \texttt{x}, where \texttt{x} is in radians.

See also \href{@ref}{\texttt{sind}}, \href{@ref}{\texttt{sinpi}}, \href{@ref}{\texttt{sincos}}, \href{@ref}{\texttt{cis}}, \href{@ref}{\texttt{asin}}.
...

How can we display docstrings then?

Sh…

This post solves it. Not obvious at first but it now works.

I currently do display("text/markdown",@doc sin), but maybe a simple macro

macro docVSC(fn)
  return :( display("text/markdown",Base.doc($fn)))
end

used as @docVSC sin would be a temporary solution. Any ideas?

Hello,

Has this been solved, or do we still to use the workaround? =)

See How to get help on a Julia command on a Jupyter notebook? - #6 by stevengj for other workarounds, but this really needs to be solved in VSCode.

(Or just use the jupyter notebook or the jupyterlab front end, which is more full-featured.)

1 Like