From 8e23ad2e8c2d07f8e6328b83950834bfc3737c12 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 19 Feb 2022 17:43:35 -0300 Subject: aux/: Update --- aux/ci/ci-build.sh | 2 +- aux/workflow/manpages2html.sh | 40 +++++++++++++++++++++++++++++++++++++ aux/workflow/style.css | 46 +++++++++++++++++++++++++++++-------------- 3 files changed, 72 insertions(+), 16 deletions(-) create mode 100755 aux/workflow/manpages2html.sh (limited to 'aux') diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh index 5e5e656..8d18252 100755 --- a/aux/ci/ci-build.sh +++ b/aux/ci/ci-build.sh @@ -59,5 +59,5 @@ EOF RUNNER='sh -c' fi - $RUNNER 'make clean public dev-check' + $RUNNER 'make clean dev-check' } 2>&1 | tee "$LOGFILE" diff --git a/aux/workflow/manpages2html.sh b/aux/workflow/manpages2html.sh new file mode 100755 index 0000000..2498b5c --- /dev/null +++ b/aux/workflow/manpages2html.sh @@ -0,0 +1,40 @@ +#!/bin/sh +set -eu + +while getopts 'o:' flag; do + case "$flag" in + o) + OUTDIR="$OPTARG" + ;; + *) + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + echo "Missing $2" >&2 + exit 2 + fi +} + +assert_arg "${OUTDIR:-}" '-o OUTDIR' + +for f in "$@"; do + l="$(echo "$f" | awk -F. '{print $(NF-1)}')" + n="$(echo "$f" | awk -F. '{print $NF}')" + to_name="$(basename "${f%."$l"."$n"}.$n.html")" + mkdir -p "$OUTDIR/$l" + pandoc \ + --toc \ + --toc-depth=2 \ + -s \ + -r man \ + -w html \ + -H aux/workflow/favicon.html \ + -H aux/workflow/style.css \ + --metadata "lang=$l" \ + < "$f" > "$OUTDIR/$l/$to_name" +done diff --git a/aux/workflow/style.css b/aux/workflow/style.css index 56e4712..99980aa 100644 --- a/aux/workflow/style.css +++ b/aux/workflow/style.css @@ -1,19 +1,4 @@ -- cgit v1.2.3