From: stevenknight Date: Mon, 15 Mar 2010 15:43:06 +0000 (+0000) Subject: More doc infrastructure enhancements towards putting the function X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ae35a08a790ffef79d2fa70fe393004195de4f8f;p=scons.git More doc infrastructure enhancements towards putting the function documentation into DocBook: * Strip trailing newlines after XML comments so lines left blank after stripping comments don't get treated as paragraph separators. * Recognize the lambda function and the ${TARGET,SOURCE}{,S} variables when converting to man page format. * Translate more strings into .RB and .RI lines. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4703 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/bin/scons-proc.py b/bin/scons-proc.py index f8f1a550..15f22b76 100644 --- a/bin/scons-proc.py +++ b/bin/scons-proc.py @@ -96,6 +96,9 @@ for f in args: content = open(f).read() if content: content = content.replace('&', '&') + # Strip newlines after comments so they don't turn into + # spurious paragraph separators. + content = content.replace('-->\n', '-->') input = xml_preamble + content + xml_postamble try: saxparser.parse(StringIO.StringIO(input)) @@ -236,7 +239,8 @@ class SCons_XML_to_man(SCons_XML): body = re.sub(r'\.EE\n\n+(?!\.IP)', '.EE\n.IP\n', body) body = string.replace(body, '\n.IP\n\'\\"', '\n\n\'\\"') - body = re.sub('&(scons|SConstruct|SConscript|jar|Make);', r'\\fB\1\\fP', body) + body = re.sub('&(scons|SConstruct|SConscript|jar|Make|lambda);', r'\\fB\1\\fP', body) + body = re.sub('&(TARGET|TARGETS|SOURCE|SOURCES);', r'\\fB$\1\\fP', body) body = string.replace(body, '&Dir;', r'\fBDir\fP') body = string.replace(body, '⌖', r'\fItarget\fP') body = string.replace(body, '&source;', r'\fIsource\fP') @@ -252,6 +256,8 @@ class SCons_XML_to_man(SCons_XML): body = re.compile(r'^\\f([BI])(.*)\\fP\s*$', re.M).sub(r'.\1 \2', body) body = re.compile(r'^\\f([BI])(.*)\\fP(\S+)$', re.M).sub(r'.\1R \2 \3', body) body = re.compile(r'^(\S+)\\f([BI])(.*)\\fP$', re.M).sub(r'.R\2 \1 \3', body) + body = re.compile(r'^(\S+)\\f([BI])(.*)\\fP([^\s\\]+)$', re.M).sub(r'.R\2 \1 \3 \4', body) + body = re.compile(r'^(\.R[BI].*[\S])\s+$;', re.M).sub(r'\1', body) body = string.replace(body, '<', '<') body = string.replace(body, '>', '>') body = re.sub(r'\\([^f])', r'\\\\\1', body)