This is the website containing course readings for the course Introduction to Computational Literary Analysis, taught at UC Berkeley in summer 2022.
Please refer to the course website for more information: https://icla2022.jonreeve.com
Nota bene: students need not do any of this. These are just instructions for building the website from scratch.
To build this site manually, install the Nix package manager:
bash <(curl https://nixos.org/nix/install)
Optionally, enable the Nix cache if you would like to speed up local builds:
# If you do not already have cachix, install it:
nix-env -iA cachix -f https://cachix.org/api/v1/install
# Enable nix cache for rib
cachix use srid
To build and run the site:
nix-shell --run 'ghcid -T ":main -wS"'
This launches a web server at http://localhost:8080 serving the statically
generated content. Changing either ./src/Main.hs
or the content in ./content
reloads everything.
You might have a local checkout of rib with certain modifications. And you might want to run ghcid with the server running at a different port. Both of this can achieved using the following command:
# Assuming rib is cloned at ../rib
nix-shell --arg rib ../rib --run 'ghcid -T ":main -ws :8081"'
A fully built executable can be produced using nix-build
:
$ nix-build
...
$ ./result/bin/rib-sample --help
Usage: rib-sample [--rebuild-all] [-w|--watch] [(-s|--serve [HOST]:PORT) | -S]
[--quiet] [--input-dir INPUTDIR] [--output-dir OUTPUTDIR]
Generate a static site at OUTPUTDIR using input from INPUTDIR
Available options:
--rebuild-all Rebuild all sources
-w,--watch Watch for changes and regenerate
-s,--serve [HOST]:PORT Run a HTTP server on the generated directory
-S Like `-s 127.0.0.1:8080`
--quiet Log nothing
--input-dir INPUTDIR Directory containing the source files (default:
content)
--output-dir OUTPUTDIR Directory where files will be generated (default:
dest)
-h,--help Show this help text