|
From: <gr...@us...> - 2019-11-24 12:50:46
|
Revision: 8420
http://sourceforge.net/p/docutils/code/8420
Author: grubert
Date: 2019-11-24 12:50:44 +0000 (Sun, 24 Nov 2019)
Log Message:
-----------
FIX for BUG #287 comma after option is bold
Modified Paths:
--------------
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2019-11-23 12:12:43 UTC (rev 8419)
+++ trunk/docutils/docutils/writers/manpage.py 2019-11-24 12:50:44 UTC (rev 8420)
@@ -210,6 +210,7 @@
#
# Fonts are put on a stack, the top one is used.
# ``.ft P`` or ``\\fP`` pop from stack.
+ # But ``.BI`` seams to fill stack with BIBIBIBIB...
# ``B`` bold, ``I`` italic, ``R`` roman should be available.
# Hopefully ``C`` courier too.
self.defs = {
@@ -912,7 +913,10 @@
def visit_option(self, node):
# each form of the option will be presented separately
if self.context[-1] > 0:
- self.body.append('\\fP,\\fB ')
+ if self.context[-3] == '.BI':
+ self.body.append('\\fR,\\fB ')
+ else:
+ self.body.append('\\fP,\\fB ')
if self.context[-3] == '.BI':
self.body.append('\\')
self.body.append(' ')
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2019-11-23 12:12:43 UTC (rev 8419)
+++ trunk/docutils/test/test_writers/test_manpage.py 2019-11-24 12:50:44 UTC (rev 8420)
@@ -362,7 +362,39 @@
.'''],
]
+totest['cmdlineoptions'] = [
+ ["""optional arguments:
+ -h, --help show this help
+ --output FILE, -o FILE output filename
+ -i DEVICE, --input DEVICE input device
+""",
+ r""".\" Man page generated from reStructuredText.
+.
+.TH "" "" ""
+.SH NAME
+ \-
+"""+indend_macros+
+r""".INDENT 0.0
+.TP
+.B optional arguments:
+.INDENT 7.0
+.TP
+.B \-h\fP,\fB \-\-help
+show this help
+.TP
+.BI \-\-output \ FILE\fR,\fB \ \-o \ FILE
+output filename
+.TP
+.BI \-i \ DEVICE\fR,\fB \ \-\-input \ DEVICE
+input device
+.UNINDENT
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.
+"""],
+ ]
+
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|