From 25c660a745eedbff471fb636f97e7198a8b866f8 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 30 Dec 2009 03:59:47 +0000 Subject: Release 10.49.00 - copied from trunk git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@1086 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- buildtools/makeman | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'buildtools/makeman') 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)", r"\\d", indoc) # Paragraph handling indoc = re.sub("(?i)\n*

\n*", r"\n.PP\n", indoc) + indoc = re.sub("(?i)
", r"\n.PP\n", indoc) indoc = re.sub("(?i)

", "", indoc) + indoc = re.sub("(?i)", "", indoc) + indoc = re.sub("(?i)]*>", "", 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)([^<]+)', 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)?([^<]+)(?:\\fP)?', + return "\n.BR %s (%d)\n" % (xrefto, xrefsection) + indoc = re.sub(r'(?i)\n* *(?:\\fB)?([^<]+)(?:\\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)(?: )*\s*', ".UN \\1\n", indoc) + indoc = re.sub('(?i)(?: )*\s*', ".UN \\1\n", indoc) # Strip off the index trailer trailer = re.compile('
.*', re.DOTALL | re.IGNORECASE) indoc = re.sub(trailer, "", indoc) -- cgit 1.4.1