Skip to content
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

docs!: switch to sphinx-book-theme #209

Merged
merged 15 commits into from
Sep 7, 2021
Merged

docs!: switch to sphinx-book-theme #209

merged 15 commits into from
Sep 7, 2021

Conversation

redeboer
Copy link
Contributor

@redeboer redeboer commented Jul 24, 2021

Documentation is now built with the sphinx-book-theme. Main reason is that it works much better for Jupyter notebooks, particular in combination with sphinx-thebe. That solves the nbsphinx_prolog issue mentioned in #208.

Have a look at the preview here

Some related changes:

@redeboer redeboer mentioned this pull request Jul 24, 2021
@redeboer
Copy link
Contributor Author

redeboer commented Jul 24, 2021

@ianhi Related to 057866a, check out ReviewNB

@ianhi
Copy link
Collaborator

ianhi commented Jul 26, 2021

@ianhi Related to 057866a, check out ReviewNB

Been meaning to do this. Thanks for the push towards this - done.

Added nbQA formatting and nbstripout

Actually just discovered nbQA because it's author just starred this repo 😮 - looks great big supporter of this

image


Will look at this more thoroughly tomorrow. and again deep thanks for all the wonderful work

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@MarcoGorelli
Copy link

Actually just discovered nbQA because it's author just starred this repo 😮 - looks great big supporter of this

😆 incidentally I discovered mpl-interactions because nbQA was mentioned here - I love matplotlib and Jupyter notebooks so this is extremely useful, thanks for your work on this!

redeboer and others added 14 commits July 26, 2021 20:32
This substitutest the original nbsphinx_prolog
This allows moving the examples directory
This is required to get the Binder thebe links working. Some other
major changes:

* gifmaker.py has been removed. Instead, gifs and apngs are included
  as a markdown cell. This also nice, because you can see the gifs
  while working on the notebooks in Jupyter.
* Input cells with "gif" metadata now have a tag "remove-output", so
  that the subsequent Markdown cell with gif looks like the cell output
  when generating using jupyter_execute_notebooks.
* Sphinx-autobuild can now also trigger on changes to the examples
  notebooks (had to be excluded before because of copied files from the
  gifmaker)
These two tracked files are annoying to git, because they are
overwritten each time the notebooks are run
It's now possible to run the notebooks and generate cell outputs by
setting the EXECUTE_NB variable (to anything) or using tox -e docnb
Document names determine the URLs. It's best to keep these short and
usually URLs are all lower-case.
For margin and toggle directives
@redeboer redeboer marked this pull request as ready for review July 26, 2021 18:52
@ianhi
Copy link
Collaborator

ianhi commented Sep 7, 2021

Will look at this more thoroughly tomorrow. and again deep thanks for all the wonderful work

This has been an uhhhh extremely permissive definition of tomorrow :( Sorry about that, looking now!

e50d6bf also removes the gifmaker

I guess this may be down to personal preference but I don't love this. I did this because I wanted the docs to be different as presented in the docs vs when used interactively. So for example in https://mybinder.org/v2/gh/redeboer/mpl-interactions/sphinx-book-theme?urlpath=lab/tree/docs/examples/ when you run the cells you end up with the GIF and the actual interactive output. Overall it's just a small nit though and this is great so I'm going to go ahead and merge - thank you again!

As an aside I think the ultimate solution to interactive docs here is not to muck around with recording and embedding gifs but to have the whole docs be interactive using: jupyterlite (wasm powered full python kernel) which may be achievable via https://jupyterlite.readthedocs.io/en/latest/deploying.html?highlight=sphinx but that's probably a project for another day.

Copy link
Collaborator

@ianhi ianhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@ianhi ianhi merged commit e00bf31 into mpl-extensions:master Sep 7, 2021
@redeboer redeboer deleted the sphinx-book-theme branch September 8, 2021 08:27
@redeboer
Copy link
Contributor Author

redeboer commented Sep 9, 2021

This has been an uhhhh extremely permissive definition of tomorrow :( Sorry about that, looking now!

Hahaha no worries 😅

I guess this may be down to personal preference but I don't love this. I did this because I wanted the docs to be different as presented in the docs vs when used interactively. So for example in https://mybinder.org/v2/gh/redeboer/mpl-interactions/sphinx-book-theme?urlpath=lab/tree/docs/examples/ when you run the cells you end up with the GIF and the actual interactive output. Overall it's just a small nit though and this is great so I'm going to go ahead and merge - thank you again!

As an aside I think the ultimate solution to interactive docs here is not to muck around with recording and embedding gifs but to have the whole docs be interactive using: jupyterlite (wasm powered full python kernel) which may be achievable via https://jupyterlite.readthedocs.io/en/latest/deploying.html?highlight=sphinx but that's probably a project for another day.

Thanks for writing out your thoughts here! I also need some easier way to have this interactivity directly available in the browser, so I'd also be interested in something like jupyterlite. But for now, as you say, it is indeed more a matter of preference of how to get these gifs in the docs. I think in terms of maintenance it is a bit clearer if the gifs are explicitly added through the markdown rather than the (less accessible) cell metadata and further logic that is implemented in the conf.py.

@ianhi
Copy link
Collaborator

ianhi commented Sep 9, 2021

Some relevant issues:

jupyter-book/thebe#412
Recently active: jupyter-book/thebe#465
pyodide/pyodide#1713
jupyterlite/jupyterlite#149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants