# How to get help on a Julia command on a Jupyter notebook?

**URL:** https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976
**Category:** New to Julia
**Tags:** question
**Created:** [April 15, 2024, 7:47pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976 "2024-04-15T19:47:23Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![younes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/younes/32/208506_2.png) [@younes](https://discourse.julialang.org/u/younes)
#### Post date: [April 15, 2024, 7:47pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976/1 "2024-04-15T19:47:23Z")

</div>

I already tried :

```julia
?replace

ParseError:
# Error @ /home/onto/dev/projects/intro_julia.ipynb:1:1
?replace
╙ ── not a unary operator

Stacktrace:
 [1] top-level scope
   @ ~/dev/projects/intro_julia.ipynb:1

```

but it does work in the terminal…

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/2/d297116f6456f165c9fcc9cf760c57bc5b60b996.png)

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [April 15, 2024, 7:51pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976/2 "2024-04-15T19:51:31Z")

</div>

There is probably a better way, but you can do `Base.Docs.doc("replace")`.

---

<div class="post-metadata">

### Author: ![younes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/younes/32/208506_2.png) [@younes](https://discourse.julialang.org/u/younes)
#### Post date: [April 15, 2024, 7:55pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976/3 "2024-04-15T19:55:44Z")

</div>

You mean `@docs replace` ?

I did, and the output is very scary (because of some weird bug that’s not yet solved I guess, according to some comment I read on GH):

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/8/e8b9371a0726369c54e87078fbd8eac9aea90b73.png)

```julia
ParseError: KaTeX parse error: No such environment: verbatim at position 7: \begin{̲v̲e̲r̲b̲a̲t̲i̲m̲}̲ String <: Abst…

```

EDIT: I found this as a workaround: [Displaying docstrings in Notebook in VSCode (errors) - #4 by Paul\_Soderlind](https://discourse.julialang.org/t/displaying-docstrings-in-notebook-in-vscode-errors/107627/4)

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [April 15, 2024, 8:32pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976/4 "2024-04-15T20:32:19Z")

</div>

> [@younes](#):
>
> I already tried :
> 
> ```julia
> ?replace
> 
> ```

Works for me in `jupyter notebook`:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/e/3e67384dee6485d6e5d13a7d7ef9ff17d6043201.png)

What notebook front-end are you using?

---

<div class="post-metadata">

### Author: ![younes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/younes/32/208506_2.png) [@younes](https://discourse.julialang.org/u/younes)
#### Post date: [April 15, 2024, 8:33pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976/5 "2024-04-15T20:33:54Z")

</div>

VSCode’s

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [April 15, 2024, 8:47pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976/6 "2024-04-15T20:47:11Z")

</div>

`?` parses for me if I choose “Jupyter Kernel” (_not_ “Julia release channel”) as the kernel source:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/2/c2633e8ad57672e94ede6b94c5927bc51d20bdcb.png)

A separate issue is that the front-end is trying to render the LaTeX version and failing.

The way the Jupyter protocol works is that the backend kernel (here, IJulia.jl) sends output as a dictionary in multiple formats, and the front-end chooses which one it wants to display. Here, IJulia sends text/plain, text/markdown, and text/latex formats for the documentation. The `jupyter notebook` is rendering the text/markdown format, but apparently VSCode is trying to render the text/latex format and failing. As noted above, you can force VSCode to use text/markdown via

```julia
display("text/markdown", Base.Docs.doc("replace"))

```

but this is a bit awkward. Another workaround is to tell Julia that `Markdown.MD` should never be displayed as text/latex:

```julia
import Markdown
Base.showable(::MIME"text/markdown", ::Markdown.MD) = false

```

at which point `?replace` works:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/6/2691c8c205a2a366211dc5e39075928bcf0e2c49.png)

A longer-term “solution” would to patch IJulia.jl so that it never sends text/latex for `Markdown.MD` objects, but this is a bit annoying since the front-end is supposed to decide this.

The right thing would be for VSCode to fix this. They shouldn’t display as text/latex if text/markdown is available, since their text/latex display is apparently not fully functional. (However, their markdown rendering does not support LaTeX equations. So they really need to fix both.)

---

<div class="post-metadata">

### Author: ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)
#### Post date: [April 15, 2024, 9:15pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976/7 "2024-04-15T21:15:57Z")

</div>

> [@stevengj](#):
>
> The right thing would be for VSCode to fix this. They shouldn’t display as text/latex if text/markdown is available, since their text/latex display is apparently not fully functional. (However, their markdown rendering does not support LaTeX equations. So they really need to fix both.)

Could this be fixed at the level of the vscode Julia extension? Or is it something that needs to be handled upstream, in vscode? In either case, is there a Github issue tracking this?

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [April 15, 2024, 9:56pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976/8 "2024-04-15T21:56:47Z")

</div>

> [@e3c6](#):
>
> Could this be fixed at the level of the vscode Julia extension? Or is it something that needs to be handled upstream, in vscode?

It would have to be handled upstream, in vscode. They have so far closed all of the related issues (linked in [Cannot render Julia's help document in VScode Jupyter Notebook · Issue #13493 · microsoft/vscode-jupyter · GitHub](https://github.com/microsoft/vscode-jupyter/issues/13493)), unfortunately.

It would be nice to at least file an issue for them to prefer text/markdown to text/latex when both are present in the display dictionary, since their support for the former is more full-featured. (Their text/latex support is basically limited to equations.) There doesn’t seem to be an issue that makes this clear.

But they [don’t plan to support](https://github.com/microsoft/vscode/issues/143801) LaTeX equations in Markdown.
