notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Open the help in a bottom panel

Open jtpio opened this issue 1 year ago • 5 comments

The classic notebook (v6) opens the help panel at the bottom of the page, for example when using the following code snippet:

import math
math.pi?

image

JupyterLab inlines the help in the output:

image

Jupyter Notebook 7 does the same as JupyterLab since it uses the same notebook component:

image

Opening this issue to track this feature parity difference. Not sure this needs to be addressed for Notebook 7 but at least it's tracked somewhere.

jtpio avatar Jan 13 '23 09:01 jtpio

In the classic notebook this is also called the "pager":

image

jtpio avatar May 25 '23 12:05 jtpio

For reference this is handled here in JupyterLab:

https://github.com/jtpio/jupyterlab/blob/eeaa6505f658f7eaaad18ea2d7f15c3c5da0b23a/packages/outputarea/src/widget.ts#L664-L688

The content of the message contains "source": "page" as part of the payload:

{
  "content": {
    "status": "ok",
    "execution_count": 3,
    "user_expressions": {},
    "payload": [
      {
        "source": "page",
        "data": {
          "text/plain": "\u001b[0;31mType:\u001b[0m        float\n\u001b[0;31mString form:\u001b[0m 3.141592653589793\n\u001b[0;31mDocstring:\u001b[0m   Convert a string or number to a floating point number, if possible."
        },
        "start": 0
      }
    ]
  },
  "channel": "shell"
}

jtpio avatar May 30 '23 06:05 jtpio

The "Messaging in Jupyter" documentation also has some information about page: https://jupyter-client.readthedocs.io/en/stable/messaging.html#payloads-deprecated

Pager output is used for introspection, or other displayed information that’s not considered output. Pager payloads are generally displayed in a separate pane, that can be viewed alongside code, and are not included in notebook documents.

jtpio avatar May 31 '23 08:05 jtpio

It's not clear whether this will be addressed in time for 7.0. Bumping to 7.1, but if someone would like to have a look at it feel free to comment here!

jtpio avatar Jun 08 '23 07:06 jtpio

I'm using Jupyter with R, and in R and the classic notebook interface I can get the help in the bottom pager with either e.g. ?sin (or equivalently help(sin)), or I can get help by putting cursor in a function name and pressing F1. Note that the F1 shortcut is understood by Jupyter even if on other pages the same shortcut opens the browser's manual (as is the case for e.g. GNOME Web/Epiphany).

The same shortcut has no such effect in both Jupyterlab and the Notebook v7 interfaces. Using the ?sin method puts help inline, as in the screenshots above. In Jupyterlab, there is also the "interactive help", which stays in place when scrolling, but changes during typing, so it's not a full replacement for the classic-style pager.

janxkoci avatar May 14 '24 16:05 janxkoci