add documentation for availability and differences for `autodoc-process-docstring` (and some friends)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation
Research direction
Start with the autodoc-process-docstring and autodoc-process-signature events in the Sphinx extension, and verify whether AutoAPI emits them and how their what, obj, and options values differ. Update the documentation to list event availability and supported what values for autodoc and AutoAPI. Done when these behaviors and differences are clear to users.
Written by the indexing model from the issue text.
Description
Hi,
I am in need for some module docstring post-processing, and it took me rather long to figure out that:
autoapialso allows (some?)autodoc-*events to be captured- There are some differences in the values for
what
Especially it took me quite a while to figure out there are some subtle differences:
- autodoc:
whatcan be :"module", "class", "exception", "function", "method", "attribute" - autoapi:
whatcan be :"package", "class", "exception", "function", "method", "attribute", "data"
Im not quite sure if t
I think that would be good to add to the documentation if this is indeed the intent, rather than a side effect of something else in my setup
It appears that the autodoc-process-signature event is also available, but I have not done any further validation on that, but as it appears to be used internally by autoapi, it is likely to work as well.
extensions = [
"autoapi.extension",
"sphinx.ext.napoleon",
]
# ...
mpy_lib_modules = {"foo":"bar"}
def process_docstring(
app: Sphinx,
what: str, # "module", "class", "exception", "function", "method", "attribute" ( "package", 'data' with autoapi)
name: str,
obj, # Always None with autoapi
options, # Always None with autoapi
lines: List[str],
):
if what in {"package", "module"} and name in mpy_lib_modules:
lines.extend(
(
"",
f".. seealso:: This is a `{mpy_lib_modules[name]}` module from the `micropython-lib` repository.",
)
)
def process_signature(app, what, name, obj, options, signature, return_annotation):
pass
def setup(sphinx: Sphinx):
sphinx.connect("autodoc-process-docstring", process_docstring) # also fires with autoapi :)
sphinx.connect("autodoc-process-signature", process_signature) # also fires with autoapi :)
- Dominant language
- Python
- Stars
- 494
- Forks
- 147
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from readthedocs/sphinx-autoapi
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
readthedocs/sphinx-autoapi#565 · 1 comment ·
-
First overload of functions with multiple overloads in .pyi files fail to appear in resultant .html Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
readthedocs/sphinx-autoapi#557 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
readthedocs/sphinx-autoapi#552 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
readthedocs/sphinx-autoapi#551 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
readthedocs/sphinx-autoapi#546 ·
All issues in readthedocs/sphinx-autoapi
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100