Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't show *.ipynb files rightly #595

Closed
BAOOOOOM opened this issue Aug 16, 2021 · 5 comments
Closed

Can't show *.ipynb files rightly #595

BAOOOOOM opened this issue Aug 16, 2021 · 5 comments

Comments

@BAOOOOOM
Copy link

BAOOOOOM commented Aug 16, 2021

*.ipynb files can not be shown by nbsphinx. And show as this:
image

Actually, if I use sphinx to build it locally, it can show in right format, just like this:
image
Thank you!

@BAOOOOOM
Copy link
Author

Please click the link if you want to see the html which haven't show *.ipynb files rightly. https://edunlp.readthedocs.io/en/docs_dev/build/blitz/sif/sif.html

Thanks!

@BAOOOOOM BAOOOOOM changed the title Can*.ipynb files Can't show *.ipynb files rightly Aug 16, 2021
@BAOOOOOM
Copy link
Author

BAOOOOOM commented Aug 17, 2021

I have used the method of #310, but the bug stills existence.

@aulemahal
Copy link

I had the same problem. Seems to have appeared with nbsphinx 0.8.7. I was able to build my docs correctly with sphinx 4.1.2 and nbsphinx 0.8.6.

The main change from 0.8.6 to 0.8.7, concerning this problem, is that the .ipynb extension is now added to sphinx's source suffixes ONLY if it is absent from the base config (the config as it is after executing conf.py).
And it turns out I had this line in my conf.py:

source_suffix = [".rst", ".ipynb"]

Thus, nbsphinx was never registering notebooks to be parsed by the correct parser. Sphinx was reading them as if they were rst files. I am not sure why I add that line before, but removing the ipynb part solved my problem. @BAOOOOOM maybe you have something similar in your code?

@BAOOOOOM
Copy link
Author

Yes, I have something similar in your code. Now the problem is sovled. Thank you very much.

@mgeier
Copy link
Member

mgeier commented Aug 19, 2021

source_suffix = [".rst", ".ipynb"]

Using a list as source_suffix does not do what you expect, see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-source_suffix

Since .rst is Sphinx's default and .ipynb is automatically added by nbsphinx, setting source_suffix is not necessary at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants