Skip to content

Make scroll_output a global (and file-level) configuration #677

@jaladh-singhal

Description

@jaladh-singhal

Context

There has been need of making long outputs scroll by default in tutorial notebooks. It is already captured in several relevant issues (that @bsipocz pointed me to):

The current option that MyST-NB provides is to add a cell-level tag scroll-output or output_scroll but there's no way to add it globally or at a file/document-level, which makes it tedious to chase down all cells emitting long outputs and putting this tag there (an example PR at NAVO).

It will be best to have a global config option for rendering, say nb_outputs_scroll: bool that can be enabled to address above problem by one flag. Similarly, it can be extended as a file-level config.

Proposal

Since we need this feature at IRSA, I am willing to open a PR. I'm thinking to follow another global (and file-level) boolean rendering config option: remove_code_outputs and implement outputs_scroll.

After studying MyST-NB code a bit, it seems to me that I need to:

Note: my solution relies on adding the classes that already has scrollable output styles per cell. An alternative can be to inject a custom css on global or document level that targets all cell_output classes together. But I'm not sure where is the logic that I'd need to tweak for it.

Let me know if this sounds like a reasonable plan, I'll create a PR. I'm also open to discuss better ways to implement this.

Tasks and updates

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions