spatialaudio / nbsphinx

:ledger: Sphinx source parser for Jupyter notebooks
https://nbsphinx.readthedocs.io/
MIT License
450 stars 130 forks source link

Feature request: hide execution count #671

Closed adamjstewart closed 1 year ago

adamjstewart commented 2 years ago

When rendering notebooks, nbsphinx includes the execution_count of each cell like so: Screen Shot 2022-09-07 at 1 25 20 PM Here, the execution_count of the first cell is null, while the second is 6. These execution counts are useful in Jupyter Notebook as they allow you to see the history of which cells you ran in which order. However, they aren't particularly useful in documentation where you just want to document a feature, present some code, and display the output. Can we add a feature that allows users to optionally hide the execution count of each cell during rendering?

mgeier commented 1 year ago

You should hide the execution count via CSS, see https://nbsphinx.readthedocs.io/en/0.8.9/custom-css.html#For-a-Single-Notebook.


But what I'm more concerned about is the unintended line break in your first code cell. Which Sphinx theme are you using and which browser? I think I might have to add some CSS to avoid line breaks there.

adamjstewart commented 1 year ago

Theme is the master branch of https://github.com/pytorch/pytorch_sphinx_theme, browser is Chrome.

mgeier commented 1 year ago

Thanks @adamjstewart, this seems to happen only on master, not on the latest release.

Either way, I think #675 should fix this.


Did you manage to remove your prompts?


BTW, the PyTorch theme is quite bad, most notably because of blown up images (which you have already reported in https://github.com/pytorch/pytorch_sphinx_theme/issues/140) leading to work-arounds like https://github.com/microsoft/torchgeo/blob/main/docs/_static/workaround.css. But there are many more minor ugly things going on.

adamjstewart commented 1 year ago

this seems to happen only on master, not on the latest release.

This is also present in our docs for TorchGeo 0.1.1, which was released in December 2021, so the bug has existed for at least that long.

Did you manage to remove your prompts?

Worked like a charm! https://github.com/microsoft/torchgeo/pull/783

BTW, the PyTorch theme is quite bad

Yeah... I wish it was better maintained. There seems to be a fork that is actually maintained, may move to that someday. Trying to stick to the same theme as the rest of the PyTorch ecosystem if possible. I'm aware of many more bugs (https://github.com/microsoft/torchgeo/issues/101) but don't have the expertise to fix them myself.

mgeier commented 1 year ago

I'm closing this as resolved, because prompts should be removed via CSS.