Comments (3)
Thanks for the feedback.
Specifically in -summary
you can prepend items by ~
to only show the last part (see https://sphinx-autodoc2.readthedocs.io/en/latest/summary.html)
I'm surprised about the hello.rst#Foo.Bar.Foo.Bar.Baz
, I don't think this should be directly related to do what is displayed.
Perhaps you could show the result of
.. autodoc2-object:: xxx
:literal:
from sphinx-autodoc2.
Here is a screenshot. Not really the best medium but it captured everything I wanted in one. The WindowsToaster
class is output from auto_mode, the center is :literal:, and the bottom is autodoc2-object.
from sphinx-autodoc2.
I did some testing, and it seems the issue with duplicated names in the node_id only happens when using autodoc2-object with e.g. classes, while it seems to work OK with modules. In auto_mode, things work fine since it uses whole modules/packages.
I compared the literal output with the code from the auto_mode version, and the only notable difference is the absence of :py-module:
(regardless if this is the issue or not, would emitting :py-currentmodule:
be useful?). If I paste the literal code, prepending it with :py-module:
, the node_ids are generated OK. But if I prepend the autodoc2-object with :py-module:
, it doesn't seem to change anything.
I would have no idea how to fix this, but it seems that some context is being lost when using autodoc2-object with classes vs. modules/packages (for the time being, I'm monkey-patching sphinx.domains.python.PyObject.add_target_and_index
to my package, that seems to be enough to generate better node_ids).
To reproduce:
- Create
amod.py
in an empty folder:
class AClass:
"""AClass is a class"""
AAttr = 123
"""Something 123"""
- Run
sphinx-quickstart
- Append to
conf.py
:
extensions = [
"autodoc2",
]
autodoc2_packages = [
{
"path": "./amod.py",
"auto_mode": False
},
]
- Add
.. autodoc2-object:: amod.AClass
toindex.rst
. - Build it.
from sphinx-autodoc2.
Related Issues (20)
- Support autodoc_typehints setting HOT 3
- Docstrings don't seem to create linked headings
- ValueError: Item src does not exist HOT 2
- Question: remove module name from path HOT 2
- 0.4.2: sphinx warnings `reference target not found` HOT 2
- 0.4.2: pytest warnings
- 0.4.2 MystRenderer renders default values incorrectly
- Class variable intialized with object: value rendered as None HOT 1
- astroid 3 breaks builds: AttributeError: 'Module' object has no attribute 'doc' HOT 2
- Add support for overloaded functions
- Support for NumPy-style docstrings HOT 4
- Can error due to `TypeAlias` visitor via `astroid`
- Astroid 3.0 support
- 0.5.0: pytest is failing in `tests/test_render.py::test_sphinx_build_directives` unit HOT 4
- Comparison with sphinx-autoapi? HOT 2
- Inner exceptions are missing
- Links are outdated
- Within a module, we can shorten a.b.c.d... for readability
- 0.5.0: sphinx warnings `reference target not found`
- Documentation error "autodoc2_replace_annotations" expects list not dict
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx-autodoc2.