1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
#
# Serve the calc docs locally with hot-reload at http://localhost:8000.
#
# First-time setup (once):
# python3 -m venv .venv
# ./.venv/bin/pip install -r requirements.txt
#
# Then just run `s/docs` from anywhere in the repo.
#
# Linux gotcha: Zensical's file watcher consumes an inotify instance, and the
# per-user cap (fs.inotify.max_user_instances, often 128) is easily saturated by
# editors and file-syncers. If serve panics with "Too many open files", raise it:
# sudo sysctl fs.inotify.max_user_instances=512
# Prefer the project venv; fall back to a zensical already on PATH.
if ; then
ZENSICAL=.venv/bin/zensical
elif ; then
ZENSICAL=zensical
else
fi
# With no arguments, open the browser at http://localhost:8000 automatically -
# the common case during docs work. Pass any argument(s) to take full control
# (e.g. `s/docs --dev-addr 0.0.0.0:8000` on a remote / headless machine).
if ; then
else
fi