mkdocs-jupyter
mkdocs-jupyter copied to clipboard
Scrollable output cells
For long output cells (over a certain line length I guess), it would be super neat if these could become scrollable boxes to avoid them taking up too much room on a page.
Work around to do this:
Make a docs/assets/styles.css with:
/* Make Jupyter notebook output cells scrollable */
.jp-Cell-outputWrapper {
max-height: 450px; /* Adjust height as needed */
overflow-y: auto;
padding: 10px;
border-radius: 5px;
}
Update mkdocs.yml
extra_css:
- assets/styles.css
Thanks! Do you know if there's a way to make add a horizontal scroll bar if text is too long?
Np. I've tried and can't seem to get that to work.
@dstansby
Try this:
plugins:
- search
- mkdocs-jupyter:
highlight_extra_classes: jupyter-custom-highlight
Custom css that you add through mkdocs
.jupyter-custom-highlight .jp-OutputArea-area > pre {
white-space: pre;
}
@danielfrg do you agree that this behavior is so desirable that it should be toggleable via plugin setting?
I try to avoid to prescribe these things but I think its a FAQ, its worth to have a solution described in the readme instead of having it in the code IMO. Those things break between versions sometimes and its hard to test them all.