Skip to content

Commit c7d4793

Browse files
committed
Use definition lists rather than blockquotes
1 parent 057ef57 commit c7d4793

File tree

2 files changed

+16
-33
lines changed

2 files changed

+16
-33
lines changed

numpydoc/docscrape_sphinx.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ def _str_returns(self, name='Returns'):
6969
out += ['']
7070
for param, param_type, desc in self[name]:
7171
if param_type:
72-
out += self._str_indent(['**%s** : %s' % (param.strip(),
72+
out += self._str_indent(['%s : %s' % (param.strip(),
7373
param_type)])
7474
else:
7575
out += self._str_indent([param.strip()])
7676
if desc:
77-
out += ['']
7877
out += self._str_indent(desc, 8)
7978
out += ['']
8079
return out
@@ -86,12 +85,11 @@ def _str_param_list(self, name):
8685
out += ['']
8786
for param, param_type, desc in self[name]:
8887
if param_type:
89-
out += self._str_indent(['**%s** : %s' % (param.strip(),
88+
out += self._str_indent(['%s : %s' % (param.strip(),
9089
param_type)])
9190
else:
92-
out += self._str_indent(['**%s**' % param.strip()])
91+
out += self._str_indent(['%s' % param.strip()])
9392
if desc:
94-
out += ['']
9593
out += self._str_indent(desc, 8)
9694
out += ['']
9795
return out

numpydoc/tests/test_docscrape.py

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -453,28 +453,24 @@ def test_sphinx_str():
453453
454454
:Parameters:
455455
456-
**mean** : (N,) ndarray
457-
456+
mean : (N,) ndarray
458457
Mean of the N-dimensional distribution.
459458
460459
.. math::
461460
462461
(1+2+3)/3
463462
464-
**cov** : (N, N) ndarray
465-
463+
cov : (N, N) ndarray
466464
Covariance matrix of the distribution.
467465
468-
**shape** : tuple of ints
469-
466+
shape : tuple of ints
470467
Given a shape of, for example, (m,n,k), m*n*k samples are
471468
generated, and packed in an m-by-n-by-k arrangement. Because
472469
each sample is N-dimensional, the output shape is (m,n,k,N).
473470
474471
:Returns:
475472
476-
**out** : ndarray
477-
473+
out : ndarray
478474
The drawn samples, arranged according to `shape`. If the
479475
shape given is (m,n,...), then the shape of `out` is is
480476
(m,n,...,N).
@@ -483,26 +479,22 @@ def test_sphinx_str():
483479
value drawn from the distribution.
484480
485481
list of str
486-
487482
This is not a real return value. It exists to test
488483
anonymous return values.
489484
490485
:Other Parameters:
491486
492-
**spam** : parrot
493-
487+
spam : parrot
494488
A parrot off its mortal coil.
495489
496490
:Raises:
497491
498-
**RuntimeError**
499-
492+
RuntimeError
500493
Some error
501494
502495
:Warns:
503496
504-
**RuntimeWarning**
505-
497+
RuntimeWarning
506498
Some warning
507499
508500
.. warning::
@@ -570,16 +562,13 @@ def test_sphinx_yields_str():
570562
571563
:Yields:
572564
573-
**a** : int
574-
565+
a : int
575566
The number of apples.
576567
577-
**b** : int
578-
568+
b : int
579569
The number of bananas.
580570
581571
int
582-
583572
The number of unknowns.
584573
""")
585574

@@ -963,12 +952,10 @@ def x(self):
963952
964953
:Parameters:
965954
966-
**f** : callable ``f(t, y, *f_args)``
967-
955+
f : callable ``f(t, y, *f_args)``
968956
Aaa.
969957
970-
**jac** : callable ``jac(t, y, *jac_args)``
971-
958+
jac : callable ``jac(t, y, *jac_args)``
972959
Bbb.
973960
974961
.. rubric:: Examples
@@ -1009,12 +996,10 @@ def test_templated_sections():
1009996
1010997
:Parameters:
1011998
1012-
**f** : callable ``f(t, y, *f_args)``
1013-
999+
f : callable ``f(t, y, *f_args)``
10141000
Aaa.
10151001
1016-
**jac** : callable ``jac(t, y, *jac_args)``
1017-
1002+
jac : callable ``jac(t, y, *jac_args)``
10181003
Bbb.
10191004
10201005
""")

0 commit comments

Comments
 (0)