Skip to content

Commit

Permalink
Handle case where description is empty (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnothman committed Nov 4, 2017
1 parent 5b1169f commit 8c1e85c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def foo(var1, var2, long_var_name='hi'):
Explanation of return value named `describe`.
out : type
Explanation of `out`.
type_without_description
Other Parameters
----------------
Expand Down
10 changes: 6 additions & 4 deletions numpydoc/docscrape_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,12 @@ def _str_param_list(self, name, fake_autosummary=False):
param_type)])
else:
out += self._str_indent([display_param])
if desc:
if self.use_blockquotes:
out += ['']
out += self._str_indent(desc, 8)
if desc and self.use_blockquotes:
out += ['']
elif not desc:
# empty definition
desc = ['..']
out += self._str_indent(desc, 8)
out += ['']

return out
Expand Down
1 change: 1 addition & 0 deletions numpydoc/tests/test_docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,7 @@ def no_period(self):
But a description
no_docstring2 : str
..
:obj:`multiline_sentence <multiline_sentence>`
This is a sentence.
Expand Down

0 comments on commit 8c1e85c

Please sign in to comment.