Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

section heading in function doc string triggers error: Unexpected section heading #10887

Closed
Phillip-M-Feldman opened this issue Sep 30, 2022 · 3 comments · Fixed by #10919
Closed
Labels
domains:py type:enhancement enhance or introduce a new feature
Milestone

Comments

@Phillip-M-Feldman
Copy link

Describe the bug

The presence of a section heading in a doc string triggers the error "unexpected doc string". Is this something that is supposed to work? When a function's doc string is very long, the ability to divide it into sections is essential.

How to Reproduce

Put a section heading in the doc string of a function or method.

Expected behavior

No response

Your project

N/A

Screenshots

No response

OS

Windows 10

Python version

3.8.8

Sphinx version

5.2.2

Sphinx extensions

No response

Extra tools

No response

Additional context

No response

@AA-Turner
Copy link
Member

Hi Phillip, please provide a minimal reproducer with Sphinx 5.2.3 (ideally a single .rst file and a minimal conf.py)

A

@Phillip-M-Feldman
Copy link
Author

A minimal reproducer is attached.
Sphinx_bug_demo.zip

@AA-Turner
Copy link
Member

Minimal reproducer:

import shutil
from pathlib import Path

from sphinx.cmd.make_mode import run_make_mode

Path("conf.py").write_text('''\
''', encoding="utf-8")

Path("index.rst").write_text('''\
.. py:function:: func()

   Overview
   --------
   
   Lorem ipsum dolar sit amet
''', encoding="utf-8")

shutil.rmtree("_build", ignore_errors=True)
run_make_mode(["html", ".", "_build", "-anETW"])

A

@AA-Turner AA-Turner added type:enhancement enhance or introduce a new feature and removed type:bug labels Oct 15, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
domains:py type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants