From: Paul Hänsch Date: Sat, 23 Sep 2023 19:30:13 +0000 (+0200) Subject: optional title and alt label in pagelist X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=753ea786104748fa457c25e6625ff904d6cab46d;p=shellwiki optional title and alt label in pagelist --- diff --git a/macros/pagelist b/macros/pagelist index 2971515..08764aa 100755 --- a/macros/pagelist +++ b/macros/pagelist @@ -19,12 +19,17 @@ . "$_EXEC/tools.sh" tags='' dir='' depth='' glob_system_pages=false +label='' labeltype='' altlabel='' cnt=0 set -- "$@" -- while [ $# -gt 0 ]; do case $1 in --system) glob_system_pages=true; shift 1;; --depth) depth="$2" shift 2;; \#*) tags="${tags}${tags:+ }${1###}"; shift 1;; + --h1|--h2|--h3|--h4|--h5|--h6|--label) + labeltype="${1#--}" label="$2"; shift 2;; + --alt-label) + altlabel="$2"; shift 2;; --) shift 1; break;; *) if [ ! "$dir" ]; then dir="$1" @@ -39,17 +44,31 @@ esac; done [ "$*" ] || set -- "*" [ "$depth" -ge 0 -o "$depth" -le 0 ] 2>&- || depth=0 -printf '\n' + elif [ "$altlabel" ]; then + printf '' "$(HTML "$altlabel")" + fi +}