Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

Commit

Permalink
CDRIVER-1926 more man page syntax fixes
Browse files Browse the repository at this point in the history
Don't replace all "()" with "(3)", and fix some <output> formatting.
  • Loading branch information
ajdavis committed Dec 21, 2016
1 parent 3544764 commit 8808007
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/mallard2man.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,11 @@ def _generateSynopsis(self, synopsis):
self._writeCommand('.fi')

def _generateCode(self, code):
if code.tag.endswith('output'):
self._writeCommand('.br')
text = code.text
is_synopsis = self._get_parent(code).tag.endswith('synopsis')
if text and '\n' not in text and not is_synopsis:
text = text.replace('()', '(%s)' % self.section)
self._writeCommand('.B', text)
else:
self._writeCommand('.nf')
Expand All @@ -258,6 +259,8 @@ def _generateP(self, p):
self._writeLine(self._compressWhitespace(child.tail))

def _generateScreen(self, screen):
if screen.text:
self._generateCode(screen)
for child in screen.getchildren():
self._generateElement(child)

Expand Down

0 comments on commit 8808007

Please sign in to comment.