Add HTML page creation from man page to Makefile

This commit is contained in:
Thomas Jensen 2021-02-15 21:35:52 +01:00
parent 3f171adb22
commit 622890ab2f
No known key found for this signature in database
GPG Key ID: A4ACEE270D0FB7DB
3 changed files with 9 additions and 13 deletions

3
.gitignore vendored
View File

@ -19,10 +19,11 @@
/src/parser.h /src/parser.h
/src/parser.c /src/parser.c
/doc/boxes.1 /doc/boxes.1
/doc/boxes.1.raw.html
/doc/boxes.1.html
/pcre2-*/ /pcre2-*/
# Linux Packaging # Linux Packaging
doc/*.tar.gz
*.tar.gz *.tar.gz
# Chocolatey Packaging # Chocolatey Packaging

View File

@ -65,6 +65,11 @@ src/boxes.h: src/boxes.h.in src/regulex.h src/shape.h Makefile
doc/boxes.1: doc/boxes.1.in Makefile doc/boxes.1: doc/boxes.1.in Makefile
sed -e 's/--BVERSION--/$(BVERSION)/; s/--GLOBALCONF--/$(subst /,\/,$(GLOBALCONF))/' doc/boxes.1.in > doc/boxes.1 sed -e 's/--BVERSION--/$(BVERSION)/; s/--GLOBALCONF--/$(subst /,\/,$(GLOBALCONF))/' doc/boxes.1.in > doc/boxes.1
doc/boxes.1.html: doc/boxes.1
cat doc/boxes.1 | groff -mandoc -Thtml > doc/boxes.1.raw.html
sed -E -e 's/&lt;URL:([^&]+)&gt;/<a href=\1>\1<\/a>/g' < doc/boxes.1.raw.html > doc/boxes.1.html
rm -f doc/boxes.1.raw.html
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$(PKG_NAME).tar.gz: $(PKG_NAME).tar.gz:
@ -101,7 +106,8 @@ src/boxes.exe: win32
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
clean: clean:
rm -f doc/boxes.1 src/boxes.h tools/boxes.cfg tools/LICENSE.txt tools/boxes.exe tools/README*.md boxes.portable.*.nupkg rm -f src/boxes.h tools/boxes.cfg tools/LICENSE.txt tools/boxes.exe tools/README*.md boxes.portable.*.nupkg
rm -f doc/boxes.1 doc/boxes.1.raw.html doc/boxes.1.html
$(MAKE) -C src clean $(MAKE) -C src clean
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -1,11 +0,0 @@
# Note: Better user vh-man2html !!
outfile=boxes.1.shtml
if [ -e $outfile ]; then
cp -a $outfile $outfile"."$$".bak"
fi
cat ./boxes.1 | sed -e 's/^\.br/--LINEBREAK--/' | man -l - | man2html -title 'boxes(1)' | sed -e 's/boxes@thomasjensen.com/boxes(at)thomasjensen(dot)com/g' -e 's/&lt;URL:\([^&]\+\)&gt;/<a target="_blank" href="\1">\1<\/a>/g' -e 's/<\/BODY>/\n<!--#include file="footer.inc.shtml" -->\n\n<\/BODY>/' > $outfile
echo "Conversion complete. Excessive manual work remains."
# vim: set wrap :