This docstring:
"""
Returns
-------
out: int
Output.
Bad title
---------
Text.
"""
produces:
C:\module.py:docstring of my_pkg.module.func:5: CRITICAL: Unexpected section title.
Bad title
---------
Can I make it respect Bad title
, or at least suppress the warning? I'm not using numpydoc
or Napoleon, only
extensions = ['sphinx.ext.autodoc']
The two related questions with shared "Unexpected etc" don't help.
MRE
Built with sphinx-build -a -E . build
. For convenience, here's sphinx-dummy-min.zip.
sphinx-dummy-min/docs/conf.py
import sys, pathlib
sys.path.insert(0, str(pathlib.Path(__file__).parent.parent))
project = 'dummy-module'
release = version = '0.1.0'
extensions = ['sphinx.ext.autodoc']
exclude_patterns = ['build']
sphinx-dummy-min/docs/dummy_module.rst
sphinx-dummy-min package
========================
Submodules
----------
dummy_module.dumdum module
--------------------------
.. automodule:: dummy_module.dumdum
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: dummy_module
:members:
:undoc-members:
:show-inheritance:
sphinx-dummy-min/docs/index.rst
Welcome to dummy-module-min's documentation!
============================================
.. toctree::
:maxdepth: 2
:caption: Contents:
.. toctree::
:maxdepth: 2
:caption: Galleries:
API reference <dummy_module>
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
sphinx-dummy-min/dummy_module/__init__.py
sphinx-dummy-min/dummy_module/dumdum.py
def bark():
"""
Returns
-------
out: str
"Bark".
Bad title
---------
Body.
"""