Fixed incorrect formatting of properties on generated method directives.

pull/236/head
Ashley Whetter 4 years ago
parent d08522c525
commit ac70ea056e

@ -15,6 +15,7 @@ Bug Fixes
^^^^^^^^^
* `#219 <https://github.com/readthedocs/sphinx-autoapi/issues/219>`:
Fixed return types not showing for methods.
* Fixed incorrect formatting of properties on generated method directives.
v1.4.0 (2020-06-07)

@ -1,12 +1,17 @@
{%- if obj.display %}
{% if sphinx_version >= (2, 1) %}
.. method:: {{ obj.short_name }}({{ obj.args }}){% if obj.return_annotation is not none %} -> {{ obj.return_annotation }}{% endif %}
{% if obj.properties %}
{% for property in obj.properties %}
:{{ property }}:
{% endfor %}
{% else %}
{% endif %}
{% else %}
.. {{ obj.method_type }}:: {{ obj.short_name }}({{ obj.args }})
{% endif %}
{% if obj.docstring %}

@ -183,7 +183,7 @@ class TestPy3Module(object):
example_file = example_handle.read()
if sphinx.version_info >= (2, 1):
assert re.search("async_method[^\n]*:async:", example_file)
assert "async async_method" in example_file
assert "async example.async_function" in example_file
else:
assert "async_method" in example_file

Loading…
Cancel
Save