[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[help-texinfo] [feature request] adding footer to HTML pages
From: |
Marco Maggi |
Subject: |
[help-texinfo] [feature request] adding footer to HTML pages |
Date: |
Mon, 17 Dec 2018 07:16:11 +0100 |
Ciao,
some of the very rare users of my stuff complained that there is no
package version number on the HTML pages I put on the web; I mean on
each page. I know that the customisation variable
PROGRAM_NAME_IN_FOOTER already adds text to the page footers. I would
need something like that, but with custom HTML text: let's say
a variable HTML_PAGE_FOOTER to be used as:
makeinfo \
-c HTML_PAGE_FOOTER='<p>This document describes version \
<tt>3.0.0</tt> of <em>MBFL</em>.</p>'
I use the GNU Autotools in my packages, so, as a temporary and ugly
solution, at present I started putting this in Makefile.am:
html-local:
$(top_srcdir)/meta/scripts/add-footer-to-html-pages.sh \
"$(PACKAGE_NAME)" "$(PACKAGE_VERSION)" \
$(builddir)/doc/mbfl.html/*.html
and the script is:
#!/bin/bash
#
declare -r PACKAGE_NAME=${1:?"missing package name argument"}
declare -r PACKAGE_VERSION=${2:?"missing package version argument"}
shift 2
declare -r GREP=/bin/grep
declare -r SED=/bin/sed
declare -r MV=/bin/mv
declare -r RM=/bin/rm
declare SEXP
printf -v SEXP \
's_</body>_<p class="customfooter12345">This document describes version
<tt>%s</tt> of <em>%s</em>.</p></body>_' \
"$PACKAGE_VERSION" "$PACKAGE_NAME"
for htmlfile in "$@"
do
# Process only files that do not already contain the footer.
if ! "$GREP" -e '<p class="customfooter12345">' --silent "$htmlfile"
then
"$MV" "$htmlfile" "$htmlfile".bak
"$SED" -e "$SEXP" <"$htmlfile".bak >"$htmlfile"
"$RM" "$htmlfile".bak
fi
done
### end of file
Thanks.
--
Marco Maggi
- [help-texinfo] [feature request] adding footer to HTML pages,
Marco Maggi <=