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
Converting notebooks with spaces in their names to RST gives broken images #5350
Comments
@DavidPowell thanks for reporting this bug. Can you try out #5395 to verify that it fixes this issue? |
I have verified this fixes the issue by running |
I can confirm that running |
Hmm, what is the error that sphinx gives? |
sphinx doesn't copy image files from the sources tree by default, does it? I suspect the image files might just be missing from sphinx build dir. |
@ellisonbg Sphinx doesn't give any error, it just displays the image file name instead of the image file. |
Here is Sphinx's take on the issue: https://bitbucket.org/birkenfeld/sphinx/issue/453/spaces-get-stripped-from-image-file-names By using the urlencoded fiename we are tricking docutils to work, but On Thu, Mar 20, 2014 at 4:28 PM, DavidPowell notifications@github.comwrote:
Brian E. Granger |
I just upgraded from IPython 1.2.1 to 2.0.0. Now images are broken for all filenames, not just those with spaces. The offending character is %5c (backslash), which is appearing under windows. I guess I hadn't checked this carefully previously. It does confirm @ellisonbg's suggestion that names should not be urlencoded, as this breaks sphinx's ability to move the files. Now I cannot even work around the problem by avoiding file names with spaces, so I may have to revert to 1.2.1 to build my documentation. By the way, can someone please unclose this issue, as it really isn't fixed. |
* set matplotlib backend in a way that works * parameter correct rst syntax * also ignore M4i file since the import breaks in docs build * Change filenames to fix missing images due to ipython/ipython#5350 * Strip invalid output * Add missing phony * Build docs with sphinx warnings as errors * dont treat warnings as errors * exclude the wrong keysight dir * try to fix issue in tutorial * Revert "dont treat warnings as errors" This reverts commit e8367b9. * add title * Better name * make sure that autogen api is removed too
I am using
ipython nbconvert --to rst example1.ipynb
to convert my example notebooks into reStructuredText, for incorporation into my package's Sphinx documentation. This works quite well, unless the filename has a space in it. In this case, any image files from my notebooks are lost when I run Sphinx'smake html
.My guess is that the problem seems is in the generated rst file, where the
.. image
command may need to be escaped or quoted somehow to work with spaces in the filename.I note that a similar issue was reported and resolved for latex output in issue #3774, however the solution was specific to latex.
The text was updated successfully, but these errors were encountered: