star-ty

Generate content for online publication
git clone git://git.meso-star.fr/star-ty.git
Log | Files | Refs | README | LICENSE

commit 484b50aa91868679ede9f47a38ee2801a57264fb
parent 345f894100c15b1deb0678a75eded3267325e19e
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 12 Nov 2025 16:12:33 +0100

Update a hook script provided as an example

Modify the HTML version of the manual pages it generates so as not to
create links to HTML manual pages that are not managed locally.

Diffstat:
Mexample/home/hooks/01-convert-man-pages.sh | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/example/home/hooks/01-convert-man-pages.sh b/example/home/hooks/01-convert-man-pages.sh @@ -12,12 +12,21 @@ # Man to convert is submitted on stdin man2html() # output_filename { + # Use sed to modify the generated HTML pages to remove links to manual + # pages that are not available locally. ( cd .. sty-genhead "${OLDPWD##*/}/$1" mandoc -O man=./%N.%S.html,fragment -T html -I os=UNIX cat ./templates/footer.html - ) > "$1" + ) \ + | sed \ + -e 's/<a class="Xr"[^>]\{0,\}>make(1)<\/a>/<a class "Xr">make(1)<\/a>/g' \ + -e 's/<a class="Xr"[^>]\{0,\}>md2html(1)<\/a>/<a class "Xr">md2html(1)<\/a>/g' \ + -e 's/<a class="Xr"[^>]\{0,\}>rsync(1)<\/a>/<a class "Xr">rsync(1)<\/a>/g' \ + -e 's/<a class="Xr"[^>]\{0,\}>shellcheck(1)<\/a>/<a class "Xr">shellcheck(1)<\/a>/g' \ + -e 's/<a class="Xr"[^>]\{0,\}>tidy(1)<\/a>/<a class "Xr">tidy(1)<\/a>/g' \ + > "$1" } printf "%s\n" "${man_pages}" | while read -r i; do