From 28ef84eddb0a318a43b899142986b2c74f89c672 Mon Sep 17 00:00:00 2001 From: Andreas Mueller Date: Wed, 7 Sep 2016 16:34:40 -0400 Subject: [PATCH 1/2] bold attributes so we don't have to deal with trailing underscores. Also looks better. --- numpydoc/docscrape_sphinx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/numpydoc/docscrape_sphinx.py b/numpydoc/docscrape_sphinx.py index 1eaa6a9b..482978c3 100644 --- a/numpydoc/docscrape_sphinx.py +++ b/numpydoc/docscrape_sphinx.py @@ -132,15 +132,15 @@ def _str_member_list(self, name): out += [''] + autosum if others: - maxlen_0 = max(3, max([len(x[0]) for x in others])) - hdr = sixu("=")*maxlen_0 + sixu(" ") + sixu("=")*10 + maxlen_0 = max(3, max([len(x[0]) + 4 for x in others])) + hdr = sixu("=") * maxlen_0 + sixu(" ") + sixu("=") * 10 fmt = sixu('%%%ds %%s ') % (maxlen_0,) out += ['', '', hdr] for param, param_type, desc in others: desc = sixu(" ").join(x.strip() for x in desc).strip() if param_type: desc = "(%s) %s" % (param_type, desc) - out += [fmt % (param.strip(), desc)] + out += [fmt % ("**" + param.strip() + "**", desc)] out += [hdr] out += [''] return out From 8c3da14a3bbb4bd8666122bb5c0a26c01988a148 Mon Sep 17 00:00:00 2001 From: Andreas Mueller Date: Wed, 7 Sep 2016 16:47:34 -0400 Subject: [PATCH 2/2] adjust tests --- numpydoc/tests/test_docscrape.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index 634bef44..5b6a326e 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -893,18 +893,18 @@ def x(self): x - === ========== - t (float) Current time. - y (ndarray) Current variable values. - === ========== + ===== ========== + **t** (float) Current time. + **y** (ndarray) Current variable values. + ===== ========== .. rubric:: Methods - === ========== - a - b - c - === ========== + ===== ========== + **a** + **b** + **c** + ===== ========== """)