Hosting books#

need to sort out

  • List here - inc. Quarto Pub, Posit Connect, Posit Cloud, Netlify, Confluence, Hugging Face Spaces

  • RPubs

  • Readthedocs

  • GitHub pages

GitHub pages#

Note: Written for jupyter book…

To publish book on GitHub Pages:

  • Install ghp-import

  • Navigate to book’s root directory (contains _build/html) and run: ghp-import -n -p -f _build/html (if a directory above, can do bookname/_build/html instead)

  • View book at https://<user>.github.io/<myonlinebook>/

To update book, make changes in main branch, rebuild book, then use ghp-import -n -p -f _build/html as before to push newly built HTML to gh-pages branch. Will take a few minutes for page to update.

To set this up to just run from the command book:

  • cd to go to top of directory (i.e. above documents)

  • nano .bashrc

  • At bottom of file, add alias book="jupyter-book build ./ && ghp-import -n -p -f _build/html", then save the file

  • Run source .bashrc to refresh

  • Then, when you want to recreate the jupyter book and push to GH pages, go to where the book is (i.e. where build and config is) and run book

  • Also set up config file if desired to execute pages off if don’t want to re-run all the notebooks each time