executablebooks / MyST-NB

Parse and execute ipynb files in Sphinx
https://myst-nb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
210 stars 84 forks source link

Skip empty output text blocks? #593

Open zmoon opened 7 months ago

zmoon commented 7 months ago

Context

With Rich progress bars, extra empty output blocks are produced.

For example:

image

The empty blocks each consist of two

<div class="output text_html">
  <pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace"></pre>
</div>

I'll try to come up with a minimal example with code...

Proposal

It would be nice for such empties to be skipped, perhaps optionally.

Tasks and updates

No response

bsipocz commented 1 month ago

@zmoon - Have you tried nb_merge_streams = True? I got reasonably nice results for some notebooks that previously were super ugly. And if that doesn't help, could you please try using the master branch? we merged a possibly related fix today from https://github.com/executablebooks/MyST-NB/pull/604.

zmoon commented 1 month ago

Hi @bsipocz , I tried nb_merge_streams = True and got the same results (myst-nb 1.0.0 and in 1.1.1 as well). With current master branch, also same results, regardless of nb_merge_streams setting.