Course notes for CS 61C. A Jupyter Book 2 project.
This website is currently deployed at <notes.cs61c.org> via Cloudflare pages. If redeployment is needed, follow the below instructions, which assume a freshly forked copy of this repository, and redeployment to an entirely new Pages project:
Redeployment from a fresh repo
- GitHub Setup
- Go to GitHub organization settings => GitHub Apps => Cloudflare Pages => Configure => Repository Access, and ensure that the app has access to this repository.
- Create a Pages project in Cloudflare
- Login to Cloudflare
- If you are doing this for CS61C, please login as the CS61C Cloudflare account and use "CS61C DNS Account" to have access to the DNS records for <cs61c.org>
- Go to Workers and Pages => Create Application => Looking to deploy Pages? Get started
- Import an existing Git repository => Get Started
- Make sure GitHub account is set to whichever organization has this repository
- Select a repository =>
this repository's name=> Begin Setup - Set the following:
- Production branch:
main - Framework preset:
None - Build command:
bash build.sh - Build output directory:
_build/html(see below)
- Production branch:
- Click Save and Deploy. This should deploy the project. Once it completes, click "Continue to Project".
- Login to Cloudflare
- Configure a custom domain in the project
- Click "Custom domains" in the top navigation bar of the project
- Add a custom domain => enter the desired domain. (e.g.
notes.cs61c.org - Click "Continue"
- Make sure everything looks fine, then click "Activate domain". It may take up to 48 hours to propagate, but based on past experience, it is way faster than that.
If minor changes are needed, go to the existing Cloudflare Pages project (must be logged in to the CS61C Cloudflare), select "Settings" and configure as desired.
Cloudflare Pages expects:
- a directory with HTML source to serve as a static site:
_build/html(mystmd docs), and - a build command that generates that directory:
bash build.shwrapsmystmd buildwhich is installed from the pywrangler configpyproject.toml.
- If you have
pipon your machine, follow the "Install withpip" instructions on the Jupyter Book website. - Try locally serving the book:
jupyter book start - If the above command fails, you may need to try a different installation method---likely because jupyter is incorrectly configured on your machine . If you have
npm, use that. Otherwise here are theuvinstructions that work on Mac M1 chips. Create a virtual environment withuvand then install viauv pip.
uv venv
source .venv/bin/activate
uv pip install "jupyter-book>=2.0.0"
uv run --with jupyter jupyter book start # use this syntax for running all jupyter book commands