X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=macros%2Finclude;h=1fd734cbe5214b0a83fd73107c85a1f345d61064;hb=e9bb2b8721a5a47baa5b41ddead1238ea2a23221;hp=ac72de9d427878a3c0ca76547ef796df91e6ef4c;hpb=f8bec3740e1d99684a5c33680e48d1f523c09983;p=shellwiki diff --git a/macros/include b/macros/include index ac72de9..1fd734c 100755 --- a/macros/include +++ b/macros/include @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2022 Paul Hänsch +# Copyright 2022 - 2023 Paul Hänsch # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -18,7 +18,7 @@ . "$_EXEC/acl.sh" . "$_EXEC/tools.sh" -from='1'; to='$'; rev=''; items='$'; hl=0; link='true'; depth=0; tags=''; page=''; +from='1'; to='$'; rev=''; items='$'; hl=0; link='true'; depth=0; tags=''; ntags=''; page=''; set -- "$@" -- while [ $# -gt 0 ]; do case $1 in @@ -33,6 +33,7 @@ while [ $# -gt 0 ]; do case $1 in --hl|-hl) hl=$2; shift 2;; --depth) depth=$2; shift 2;; \#*) tags="${tags}${tags:+ }${1}"; shift 1;; + \!*) ntags="${ntags}${ntags:+ }${1}"; shift 1;; --) shift 1; break;; *) set -- "$@" "$1"; shift 1;; esac; done @@ -60,6 +61,7 @@ done \ mdfile="$(mdfile "$page")" || continue acl_read "$page" || continue has_tags "$page" $tags || continue + has_tag "$page" $ntags && continue printf %s\\n "$INCLUDE_LIST" |grep -qxF "$page" && continue export INCLUDE_LIST="${INCLUDE_LIST}${INCLUDE_LIST:+${BR}}$page" hglob="$(HTML "$glob")"