diff options
-rwxr-xr-x | buildtools/makeman | 16 | ||||
-rw-r--r-- | doc/HISTORY | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/buildtools/makeman b/buildtools/makeman index 2e122779..100ad580 100755 --- a/buildtools/makeman +++ b/buildtools/makeman @@ -1,4 +1,4 @@ -#!/bin/env python +#!/usr/bin/python # # makeman -- compile netpbm's stereotyped HTML to troff markup # @@ -121,7 +121,10 @@ def makeman(name, file, indoc): indoc = re.sub("(?i)</SUP>", r"\\d", indoc) # Paragraph handling indoc = re.sub("(?i)\n*<P>\n*", r"\n.PP\n", indoc) + indoc = re.sub("(?i)<br */>", r"\n.PP\n", indoc) indoc = re.sub("(?i)</P>", "", indoc) + indoc = re.sub("(?i)<!--[^>]*-->", "", indoc) + indoc = re.sub("(?i)<meta[^>]*>", "", indoc) lines = indoc.split("\n") listdepth = 0 for i in range(len(lines)): @@ -138,13 +141,14 @@ def makeman(name, file, indoc): indoc = re.sub('(?i)<A[ \n]+HREF="mailto:[^>]+">([^<]+)</A>', r'\\fI\1\\fP', indoc) # Format manual crossreferences def xrefmatch(match): - xrefto = match.group(1) - xrefsection = sectmap.get(xrefto, 1) + xrefto = match.group(2) + xrefurl = match.group(1) + xrefsection = sectmap.get(xrefurl, 1) if xrefsection == 0: return "\n.I " + xrefto else: - return "\n.BR %s (%d)" % (xrefto, xrefsection) - indoc = re.sub(r'(?i)\n* *(?:\\fB)?<A[ \n]+HREF="[^>]+.html">([^<]+)</A>(?:\\fP)?', + return "\n.BR %s (%d)\n" % (xrefto, xrefsection) + indoc = re.sub(r'(?i)\n* *(?:\\fB)?<A[ \n]+HREF="?([^>]+.html)"?>([^<]+)</A>(?:\\fP)?', xrefmatch, indoc) # Format URLs def urlmatch(match): @@ -159,7 +163,7 @@ def makeman(name, file, indoc): indoc = indoc.replace("®", r"\*R") indoc = indoc.replace("©", r"\(co") # Turn anchors into .UN tags - indoc = re.sub('(?i)<A NAME *= *"#?([a-zA-Z][a-zA-Z0-9.-]+)">(?: )*</A>\s*', ".UN \\1\n", indoc) + indoc = re.sub('(?i)<A NAME *= *"#?([a-zA-Z_][a-zA-Z_0-9.-]+)">(?: )*</A>\s*', ".UN \\1\n", indoc) # Strip off the index trailer trailer = re.compile('<HR */*>.*', re.DOTALL | re.IGNORECASE) indoc = re.sub(trailer, "", indoc) diff --git a/doc/HISTORY b/doc/HISTORY index 2435a51c..4f6cfbeb 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -23,6 +23,8 @@ not yet BJH Release 10.49.00 configure: advise if adding -lz -lm fixes libpng link problem. + makeman: some fixes or enhancements. + 09.09.27 BJH Release 10.48.00 ppmsvgalib: Wait to initialize Svgalib to prevent it from |