Welcome! This repository contains the Markdown files that make up the CS 61AS course textbook.
If you need a refresher on Markdown, see here.
See here.
To edit the course website/textbook from your browser:
That's all! Note that your changes will not be visible on the live course webpage until your proposed change is reviewed.
If you get stuck at any point, contact Allen at allenguo@berkeley.edu. Comments and suggestions are also welcome.
Once your changes are merged into the master branch of this repository, you can update the live site using the tool found here. This tool
If the above tool is not working, please follow the manual deployment instructions below.
These instructions are for staff members with write access to both this repository and the berkeley-cs61as.github.io repository.
Before you begin:
To deploy:
git pull
.publish.py
by doing python publish.py
. This will convert all of the Markdown files to HTML. By default, the resulting HTML files will be placed in ../berkeley-cs61as.github.io
.../berkeley-cs61as.github.io
.If you're interested in what publish.py
does, or you want to make more complicated changes to the textbook, keep reading.
The following either don't work or aren't officially supported:
To delete/add sections, simply delete/add Markdown files as needed. Keep in mind:
section## Title Goes Here.md
, where the #
s are numerical digits. Multiple sections may not share the same title. This is true across the entire textbook.Deleting/adding chapters is kind of like deleting/adding sections: simply delete/add directories as needed. Keep in mind:
chapter## Title Goes Here/
, where the #
s are numerical digits.Additionally, you must update the units
variable in config.py
, which tells publish.py
what chapters belong in each unit. units
should be fairly easy to understand.
Remove/add the appropriate mapping from the units
variable in config.py
.
publish.py
Do?publish.py
has several roles:
../berkeley-cs61as.github.io
).Our publishing system includes a very simple templating system similar to what you might see in Templar or Django.
Take a look at textbook-template.html
. Every page in the textbook uses this template. This template allows the following variables:
{{title}}
is the title of the page (i.e., the section title).{{content}}
is the content of the page (converted from Markdown).{{chaptertitle}}
is the title of the parent chapter.{{chaptertoc}}
is the table of contents for the parent chapter.A similar templating system exists for (non-textbook) pages. The template file is called page-template.html
.
As stated above, the table of contents for each chapter is generated by publish.py
and inserted using the templating language. In contrast, the table of contents for each section is generated from the front-end using jQuery.