This repository is a template for building your own interactive JupyterBook with:
- JupyterLite integration (run notebooks directly in the browser, no installation needed)
- Google Colab option (open notebooks in Colab with one click)
It is designed for teaching, self-study, or research projects, especially where business + machine learning intersect. You can fork this repo and customize it for your own course, project, or book.
- Interactive Book built with JupyterBook
- In-browser execution via JupyterLite
- Colab badges to open notebooks directly in Google Colab
- Pre-configured GitHub Actions for automatic deployment to GitHub Pages
- Organized structure with
content/files/for notebooks,_config.yml, and_toc.ymlalready set up
Follow these steps to set up and customize your own JupyterBook with JupyterLite:
-
Create Your Repository
- Click the "Use this template" button (green button at the top of this repository on GitHub).
- Give your new repository a name, e.g.,
my-ml-book. - Choose whether to make it public or private, then click "Create repository from template".
-
Clone Your Repository Locally
- Clone the repository to your local machine:
git clone https://github.com/yourusername/my-ml-book.git cd my-ml-book
- Clone the repository to your local machine:
-
Update Configuration Files
- Edit
_config.ymlto customize your book’s metadata:title: Your Course or Book Title author: Your Name logo: path/to/your/logo.png # Optional: Add a logo image execute: execute_notebooks: 'off' # Set to 'auto' if you want to execute notebooks during build
- Edit
_toc.ymlto define your table of contents. For example:format: jb-book root: intro chapters: - file: content/files/course_introduction - file: content/files/how_to_use - file: content/files/roadmap_prereqs
- Ensure notebook filenames in
_toc.ymlmatch those incontent/files/(without the.ipynbextension).
- Edit
-
Generate Notebooks from
_toc.yml- Run the
auto_notebook_creation_using_toc.pyscript to generate empty notebooks based on_toc.yml:python notebooks/auto_notebook_creation_using_toc.py
- This script creates empty
.ipynbfiles incontent/files/for each entry in_toc.yml(e.g.,course_introduction.ipynb,how_to_use.ipynb). - Verify the generated notebooks in
content/files/:ls content/files/*.ipynb
- Run the
-
Customize Notebooks
- Edit the notebooks in
content/files/(e.g.,content/files/roadmap_prereqs.ipynb) to add your content. - Use Markdown cells for text, code cells for Python examples, and include JupyterLite/Colab badges (see examples in the provided notebooks).
- Edit the notebooks in
-
Set Up GitHub Pages
- Go to your repository on GitHub > Settings > Pages.
- Under Source, select GitHub Actions as the deployment source.
- The workflow (
.github/workflows/jupyterlite.yml) will automatically deploy to thegh-pagesbranch when you push changes.
-
Commit and Push Changes
- Stage, commit, and push your changes to the
mainbranch:git add _config.yml _toc.yml content/files/*.ipynb git commit -m "Customize config and notebooks" git push origin main
- The GitHub Actions workflow will automatically build and deploy your site to GitHub Pages.
- Stage, commit, and push your changes to the
-
Access Your Website
- Once the workflow completes, visit
https://<yourusername>.github.io/my-ml-book/jupyterlite/lab/index.html?path=files/roadmap_prereqs.ipynb. - Any changes to notebooks in
content/files/will trigger the workflow, rebuilding and deploying the site automatically.
- Once the workflow completes, visit
You have three options to run notebooks:
-
In the Browser (No Installation Needed)
- Click the "Launch in JupyterLite" badge in any notebook to run it instantly in your browser via JupyterLite.
-
On Google Colab
- Click the "Open in Colab" badge at the top of each notebook to run it in Google Colab.
-
Locally
- Install dependencies:
pip install -r requirements.txt
- Run the build and serve locally:
chmod +x build_jupyterlite.sh ./build_jupyterlite.sh
- Access at
http://localhost:8000/jupyterlite/lab/index.html?path=files/roadmap_prereqs.ipynb.
- Install dependencies:
Dr. Chandravesh Chaudhari
📧 chandraveshchaudhari@gmail.com
🌐 Personal Website
🔗 LinkedIn
- Use the sidebar (📑 Table of Contents) to navigate through chapters.
- Try out the examples directly in JupyterLite or Google Colab.
- Customize the content and publish your own book.