Skip to content

Commit 8dd78ec

Browse files
authored
Merge pull request #63 from amueller/attribute_formatting
bold attributes so we don't have to deal with trailing underscores
2 parents 2eb7277 + 8c3da14 commit 8dd78ec

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

numpydoc/docscrape_sphinx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ def _str_member_list(self, name):
132132
out += [''] + autosum
133133

134134
if others:
135-
maxlen_0 = max(3, max([len(x[0]) for x in others]))
136-
hdr = sixu("=")*maxlen_0 + sixu(" ") + sixu("=")*10
135+
maxlen_0 = max(3, max([len(x[0]) + 4 for x in others]))
136+
hdr = sixu("=") * maxlen_0 + sixu(" ") + sixu("=") * 10
137137
fmt = sixu('%%%ds %%s ') % (maxlen_0,)
138138
out += ['', '', hdr]
139139
for param, param_type, desc in others:
140140
desc = sixu(" ").join(x.strip() for x in desc).strip()
141141
if param_type:
142142
desc = "(%s) %s" % (param_type, desc)
143-
out += [fmt % (param.strip(), desc)]
143+
out += [fmt % ("**" + param.strip() + "**", desc)]
144144
out += [hdr]
145145
out += ['']
146146
return out

numpydoc/tests/test_docscrape.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -893,18 +893,18 @@ def x(self):
893893
894894
x
895895
896-
=== ==========
897-
t (float) Current time.
898-
y (ndarray) Current variable values.
899-
=== ==========
896+
===== ==========
897+
**t** (float) Current time.
898+
**y** (ndarray) Current variable values.
899+
===== ==========
900900
901901
.. rubric:: Methods
902902
903-
=== ==========
904-
a
905-
b
906-
c
907-
=== ==========
903+
===== ==========
904+
**a**
905+
**b**
906+
**c**
907+
===== ==========
908908
909909
""")
910910

0 commit comments

Comments
 (0)