From 4708b1750f705155c557cf9ca3f2b03967c47696 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 12 Jan 2021 16:55:34 -0500 Subject: Use mandoc and htagml for bin html --- bin/.gitignore | 1 + bin/Makefile | 16 ++++++++------- bin/html.sh | 65 ++++++++++++++++++++++++++++++++++++++++------------------ 3 files changed, 55 insertions(+), 27 deletions(-) diff --git a/bin/.gitignore b/bin/.gitignore index 2bfab38f..02f47efe 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -14,6 +14,7 @@ glitch hi hnel htagml +htmltags modem nudge open diff --git a/bin/Makefile b/bin/Makefile index f858d483..5820051c 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -93,10 +93,10 @@ psf2png.o scheme.o: png.h scheme.h: scheme ./scheme -c > scheme.h -tags: *.h *.c - ctags -w *.h *.c +tags: *.[chly] + ctags -tw *.[chly] -IGNORE = *.o *.html ${BINS_ALL} ${LINKS} scheme.h tags +IGNORE = *.o *.html ${BINS_ALL} ${LINKS} scheme.h tags htmltags .gitignore: Makefile echo config.mk '${IGNORE}' | tr ' ' '\n' | sort > .gitignore @@ -125,7 +125,11 @@ WEBROOT = /usr/local/www/causal.agency html: ${HTMLS} @true -${HTMLS}: html.sh scheme hi ttpre +${HTMLS}: html.sh scheme ttpre htagml htmltags + +htmltags: *.[chly] + rm -f $@ + for f in *.[chly]; do ctags -atw -f $@ $$f; done .SUFFIXES: .html @@ -145,9 +149,7 @@ ${HTMLS}: html.sh scheme hi ttpre sh html.sh $< man1/${<:.pl=.1} > $@ index.html: Makefile README.7 - sh html.sh Makefile README.7 \ - | sed -E 's,([a-z0-9-]+)[(][1-9][)],&,' \ - > index.html + sh html.sh Makefile README.7 > $@ install-html: ${HTMLS} install -d ${WEBROOT}/bin diff --git a/bin/html.sh b/bin/html.sh index e96a7210..600d37f5 100644 --- a/bin/html.sh +++ b/bin/html.sh @@ -10,32 +10,57 @@ cat < ${src} -${src} in git EOF -[ -f "$man" ] && man -P cat "${PWD}/${man}" | ./ttpre -./hi -t -f html -o anchor "$src" +opts='fragment' +[ "${man}" = "README.7" ] && opts="${opts},man=%N.html" +mandoc -T html -O "${opts}" "${man}" +cat < +${src} in git +EOF +./htagml -p -f htmltags "${src}" -- cgit 1.4.1