nbsphinx icon indicating copy to clipboard operation
nbsphinx copied to clipboard

Erroneous extra cells in singlehtml output

Open dokempf opened this issue 2 years ago • 2 comments

I am not sure whether nbsphinx intends to be compatible with both the html and singlehtml builders from Sphinx, but I realized that my singlehtml builds all produce a blank extra cell for each cell:

singlehtml

I tried fixing this with the various prompt-related configuration variables without success.

dokempf avatar Nov 10 '21 13:11 dokempf

I am not sure whether nbsphinx intends to be compatible with both the html and singlehtml builders from Sphinx

Good point, I'm not sure either.

But if it isn't too much hassle, why not!

BTW, the singlehtml mode is also used in the htmlzip output on RTD, see e.g. https://nbsphinx.readthedocs.io/_/downloads/en/latest/htmlzip/. This shows the same problem.

The problem at hand seems to be that nbsphinx's CSS modifications are not included at all in the singlehtml output.

It looks like the way 'nbsphinx_include_css' is assigned to and/or read from the document doesn't work in singlehtml mode.

Any ideas how to fix this?

mgeier avatar Nov 15 '21 18:11 mgeier

Here are the relevant places in the code:

https://github.com/spatialaudio/nbsphinx/blob/8bd255757ade0d072e5e13c9da706e002d6fa050/src/nbsphinx.py#L1088

https://github.com/spatialaudio/nbsphinx/blob/8bd255757ade0d072e5e13c9da706e002d6fa050/src/nbsphinx.py#L1994-L1995

mgeier avatar Nov 15 '21 18:11 mgeier