summaryrefslogtreecommitdiff
path: root/gen-docs.sh
diff options
context:
space:
mode:
authoreudoxia <uplink@distress.network>2022-04-01 00:04:08 -0400
committereudoxia <uplink@distress.network>2022-04-01 00:04:08 -0400
commiteac46231ab86e3b6a3862c92323ee58fe1ee722b (patch)
tree0440a92a680eb402735991cd4fa791de0c6437fa /gen-docs.sh
parent27f4773b122a2758cfaf88537c9e1a8ad5df7e69 (diff)
doc generation integrated with distress.network
Diffstat (limited to 'gen-docs.sh')
-rwxr-xr-xgen-docs.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/gen-docs.sh b/gen-docs.sh
index 12ab3ac..747af12 100755
--- a/gen-docs.sh
+++ b/gen-docs.sh
@@ -1,9 +1,21 @@
#!/bin/sh -e
+tmp=$(mktemp -p /tmp)
+css=".lp-ref {font-family: neue-haas-grotesk-text, var(--fs-sans); font-style: italic;}"
+
for file in "data" "log" "tangle" "weave" ; do
- cp "doc/header-html" "doc/${file}.html" ;
- cat "doc/header-lp" "${file}.lp" | ./weave | lowdown -Thtml >> "doc/${file}.html" ;
- printf "</body>\n</html>" >> "doc/${file}.html" ;
- sed 's/\(.*\)@= \(.*\) =@/\1<span class="ref" >(\2)<\/span>/1' -i'' "doc/${file}.html" ;
+ in="${file}.lp" ; out="doc/${file}.html" ;
+ cat "doc/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 "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
+
+rm "$tmp"