Skip to content

Conversation

@jaladh-singhal
Copy link
Contributor

Fixes #677

  • Introduced a new configuration option scroll_outputs in myst_nb/core/config.py to enable scrollable long outputs - configurable at global, file, cell, and render levels.

  • Updated the myst_nb/core/render.py logic to apply the tag_output_scroll class to cells when the scroll_outputs configuration is enabled.

  • Added tests for this config: test case in test_render_outputs.py, input notebook scroll_outputs.ipynb and output AST test_scroll_outputs.xml. This was heavily inspired from hide_cell_content option PR.

  • [Bonus] Added tags scroll-output (or output_scroll) and scroll-input in documentation (they was no documentation when they were added)

@jaladh-singhal
Copy link
Contributor Author

I found more issues in the irsa-tutorials build using this branch and this config turned on: https://output.circle-artifacts.com/output/job/6313d183-aae2-490b-a692-68e1d986d56e/artifacts/0/_build/html/tutorials/euclid_access/1_Euclid_intro_MER_images.html

It's not ready for merging until I fix them.

@bsipocz bsipocz added the enhancement New feature or request label Jul 3, 2025
@jaladh-singhal jaladh-singhal marked this pull request as ready for review July 3, 2025 20:58
@jaladh-singhal
Copy link
Contributor Author

Ok so I fired docs CI at NASA-NAVO/navo-workshop#207 and I'm happy with results now: https://output.circle-artifacts.com/output/job/a8645ce2-d3c0-46f0-8ede-c6e12e9ad527/artifacts/0/_build/html/content/use_case_notebooks/candidate_list_solution.html (this notebook has a good mix of long tables, and images (short and long))

Comment on lines +284 to +294
div.cell:is(
.tag_output_scroll,
.tag_scroll-output,
.config_scroll_outputs
)
div.cell_output,
div.cell.tag_scroll-input div.cell_input {
max-height: 24em;
overflow-y: auto;
max-width: 100%;
overflow-x: auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! I forgot to mention: this is a little bit tangential to this PR. I realized the style definitions were redundant so I combined input and output styles. And CSS selector was too long so I simplified it with :is()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All I could do is to trust you and the test suite and downstream test PRs on this 😅

Copy link
Collaborator

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, it's all in there automatically! Ahh, there is no nb_scroll_outputs documentation anywhere. That should be added somewhere 🤷‍♀️

Besides that it all looks good to me, the downstream testing was very convincing!

Comment on lines +284 to +294
div.cell:is(
.tag_output_scroll,
.tag_scroll-output,
.config_scroll_outputs
)
div.cell_output,
div.cell.tag_scroll-input div.cell_input {
max-height: 24em;
overflow-y: auto;
max-width: 100%;
overflow-x: auto;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All I could do is to trust you and the test suite and downstream test PRs on this 😅

@bsipocz
Copy link
Collaborator

bsipocz commented Jul 3, 2025

Ohh, I found this rename PR from output_scroll to scroll-output, so that's good, we just never updated it in the downstream repos: https://github.com/jupyter-book/jupyter-book/pull/2050/files

@bsipocz bsipocz merged commit 1ddc3a5 into executablebooks:master Jul 4, 2025
15 checks passed
@bsipocz
Copy link
Collaborator

bsipocz commented Jul 4, 2025

Thanks @jaladh-singhal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make scroll_output a global (and file-level) configuration

2 participants