Documentation compilation

Documentation compilation#

The doc is created using Jupyter-book.

Setting up Jupyter-books#

These steps will allows you to create a basic setup. For more details visit here.

  1. Create a new Python virtual environment or use an existing one.

python3 -m venv jupyter_env
  1. Install Jupyter-book.

pip3 install -U jupyter-book
  1. Create a template for quick start.

jupyter-book create docs/

This will create a directory in the $PWD named docs/. The table of contents are stored in _toc.yml and the configuration is stored in _config.yml.

  1. Building a project

jupyter-book build docs/

For a full rebuild:

jupyter-book build --all docs/

If the toc doesn’t update. This will update the entire project.

  1. Publish the docs in the new branch.

ghp-import -n -p -f docs/_build/html
  1. Deploy website Go to “Settings->Pages” of the repo. Set the “Source” to “Deploy from a branch”. In the “Branch”, select the “gh-pages” branch and location as the “/root”.

  2. GitHub pages force build GitHub pages is known for its laziness. To force deploy the website go to “Setting->Pages”. Here, search for the following line:

Your site was last deployed to the github-pages environment by the pages build and deployment workflow.

Click on “pages build and deployment” and click on the button “Re-run all jobs” on the top right corner.

  1. Include notebooks outside the docs/ directory You can create a soft link in the book directory to the directory with the notebooks you want to include:

ln -s ../Tutorials ./Tutorials   

You can also link to a document as follows:

ln -s ../../README.md ./README.md