Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Set up your computer

If you’ve never used GitHub, a code editor, or a terminal, start here. None of it is hard, but it’s a lot of unfamiliar words at once, so this page goes slowly and explains each thing the first time it comes up. By the end you’ll have a course open on your own computer, you’ll have changed a sentence in it and seen the change in your browser, and you’ll have an AI assistant sitting next to you for the moments when something doesn’t work.

One thing before you install anything. If all you want is to fix a typo or reword a paragraph, you can skip this page: Change a course does that entirely on a website. Come back here when you want to write new lessons or work on the visuals.

The four things to get

You need a GitHub account and three free programs. Each one does a single job, and it helps to know what that job is.

GitHub is a website that stores the course’s files and keeps every past version of them. It’s also what puts the finished course on the web. Make a free account at github.com.

VS Code is where you’ll do everything else. It’s an editor, like Word, but for plain text files. It shows all the files of a course in a list down the left side, and it’s also what copies a course from GitHub and sends your changes back. Get it at code.visualstudio.com.

Git is the tool VS Code uses behind the scenes to talk to GitHub. You won’t use it directly, but it has to be installed. On Windows, download it from git-scm.com and accept every default in the installer. On a Mac you can skip this: the first time it’s needed, your Mac will offer to install it, and you say yes.

Node is the one you’ll never look at. The engine that turns a course into a website runs on it. Go to nodejs.org, download the version the page offers, and click through the installer.

Get a course onto your computer

The easiest course to start from is Probability 1, because it already has one of everything. On GitHub, go to canonlearning/probability-1 and press Fork near the top right. A fork is your own copy. It lives under your account, and nothing you do to it can damage the original.

Now bring your copy down to your computer. Open VS Code, and on its welcome screen choose Clone Git Repository. Then choose Clone from GitHub. The first time, VS Code opens your browser and asks you to sign in to GitHub, and after that it lists your repositories. Pick probability-1, and pick a folder to keep it in. Documents is a good choice. “Clone” just means “download a copy that stays connected to GitHub”.

When it finishes, VS Code asks whether to open the course. Say yes, and say yes again if it asks whether you trust the folder. You should see the course’s folders down the left: lessons, problems, lectures, visuals. Click lessons, then conditional-probability.md, and you’re looking at a lesson.

What you’re looking at

That file is written in Markdown, which is the format every lesson, problem, and slide deck uses. Markdown is ordinary text with a few marks that say how it should look. You already know most of it from reading it:

# A title

## A section heading

A paragraph is just a paragraph. Leave a blank line between paragraphs.
Put **two stars** around words to make them bold.

- a dash starts a bullet
- and another

> A line starting with > is a callout.

The one part that will be new unless you’ve used LaTeX is the math. Math goes between dollar signs, so $\frac{1}{2}$ shows up as a fraction one half. You don’t have to memorize any of it. Copy what the existing lessons do, and ask the assistant (below) for anything you can’t find.

See it in your browser

A lesson file isn’t the web page yet. The engine builds the page, and you start the engine by typing two short commands.

In VS Code, open the Terminal menu at the top and choose New Terminal. A panel opens at the bottom with a blinking cursor. Type this and press Enter:

npm install

It downloads the engine, which takes a minute and prints a lot of text you can ignore. You only do this once. Then type:

npm run dev

It prints an address, http://localhost:4000. Open that in your browser and there’s the course, running on your own computer. Nobody else can see it yet.

Now try the thing this was all for. Go back to VS Code, change a sentence in the lesson, and save with Ctrl+S (Cmd+S on a Mac). Look at the browser. The page has already updated. That’s the whole loop for writing a course: type, save, look.

When you’re finished for the day, click in the terminal panel and press Ctrl+C to stop it. Next time, you only need npm run dev.

Add an AI assistant

You can paste an error or a lesson into Claude, ChatGPT, or Gemini in your browser and get good help. It’s better to use one that works inside VS Code, because it can read the whole course and make the change itself. All three have one: Claude Code, Codex from OpenAI, and Gemini Code Assist. Search for the name in the Extensions panel on the left, install it, and sign in with the account you already have. Copilot, which comes with VS Code, does the same job.

It’s useful for the terminal errors, for math that won’t display, for drafting problems in the style of the ones already there, and above all for the visuals, which are code.

Save your work and publish it

Your changes are only on your computer so far. Sending them to GitHub takes two steps, and both are buttons in VS Code.

There is one bit of setup first, which you do once. Git wants to know whose name to put on your changes. In the terminal panel, type these two lines with your own name and the email you used for GitHub, pressing Enter after each:

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Now click the Source Control icon in the strip down the far left. It looks like a branching line, and it has a number on it when you’ve changed something. The panel lists the files you changed. Type a few words in the box at the top about what you did (“Reworded the opening of lesson 1”) and press Commit. If VS Code asks whether to include all your changes, say yes. Then press Sync Changes. Commit means “save this as a version”, and sync means “send it to GitHub”.

To put your course on the web, there’s a one-time switch. On your fork’s page on GitHub, open Settings, choose Pages on the left, and set Source to GitHub Actions. Then open the Actions tab and turn workflows on. From then on, every time you sync, your site rebuilds, and a minute or two later it’s live at https://<your-name>.github.io/probability-1/.

That’s everything. From here, Make a course explains what goes in each kind of file, one at a time.