Skip to content

utensil/blog

Repository files navigation

Blog

My math-intensive learning notes are hosted in this blog. Built with:

The illustrative diagrams in this blog aim to be reproduceable, they are made by one of:

Local Development

Install the following tools per instructions:

Or simply run the following on MacOS if you have Homebrew installed:

brew install hugo quarto d2 watchexec

Particularly, Pikchr will be installed from source by scripts/make_pikchr.sh on first run.

Find out which Python Quarto is using:

quarto check

and use it as python3 in the following commands:

python3 -m pip install jupyter --break-system-packages
python3 -m IPython kernel install
python3 -m pip install -r requirements.txt --break-system-packages

--break-system-packages is needed if you are using a system Python installation, installed by brew for example, which is the one used by quarto for me under MacOS, despite that I'm already using pyenv to manage Python versions.

Install Julia for Quarto notebook support:

brew install julia

Initialize the submodules for Hugo themes and extensions:

git submodule update --init --recursive

Run the following to make D2, Pikchr diagrams and Typst documents for the first time:

./scripts/make_all.sh

Finally, run ./scripts/dev.sh to do the following 3 tasks in on go.

If you are simply working on a vanilla markdown post, just run:

hugo serve -w --forceSyncStatic --disableFastRender --ignoreCache --noHTTPCache # --gc --cleanDestinationDir

then navigate to something like http://localhost:1313/blog/ in your browser, as prompted.

If you are authoring with Quarto, run in a separate terminal:

quarto preview --no-serve --no-browser --render all

If you are authoring with Typst/D2/Pikchr/Bibliography, run in a separate terminal:

# watchexec --ignore-nothing -vvv --project-origin . -w content/posts/math-2024 -e d2,pikchr,typ,bib --only-emit-events --emit-events-to json-stdio --print-events --notify --poll 500ms
watchexec --on-busy-update queue --poll 500ms -e d2,pikchr,typ,bib --emit-events-to=stdio -- ./scripts/make_changed.sh