From 753ea786104748fa457c25e6625ff904d6cab46d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sat, 23 Sep 2023 21:30:13 +0200 Subject: [PATCH] optional title and alt label in pagelist --- macros/pagelist | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) 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 +} -- 2.39.2