From bf4a390c23a860ff8bda9538942f2b16cdcf8c05 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 4 Apr 2023 12:10:54 -0300 Subject: Makefile: Add ShellCheck to "check" target --- v2/src/development/genhtml.sh | 93 ++++++++++++++++++++++--------------------- v2/src/development/getconf.sh | 14 ++++--- 2 files changed, 56 insertions(+), 51 deletions(-) (limited to 'v2/src/development') diff --git a/v2/src/development/genhtml.sh b/v2/src/development/genhtml.sh index cb8fd73..d816fe6 100755 --- a/v2/src/development/genhtml.sh +++ b/v2/src/development/genhtml.sh @@ -72,6 +72,7 @@ FILENAME="${1:-}" eval "$(assert_arg "$FILENAME" 'FILENAME')" +# shellcheck source=/dev/null . "${FILENAME%.md}.conf" # @@ -185,14 +186,16 @@ add_headings_anchors() { } emit_body() { - cat "${FILENAME%.md}.entry-content" | + < "${FILENAME%.md}.content" \ markdown_to_html | extract_plaintext_snippets | add_line_numbers | add_headings_anchors } - +if false; then + emit_body +fi @@ -202,22 +205,22 @@ emit_body() { cat <<-EOF - + - - + + $$title_html - - - + + + - - + +
@@ -237,41 +240,41 @@ EOF exit -.md.rehtml: - F="$<"; . "$${F%.md}.conf"; envsubst < src/lib/reamble."$$lang".html > $@ - -.md.osthtml: - F="$<"; . "$${F%.md}.conf"; envsubst < src/lib/ostamble."$$lang".html > $@ - - - - - - - - -EOF +# .md.rehtml: +# F="$<"; . "$${F%.md}.conf"; envsubst < src/lib/reamble."$$lang".html > $@ +# +# .md.osthtml: +# F="$<"; . "$${F%.md}.conf"; envsubst < src/lib/ostamble."$$lang".html > $@ +# +# +# +# +# +# +# +# +# EOF # FIXMEs: # - feeds diff --git a/v2/src/development/getconf.sh b/v2/src/development/getconf.sh index dd623f7..4b615a8 100755 --- a/v2/src/development/getconf.sh +++ b/v2/src/development/getconf.sh @@ -74,7 +74,7 @@ escape() { } { - cat src/lib/base-conf | tee "$FILENAME".tmp + tee "$FILENAME".tmp < src/lib/base-conf DELIMITER=0 while read -r line; do if [ "$line" = '---' ]; then @@ -92,9 +92,11 @@ escape() { VALUE="$(printf '%s' "$line" | cut -d: -f2- | sed 's|^ ||' | escape)" printf '%s="%s"\n' "$KEY" "$VALUE" done < "$FILENAME" | tee -a "$FILENAME".tmp + # shellcheck source=/dev/null . "$FILENAME".tmp - cat src/lib/base."$lang".conf + cat src/lib/base."${lang:?}".conf + # shellcheck source=/dev/null . src/lib/base."$lang".conf title="${title:-"$site_name"}" @@ -105,10 +107,10 @@ escape() { printf 'filename="%s"\n' "$FILENAME" printf 'url_part="%s"\n' "$url_part" printf 'url="%s"\n' "$(url-for "$url_part" | absolute)" - printf 'date_formatted="%s"\n' "$(LANG="$lang" date -d "$date" +"$date_fmt" | escape)" - printf 'mailto_uri="%s%s"\n' "$mailto_uri_prefix" "$(uri "$title")" - printf 'discussions_url="%s%s"\n' "$discussions_url_prefix" "$(uri "$title")" - printf 'sourcecode_url="%s%s"\n' "$sourcecode_url_prefix" "$FILENAME" + printf 'date_formatted="%s"\n' "$(LANG="$lang" date -d "${date:?}" +"${date_fmt:?}" | escape)" + printf 'mailto_uri="%s%s"\n' "${mailto_uri_prefix:?}" "$(uri "$title")" + printf 'discussions_url="%s%s"\n' "${discussions_url_prefix:?}" "$(uri "$title")" + printf 'sourcecode_url="%s%s"\n' "${sourcecode_url_prefix:?}" "$FILENAME" printf 'lang_url="%s"\n' "$(url-for "$lang"/)" -- cgit v1.2.3