[Top][All Lists]

[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


  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

        $(top_srcdir)/meta/scripts/ \
           "$(PACKAGE_NAME)" "$(PACKAGE_VERSION)" \

and the script is:


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>_' \

for htmlfile in "$@"
    # Process only files that do not already contain the footer.
    if ! "$GREP" -e '<p class="customfooter12345">' --silent "$htmlfile"
        "$MV" "$htmlfile" "$htmlfile".bak
        "$SED" -e "$SEXP" <"$htmlfile".bak >"$htmlfile"
        "$RM" "$htmlfile".bak

### end of file

Marco Maggi

reply via email to

[Prev in Thread] Current Thread [Next in Thread]