Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Scrolling for Outputs not Maintained in HTML Export #2123

Open
PhilipYip1988 opened this issue Mar 5, 2024 · 0 comments
Open

Enable Scrolling for Outputs not Maintained in HTML Export #2123

PhilipYip1988 opened this issue Mar 5, 2024 · 0 comments

Comments

@PhilipYip1988
Copy link

PhilipYip1988 commented Mar 5, 2024

Enable Scrolling for Outputs not Maintained in HTML Export

The Scrolling Output can be used to nest a docstring, allowing it to be viewed in a notebook without taking the main focus of the notebook. When a notebook is converted to HTML, this scrollbar is not maintained and the docstring is displayed using a normal output and therefore takes the main focus of the notebook:

image

Reproduce

Create a new notebook file and input in cell 1:

help(str)

And input in cell 2:

help(str)

This will create a long docstring. Right click the output of cell 1 and select, enable scrolling for outputs:

image

The output for cell 1 is scrollable and the output for cell 2 is not scrollable:

image

If the following is used:

jupyter-nbconvert --to html --template lab notebook.ipynb
image

Both outputs are not scrollable and the scrollable setting for each cell output is ignored:

image

If the notebook.ipynb is renamed to notebook.json:

image

Then the problem is the metadata provided is ignored when exporting to HTML:

image

This metadata should be applied to the HTML file and cells with scrolled true should display as scrolling outputs.

The nbconvert configuration options mention the metadata but only in the context of removing it and not applying it to the way a cell is displayed in HTML.

image

This is also related to JupyterLab when nbconvert is used via the GUI when using File -> Save and Export Notebook as -> HTML JupyterLab #15903.

Expected behavior

In the HTML file the output of cell 1 should be scrollable and the output of cell 2 should not be scrollable.

Context

  • Operating System and version: Windows 11 23H2
  • Browser and version: Version 122.0.6261.70 (Official Build) (64-bit)
  • JupyterLab version: 4.1.2
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant