This page is for repository maintainers and will document how to edit and publish these notebooks to Github Pages.
You will need at least Git and Python installed on your machine.
And you will need read and write access to the Github repository unless you are forking this repository to your own. Please contact the site admin for access.
-
Clone this repository to your local machine
git clone https://github.com/LibraryOfCongress/data-exploration.git cd data-exploration
-
Install Jupyter Book
pip install jupyter-book
-
Create or update your Jupyter Notebooks locally using your favorite notebook editor.
-
Once you made your changes, now you can build the Jupyter Notebook HTML
jupyter-book build .
You can also signal a full re-build using the
--all
option:jupyter-book build --all .
Or you can manually delete the
_build/html
folder to build fresh -
Once built, you should be able to paste the file path (e.g.
file://path/to/data-exploration/_build/html/index.html
) displayed in the output into your browser bar to preview it. Make any changes necessary and re-run steps 3 and 4. -
Once you are ready to publish, you will need to add an empty file called
.nojekyll
to the folder./_build/html/
. This will tell Github not to interpret this as a Jekyll site.Then commit and push your changes to the main branch
git push origin master
And then push the generated HTML subfolder to the gh-site branch
git subtree push --prefix _build/html origin gh-site
This should trigger an automatic re-build of the changed Github Pages webpages. You should be able to see the status of those builds in the "Actions" section of the repository. And once deployed, view the final result on Github Pages.