From 2e66324e942fef01f44193e056279da1ec205a3f Mon Sep 17 00:00:00 2001 From: vosjedev Date: Thu, 9 Oct 2025 16:26:09 +0200 Subject: [html] Add infra for html files --- gen_html.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 gen_html.sh diff --git a/gen_html.sh b/gen_html.sh new file mode 100644 index 0000000..8a07020 --- /dev/null +++ b/gen_html.sh @@ -0,0 +1,42 @@ + + +cd html || { + "no html directory found" +} + +out=../src/sl_bot/web/html.py + +exec >"$out" # write all STDOUT to the file + +cat <"$out" done earlier all the output of the echo and sed statements get redirected directly into the output file + # the sed acts as `cat` with a find-replace + echo "$htmlname"'="""' # open multiline string + sed 's/"""/\\"\\"\\"/g' "$file" # add the HTML itself, also replace all occurences of """ with escaped ones to prevent closing the string early + echo '"""' # close multiline string + + echo "Included '$file' as html.$htmlname" >&2 +done | sed '//r .header.html' + #sed 's/^.*INSERT PAGE HEADER.*$/'"$header"'/' # this sed also inserts headers + + + -- cgit