This is a short guide for maintaining Jupyter Book. If you're brand new to Jupyter Book, you should probably check out the Contributing Guide first!
Jupyter Book is essentially two things, both of which live in the top jupyter_book/
folder:
- A book template with HTML/CSS/structure that defines a book structure. This
lives in
jupyter_book/jupyter_book/
. There is also a minimal folder that contains a few simple content files that we use withjupyter-book create
to pre-populate content. - A command-line interface that creates new books and controls machinery to do things
like generate book-ready files from your notebooks. These are the Python files
in
jupyter_book/
.
Tests are located at jupyter_book/tests/
.
They are written with pytest, and try to test much of the book creating and building
machinery. They currently don't do a great job of testing the javascript/HTML of built
books, but if you had ideas for how that could be improved, we'd really love it ✨!
The tests uses a collection of configurations (in configs/
) and book files (in content/
).
Jupyter Book deploys its documentation automatically using CircleCI. The
documentation lives as a collection of HTML files on the gh-pages
branch
of the repository. CircleCI has the permissions to push to gh-pages
, and
so the following things happen to get the docs updated:
When a PR is merged into master, do the following:
- First, run a Docker image with Python and use
jupyter-book
to build the latest markdown files from the latestcontent/
folder. (circleci step here). Persist the contents of the_build/
folder with thepersist_to_workspace
command. - Then, run a Ruby image that loads in the
_build/
folder and builds the HTML for the site using Jekyll. (circleci step here). - Finally,
git push
the contents of_site/
to thegh-pages
branch of the repository, including a.nojekyll
folder, and then GitHub Pages will host the updated site.
All of this is configured in the CircleCI configuration.