berkeley-cs61as / markdown-courseware

The Markdown files that comprise the CS 61AS website.
https://berkeley-cs61as.github.io/
0 stars 3 forks source link

markdown-courseware

Welcome! This repository contains the Markdown files that make up the CS 61AS course textbook.

If you need a refresher on Markdown, see here.

Quickstart

Proofreading Guidelines

See here.

Editing Instructions

To edit the course website/textbook from your browser:

  1. Navigate to the Markdown file you want to edit.
  2. Click the "edit" button, then make your changes.
  3. When you are done editing, briefly describe your edits in the commit message box at the bottom.
  4. Submit your edits by clicking "Propose file change" and follow any further instructions.

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.

Updating the Live Site

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.

Manual Deployment

These instructions are for staff members with write access to both this repository and the berkeley-cs61as.github.io repository.

Before you begin:

  1. Make sure you have Python 2.7 installed. As of right now, Python 3 is not supported.
  2. Clone this repository.
  3. Clone berkeley-cs61as.github.io.

To deploy:

  1. Navigate to this repository.
  2. Do a git pull.
  3. Run 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.
  4. Navigate to ../berkeley-cs61as.github.io.
  5. Commit and push.
  6. Your changes will be instantly visible at http://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.

Things That Don't Work

The following either don't work or aren't officially supported:

More Complicated Changes

Deleting/Adding Sections

To delete/add sections, simply delete/add Markdown files as needed. Keep in mind:

Deleting/Adding Chapters

Deleting/adding chapters is kind of like deleting/adding sections: simply delete/add directories as needed. Keep in mind:

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.

Deleting/Adding Units

Remove/add the appropriate mapping from the units variable in config.py.

What Does publish.py Do?

publish.py has several roles:

Templating

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:

A similar templating system exists for (non-textbook) pages. The template file is called page-template.html.

Generating Tables of Contents

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.