-
Notifications
You must be signed in to change notification settings - Fork 7
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
Convert tutorials from sphinx-gallery to plain rst #31
Conversation
The tutorials have much more text than Python code so rendering them in sphinx-gallery means writing a bunch of rst content as comments in the `.py` files, which is very awkward. Use jupyter-sphinx instead so we can have the tutorials as plain rst files with code blocks executed by the extension. The output looks pretty much the same with some slight differences in style (had to tweak the CSS to match). Another advantage is that the "Edit on GitHub" links from sphinx-book-theme now work for these (they don't for the gallery output).
Before I review it, I must say that I'm amazed with |
I'm having some errors when building the docs, I think they are coming from GMT. Are you experiencing the same?
|
Yes! The one thing I would miss from using sphinx-gallery was the liking of functions to their docs. With this, we can have it with jupyter-sphinx as well. For Ensaio it doesn't really matter since there aren't any long form tutorials. But for the other packages this is major. Just built the docs on a completely fresh environment with no issues. This is my
Same GMT (6.2) and PyGMT (0.5) as you. Not sure what happened for you there since the CI also seems to build. |
I still can't build the docs 😢 I even reinstalled mambaforge and created the environment from scratch... without success. Our environments are the same (except for a different minor version of curl). I'm kind of lost here. But if CIs and you can build them, there might be something wrong in my end. |
😢 the error seems to be coming from ghostscript during the rendering of the postscript file to PNG. But our ghostscript versions are the same. I wonder if GMT is getting ghostscript from the systems instead of conda? |
Still having trouble with this? |
Merging in since CIs are happy. If it turns out to be a persistent problem we can investigate in a follow up. |
Yesterday I found that the problem is not with this PR only, but for some reason I also get it when trying to build the docs on |
Description
The tutorials have much more text than Python code so rendering them in sphinx-gallery means writing a bunch of rst content as comments in the
.py
files, which is very awkward. Use jupyter-sphinx instead so we can have the tutorials as plain rst files with code blocks executed by the extension. The output looks pretty much the same with some slight differences in style (had to tweak the CSS to match). Another advantage is that the "Edit on GitHub" links from sphinx-book-theme now work for these (they don't for the gallery output).Trying this out after @santisoler mentioned using this with the Harmonica docs refactor. I really like it and it looks like we can also add links to the API docs (with backreferences) using this extension in the future: https://github.com/felix-hilden/sphinx-codeautolink/ (need to get it on conda-forge).