From 5f0252aedcb25c882320e3144686c4c63be26702 Mon Sep 17 00:00:00 2001 From: sceox Date: Wed, 8 Dec 2021 15:44:05 -0800 Subject: [PATCH] document lowdown as dependency; add some error handling --- README.md | 10 ++++++++++ publish.sh | 11 +++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 79ac523..23e5cf6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/publish.sh b/publish.sh index 689133d..6d343ea 100755 --- a/publish.sh +++ b/publish.sh @@ -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