-
Notifications
You must be signed in to change notification settings - Fork 206
adding a notebook to python converter #423
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
Conversation
@@ -24,7 +24,7 @@ jobs: | |||
- restore_cache: | |||
keys: | |||
- cache-pip | |||
- run: pip install --user numpy scipy matplotlib seaborn sphinx_rtd_theme pillow sphinx pytest vtk traits traitsui pyface pyqt5 mayavi memory_profiler | |||
- run: pip install --user -r doc/doc-requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note - this PR also splits out the docs requirements into their own file to make things clearer for would-be developers or users.
b7b8ca1
to
9d2ed84
Compare
7d4c301
to
e6df2b0
Compare
Codecov Report
@@ Coverage Diff @@
## master #423 +/- ##
==========================================
- Coverage 95.48% 95.34% -0.14%
==========================================
Files 29 29
Lines 2235 2297 +62
==========================================
+ Hits 2134 2190 +56
- Misses 101 107 +6
Continue to review full report at Codecov.
|
e6df2b0
to
a190d86
Compare
a190d86
to
6a21bde
Compare
The one travis error is a dependency clash with Python 3.4
I can try fixing that (and adding the dependency to the appveyor build) if folks are generally +1 on this approach, but I don't wanna spend a bunch of time getting pandoc/pypandoc working if it's gonna be rejected :-) our only other option would be to write a ton of custom md->rst code, similar to https://github.com/sphinx-gallery/sphinx-gallery/blob/master/sphinx_gallery/notebook.py#L62 |
Thank you for taking time to do this @choldgraf |
@choldgraf what should we do with this? Move to SG-extra? I have a feeling it will need some reworking to fit with the new scraping changes. |
yeah probably, and anyway at this point I'd probably recommend that people use Jupytext anyway...if we want to support jupyter notebooks more effectively I'd rather it happen by improving the story of two-way sync between ipynb and |
Over the months we've gotten several requests to support people storing examples as Jupyter Notebooks. Recently I also found there's even a fork of sphinx-gallery whose primary feature is just to support docs w/ notebooks (https://github.com/Chilipp/sphinx-nbexamples).
In #245 it was mentioned that a relatively easy solution would be to support a notebook -> .py converter. @chsasank helpfully provided a script that they use to convert notebooks (using the
json
module so it's relatively lightweight). I've modified/updated that script a bit, and included in this PR as a helper function, along with tests and an example that shows the.ipynb -> .py -> .ipynb
roundtrip.closes #245
note that this was attempted once last year by @chsasank (#220) and it ultimately didn't make it through. My hope is that making this a "helper function" instead of part of the core build process, we have a bit more wiggle-room for inconsistencies.
Here's a link to the built page from a notebook: https://613-25860190-gh.circle-artifacts.com/0/alabaster_html/auto_examples/sin_func/plot_notebook.html#sphx-glr-auto-examples-sin-func-plot-notebook-py