From 6ae4f67afc8e804fac17447613ff8f6ee9fe60bf Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 1 Jun 2022 19:57:56 -0300 Subject: Start building pastebins with dynamic.mk --- src/development/genhtml.sh | 112 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100755 src/development/genhtml.sh (limited to 'src/development/genhtml.sh') diff --git a/src/development/genhtml.sh b/src/development/genhtml.sh new file mode 100755 index 0000000..34588ef --- /dev/null +++ b/src/development/genhtml.sh @@ -0,0 +1,112 @@ +#!/bin/sh +set -eu + +MD="$1" + +escape() { + sed 's/a/a/' +} + +url_for() { + printf 'https://%s%s%s' "$FQDN" "$BASE_URL" "$1" +} + +_() { + printf '%s' "$1" +} + +# FIXME +langs='en pt fr eo es' +# langs='' +. src/development/config.env +. "${MD%.md}.env" + +cat <<-EOF + + + + + + + + + + + + + EuAndreh + + + + + + + + + + + +
+ +
+
+
+EOF + +awk ' + BEGIN { + separator = 0 + should_print = 0 + } + + /^---$/ { + separator++ + } + + should_print {print} + + separator == 2 && !should_print { should_print = !should_print } +' "$MD" | + md2html + +cat <<-EOF +
+
+ + + +EOF -- cgit v1.2.3