Skip to content
Permalink
Browse files

Update ManPageFormatter to remove rest markup from man pages

  • Loading branch information...
arnaudveron committed Aug 8, 2019
1 parent 37bdba6 commit a8513835bfb2db8e652accfbc1efbfc50626166b
Showing with 4 additions and 0 deletions.
  1. +4 −0 bin/pkg/make_man
@@ -89,6 +89,10 @@ class ManPageFormatter(optparse.HelpFormatter):
# highlight sections
commands = re.sub(r'^(\w.+)\n(-+)', lambda pat: "\\fR"+pat.group(1).upper()+"\\fP", commands, flags=re.MULTILINE)

# remove rest markup
commands = re.sub(r':(cmd|kw|opt|c-.*?):`(.*?)`', lambda pat: "'"+pat.group(2)+"'", commands, flags=re.MULTILINE)
commands = re.sub(r'``(.*?)``', lambda pat: "'"+pat.group(1)+"'", commands, flags=re.MULTILINE)

if len(commands) > 0:
ret.append('.SH COMMANDS\n%s\n' % commands)

0 comments on commit a851383

Please sign in to comment.
You can’t perform that action at this time.