Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Contributors
* Daniel Eades -- improved static typing
* Daniel Hahler -- testing and CI improvements
* Daniel Pizetta -- inheritance diagram improvements
* Dave Hoese -- ``sphinx.ext.viewcode`` bug fix
* Dave Hoese -- ``sphinx.ext.viewcode`` and ``sphinx.ext.apidoc`` bug fixes
* Dave Kuhlman -- original LaTeX writer
* Dimitri Papadopoulos Orfanos -- linting and spelling
* Dmitry Shachnev -- modernisation and reproducibility
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Bugs fixed

* #13392: Fix argument type for ``jieba.load_userdict()``.
* #13402: Ensure inline ``<script>`` tags are written exactly once.
* #13391: apidoc: Fix TOC file not having a title.
Patch by Dave Hoese.

Testing
-------
3 changes: 2 additions & 1 deletion sphinx/ext/apidoc/_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ def _parse_module_options(
dest_dir=dest_path,
module_path=module_path,
exclude_pattern=exclude_patterns,
automodule_options=automodule_options,
max_depth=max_depth,
quiet=True,
follow_links=bool_options['follow_links'],
Expand All @@ -226,6 +225,8 @@ def _parse_module_options(
no_headings=bool_options['no_headings'],
module_first=bool_options['module_first'],
implicit_namespaces=bool_options['implicit_namespaces'],
automodule_options=automodule_options,
header=module_path.name,
)


Expand Down
15 changes: 8 additions & 7 deletions tests/test_extensions/test_ext_apidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,13 +782,14 @@ def test_sphinx_extension(app: SphinxTestApp) -> None:
app.build()
assert app.warning.getvalue() == ''

assert set((app.srcdir / 'generated').iterdir()) == {
app.srcdir / 'generated' / 'modules.rst',
app.srcdir / 'generated' / 'my_package.rst',
}
assert 'show-inheritance' not in (
app.srcdir / 'generated' / 'my_package.rst'
).read_text(encoding='utf8')
toc_file = app.srcdir / 'generated' / 'modules.rst'
pkg_file = app.srcdir / 'generated' / 'my_package.rst'
assert set((app.srcdir / 'generated').iterdir()) == {toc_file, pkg_file}
modules_content = toc_file.read_text(encoding='utf8')
assert modules_content == (
'src\n===\n\n.. toctree::\n :maxdepth: 3\n\n my_package\n'
)
assert 'show-inheritance' not in pkg_file.read_text(encoding='utf8')
assert (app.outdir / 'generated' / 'my_package.html').is_file()

# test a re-build
Expand Down