-
Notifications
You must be signed in to change notification settings - Fork 30
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
Use nbsphinx and Jupyter notebooks as user guide instead of .rst files + data module #236
Use nbsphinx and Jupyter notebooks as user guide instead of .rst files + data module #236
Conversation
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
I've come to really enjoy two things about writing a user guide in a notebook instead of plain text files:
A drawback I see is still linking and use of references (like |
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
I couldn't find a way to check links automatically... So for now, we'll have to check them manually. Edit: |
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Pushed this branch up to the kikuchipy repo to see if Readthedocs builds the documentation OK: https://kikuchipy.org/en/add-pattern-processing-notebook-with-nbsphinx/ |
The pattern processing notebook can be viewed on nbviewer: https://nbviewer.jupyter.org/urls/kikuchipy.org/en/add-pattern-processing-notebook-with-nbsphinx/pattern_processing.ipynb However, none of the internal doc intersphinx links work... |
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
Signed-off-by: Håkon Wiik Ånes hwaanes@gmail.com
Description of the change
nbsphinx
(https://nbsphinx.readthedocs.io/en/0.8.0/) dependency when building the docs (i.e. the user only has to install it ifpip install kikuchipy[doc/dev]
is used).nbsphinx
reformats Jupyter notebooks into rst files to include indoc/index.rst
.doc/pattern_processing.rst
file with adoc/pattern_processing.ipynb
file containing the exact same information, only plotting and code cells are displayed differently.kikuchipy.data
module public to simplify making of the user guide.If this works well and looks OK, the plan is to remove the other user guide pages and only use Jupyter Notebooks.
A major drawback is that intersphinxing in notebook markdown cells is limited, meaning we have to insert the exact URLs for other packages, and write
where we previously could write
I'll write these things down in the contributing guide as this PR progresses.
A huge win is the automatic running of the notebook (and thus testing), and the easy and intuitive way in which the user guide can be created.
Progress of the PR
kikuchipy.data
module work likeskimage.data
(https://github.com/scikit-image/scikit-image/tree/master/skimage/data) for a (3, 3, 60, 60) shape Nickel data setUse theFor another PR.kikuchipy.data.nickel_small
dataset in tests.Figure out a clean way to download data to be used by the notebooksLet's put this off for now, and try to build a smart data module instead~Set up automatic build of the notebooks with data downloading preferably done only once for all notebooks (same data used by all notebooks)~The notebooks are converted to reST files by
nbsphinx
upon doc builds.For another time:
For reviewers
later.
__init__.py
.the unreleased section in
doc/changelog.rst
.