diff options
author | Steven Knight <knight@baldmt.com> | 2010-03-15 15:43:06 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-03-15 15:43:06 (GMT) |
commit | f4ef7dc0f4b083356505a18ee9883c3a18165387 (patch) | |
tree | f4241cf230d4a63f22dc07447568e123a8b9ddf2 /bin/scons-proc.py | |
parent | 5dafc041488bf63e8871a76a7ccecc1d9e42e6a2 (diff) | |
download | SCons-f4ef7dc0f4b083356505a18ee9883c3a18165387.zip SCons-f4ef7dc0f4b083356505a18ee9883c3a18165387.tar.gz SCons-f4ef7dc0f4b083356505a18ee9883c3a18165387.tar.bz2 |
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.
Diffstat (limited to 'bin/scons-proc.py')
-rw-r--r-- | bin/scons-proc.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/scons-proc.py b/bin/scons-proc.py index f8f1a55..15f22b7 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) |