About this site

1. Making the site

For a long time I liked to have a homepage/blog:

  1. With pages in Tufte style, so that I can include remarks and figures in the margin;
  2. Exercises that have hidden, but clickable, hints and solutions;
  3. Written in org mode and emacs.

Exercises, theorems, algorithms, and expandable hints and solutions share a small Org exporter in defblock.el. Numbering follows the expanded document, including included files. Course chapters also have a contents list and links to the previous and next chapters in book order.

These links helped me starting.

  1. https://parsec.ro/
  2. https://github.com/ctanas/parsec-lisp
  3. https://github.com/alhassy/org-special-block-extras

Here is some material that I should study at a later time:

  1. https://ogbe.net/blog/emacs_org_static_site

The site uses Emacs, Org, ox-tufte, MathJax 4, and Pygments. Pseudocode blocks use KaTeX through pseudocode.js. Install Emacs and the pygmentize command, then install the Emacs packages once:

make setup

Build changed pages with make. After changing templates, build scripts, shared macros, or the course chapter order, rebuild every page with make force. Publishing uses the installed packages and does not refresh package archives. Run make check to check block numbering, references, and chapter navigation.

The output defaults to ~/tmp/sites/homepage. To build a separate preview:

make force PUBLISH_DIR=/tmp/homepage-preview
python -m http.server --directory /tmp/homepage-preview

Course sources and shared KaTeX files live outside this directory; their paths are configured in courses.el and katex.el. MathJax 4 is the default; to build the site with KaTeX instead, run make force MATH_RENDERER=katex. See MATHRENDERER.md for preview and deployment steps.

To view it locally, run python -m http.server in /tmp/sites/homepage. Then open localhost:8000 in Firefox.