summaryrefslogtreecommitdiff
path: root/man/make_man_page.py
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-13 21:05:04 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-13 21:05:04 -0800
commitaa670e93369d6891a8236b1dee3e113796fde857 (patch)
tree76971c7f8383b52f81e500510d302324c53faa86 /man/make_man_page.py
parentcc2843b8cb769f0fa60c45a2e0f8f781dff9e845 (diff)
Use typewriter font for signatures in man pages.
Diffstat (limited to 'man/make_man_page.py')
-rw-r--r--man/make_man_page.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/man/make_man_page.py b/man/make_man_page.py
index 34383fb..94c4d6a 100644
--- a/man/make_man_page.py
+++ b/man/make_man_page.py
@@ -3,7 +3,7 @@
# Creates a man page from a C file.
# Comments beginning with `/**` are treated as Groff man, except that
-# 'this' is converted to \fIthis\fR, and ''this'' to \fBthis\fR.
+# 'this' is converted to \fIthis\f[], and ''this'' to \fBthis\f[].
# Non-blank lines immediately following a man page comment are treated
# as function signatures or examples and parsed into .Ft, .Fo, .Fa, .Fc. The
@@ -47,7 +47,7 @@ single_quote_re = re.compile("(?<!\w)'([^']+)'(?!\w)")
double_quote_re = re.compile("(?<!\w)''([^']+)''(?!\w)")
def handle_quotes(s):
- return re.sub(double_quote_re, '\\\\fB\g<1>\\\\fR', re.sub(single_quote_re, '\\\\fI\g<1>\\\\fR', s))
+ return re.sub(double_quote_re, '\\\\f[CB]\g<1>\\\\f[]', re.sub(single_quote_re, '\\\\f[CI]\g<1>\\\\f[]', s))
typedef = False
mdlines = []
@@ -92,14 +92,14 @@ with open(sourcefile, 'r') as cmarkh:
rawsig = ''.join(sig)
m = function_re.match(rawsig)
if m:
- mdlines.append('\\fI' + m.group('type') + '\\fR' + ' ')
- mdlines.append('\\fB' + m.group('name') + '\\fR' + '(')
+ mdlines.append('\\f[CI]' + m.group('type') + '\\f[]' + ' ')
+ mdlines.append('\\f[CB]' + m.group('name') + '\\f[]' + '(')
first = True
for argument in re.split(',', m.group('args')):
if not first:
mdlines.append(', ')
first = False
- mdlines.append('\\fI' + argument.strip() + '\\fR')
+ mdlines.append('\\f[CI]' + argument.strip() + '\\f[]')
mdlines.append(')\n')
else:
mdlines.append('.nf\n\\f[C]\n.RS 0n\n')