summaryrefslogtreecommitdiff
path: root/gen-online.sh
diff options
context:
space:
mode:
Diffstat (limited to 'gen-online.sh')
-rwxr-xr-xgen-online.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/gen-online.sh b/gen-online.sh
new file mode 100755
index 0000000..4ba5a5b
--- /dev/null
+++ b/gen-online.sh
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+
+# This script solely generates the formatted code as hosted on the distress.network website. It is thus not intended for actual use by anyone other than the site owner.
+
+tmp=$(mktemp -p /tmp)
+css="h3,.lp-ref {font-family: neue-haas-grotesk-text, var(--fs-sans); font-size: 1rem; font-weight: normal; font-style: italic;} h3 {margin: 1rem;}"
+
+for file in "data" "log" "tangle" "weave" ; do
+ in="${file}.lp" ; out="doc/online/${file}.html" ;
+ cat "doc/online/header" "$in" | ./weave > "$tmp" ;
+ sed "s;title: ;&${in};1" -i'' "$tmp" ;
+ sed "s;leading: ;&${in};1" -i'' "$tmp" ;
+
+ pushd "../web" > "/dev/null" ;
+ sh "./md.sh" "$tmp" "../literary/$out" > "/dev/null" ;
+ popd > "/dev/null" ;
+ sed "/<meta http-equiv=/d" -i'' "$out" ;
+ sed "s~</head>~<style>${css}</style>\n&~1" -i'' "$out" ;
+ sed 's;\(.*\)@= \(.*\) =@;\1<span class="lp-ref">(\2)</span>;1' -i'' "$out" ;
+
+ echo "[ok] generated text '${file}'" ;
+done
+
+sh "./../sync.sh"
+
+rm "$tmp"