question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using jupytext with nbsphinx

See original GitHub issue

Sorry for abusing your issue tracker, this is no bug report but rather an advertisement for my Sphinx extension nbsphinx that allows using Jupyter notebooks as Sphinx source files.

And the reason why I’m mentioning this here, is that I’ve just added a feature (https://github.com/spatialaudio/nbsphinx/pull/234) that allows using jupytext in this process! This should allow using any files supported by jupytext as Sphinx source files.

See https://nbsphinx.readthedocs.io/en/latest/contents-manager.html for documentation.

Note that this feature is currently only available in the master branch, it will be available on PyPI with the next release. It would be great if some people could test it before the next release.

For now, you can install it directly from the Git repository (as described in CONTRIBUTING.rst) or you can use pip like this:

python3 -m pip install git+https://github.com/spatialaudio/nbsphinx.git@master

It would be great if you could try this out and give some feedback if it works and open some issues or pull requests if some things don’t work!

Feel free to close this issue any time.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
jorgepilotocommented, Jun 19, 2020

Hi all, it’s Jorge from the poliastro dev team. We recently switched our Jupyter notebook based examples to Jupytext and both sphinx-gallery and Binder seem to keep running without any problem.

Migration process was very simple, thank you for this amazing tool. Please refer to migration to Jupyext pull request for more information 😄

2reactions
mwoutscommented, Apr 29, 2020

Great news @lukelbd !

Well, could you tell us a bit more? Maybe you have an example that you could share? Especially I’d be curious to know how you structure your documentation - do you maintain the main documentation and the notebooks in two different types of files (.rst and .py maybe?)?

Also, have you seen the new myst format, by the Executable Book Project (cc. @chrisjsewell ) which intends to provide a good rendering of notebooks-like documents with rST content?

Personally I do like very much the idea of testing the documentation. The two examples I have for this are

Clearly, instead of testing the doc files, we could also easily lint them with e.g. jupytext --pipe black.

And to conclude, there are two sujects that I’d like to write on when time permits - these are:

  • How to write a documentation site, including notebooks #247
  • What is a good pre-commit workflow for notebooks #432
Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter Notebook Tools for Sphinx — nbsphinx version 0.8.10
nbsphinx is a Sphinx extension that provides a source parser for *.ipynb files. ... Online documentation (and example of use): ... Example: Jupytext....
Read more >
nbsphinx - Read the Docs
nbsphinx is a Sphinx1 extension that provides a source parser for ... Dummy Notebook 2 for Gallery (page 65) and Using Markdown Files...
Read more >
Auto-generating ipynb files for documentation with sphinx ...
The PlasmaPy folks patch decided to utilize Jupytext so that, in Binder, their sphinx-gallery .py files are automatically converted to ipynb when the...
Read more >
gallery - Jupyter Notebook - MyBinder
You can create Thumbnail Galleries in reST Files and you can create galleries by adding the "nbsphinx-gallery" cell tag or metadata to notebooks, ......
Read more >
Using sphinx with Jupyter notebooks for training material -
Using Jupyter notebooks, nbsphinx, jupytext together. Advantages. Easy interactive training sessions. Nice webpage. When building webpage all code is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found