mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7940 from AleksaC/fix_double_trailing_newline_apidoc
Fix double trailing newline apidoc
This commit is contained in:
@@ -35,7 +35,7 @@ Submodules
|
||||
----------
|
||||
{% if separatemodules %}
|
||||
{{ toctree(submodules) }}
|
||||
{%- else %}
|
||||
{% else %}
|
||||
{%- for submodule in submodules %}
|
||||
{% if show_headings %}
|
||||
{{- [submodule, "module"] | join(" ") | e | heading(2) }}
|
||||
@@ -43,7 +43,7 @@ Submodules
|
||||
{{ automodule(submodule, automodule_options) }}
|
||||
{% endfor %}
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if not modulefirst and not is_namespace %}
|
||||
Module contents
|
||||
|
@@ -121,7 +121,6 @@ def test_pep_0420_enabled_separate(make_app, apidoc):
|
||||
|
||||
with open(outdir / 'a.b.c.rst') as f:
|
||||
rst = f.read()
|
||||
|
||||
assert ".. toctree::\n :maxdepth: 4\n\n a.b.c.d\n" in rst
|
||||
|
||||
with open(outdir / 'a.b.e.rst') as f:
|
||||
@@ -509,7 +508,6 @@ def test_package_file(tempdir):
|
||||
" :undoc-members:\n"
|
||||
" :show-inheritance:\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"Module contents\n"
|
||||
"---------------\n"
|
||||
"\n"
|
||||
@@ -595,8 +593,7 @@ def test_package_file_module_first(tempdir):
|
||||
".. automodule:: testpkg.example\n"
|
||||
" :members:\n"
|
||||
" :undoc-members:\n"
|
||||
" :show-inheritance:\n"
|
||||
"\n")
|
||||
" :show-inheritance:\n")
|
||||
|
||||
|
||||
def test_package_file_without_submodules(tempdir):
|
||||
@@ -639,5 +636,4 @@ def test_namespace_package_file(tempdir):
|
||||
".. automodule:: testpkg.example\n"
|
||||
" :members:\n"
|
||||
" :undoc-members:\n"
|
||||
" :show-inheritance:\n"
|
||||
"\n")
|
||||
" :show-inheritance:\n")
|
||||
|
Reference in New Issue
Block a user