document lowdown as dependency; add some error handling

This commit is contained in:
sceox 2021-12-08 15:44:05 -08:00
parent f596aa50b3
commit 5f0252aedc
2 changed files with 19 additions and 2 deletions

View File

@ -21,6 +21,16 @@ make script. :)
You can see this method in action (maybe! if we didn't break it) at
[https://testing.anarchyplanet.org](https://testing.anarchyplanet.org).
## Dependencies
We use [lowdown](https://kristaps.bsd.lv/lowdown/) for markdown
conversion. See its documentation:
* [overview](https://kristaps.bsd.lv/lowdown/)
* [lowdown(1)](https://kristaps.bsd.lv/lowdown/lowdown.1.html)
* [lowdown(5)](https://kristaps.bsd.lv/lowdown/lowdown.5.html) which
describes the lanuage syntax
## TODOs
### TODO discuss and decide on sections

View File

@ -1,11 +1,17 @@
#!/usr/bin/env bash
PUB_DIR=${1:-/home/html/planet/static}
FILES=md/*.md
MD_FILES=md/*.md
OTHER_FILES=*.css
if ! test -d $PUB_DIR; then
echo "error: PUB_DIR does not exist:" $PUB_DIR
exit 1
fi
test -d tmp || mkdir tmp
for f in $FILES
for f in $MD_FILES
do
filename=$(basename -- $f .md)
echo "publishing md/$filename.md to $PUB_DIR/$filename.html"
@ -21,3 +27,4 @@ do
cat tmp/head.html nav.html tmp/$filename.html foot.html tail.html \
> $PUB_DIR/$filename.html
done
cp $OTHER_FILES $PUB_DIR