Comments (2)
Being a directive shouldn't
currentmodule
also have an empty line and one level of nesting? Like this:
The currentmodule
has no content, but simply sets the module. However, if you use module
with content, then it's equivalent to the original example, and produces the wrong TOC as well.
To get the nested class I'd rely only on reST scoping rules so it seems the most robust and language agnostic solution would be to put
f()
andMyNestedClass
on the same level:
Generally I agree that showing them nested is a good default. However, in the original use-case there are multiple nested classes and all involved classes are relatively large, making it desirable to separate them.
from sphinx.
Being a directive shouldn't currentmodule
also have an empty line and one level of nesting? Like this:
.. py:currentmodule:: myMod
.. py:class:: MyClass
.. py:method:: f()
.. py:class:: MyClass.MyNestedClass
To get the nested class I'd rely only on reST scoping rules so it seems the most robust and language agnostic solution would be to put f()
and MyNestedClass
on the same level:
.. py:currentmodule:: myMod
.. py:class:: MyClass
.. py:method:: f()
.. py:class:: MyNestedClass
However I think you're right that:
seems to use the scoping of the language to nest the toc entries, instead of how they were declared in the document.
If you want to document the nested class flattened on the same level as the containing class then the TOC should have given the desired result:
- MyClass
- MyClass.f()
- MyClass.MyNestedClass
from sphinx.
Related Issues (20)
- LaTeX/ImageConverter: Regression with `data:` URIs HOT 1
- Have emoji and U+28FF working in sphinx ``lualatex`` generated for titles and code HOT 6
- Should `defusedxml` be moved to the runtime dependencies? HOT 5
- When compiling linux kernel(drm-tis), failed at module `docutils.nodes` for no attribute โreprunicodeโ HOT 11
- sphinx-build hard-codes the python path into the exe HOT 7
- ext.napoleon to work with ext.todo HOT 2
- `:loading: embed` on images does not work as expected HOT 7
- ``todo`` directive treat repeated special characters as headers
- TOWER_HOST=https://awx.example.org TOWER_USERNAME=example TOWER_PASSWORD=secret make clean html HOT 1
- Index pages use `–` but it can not be used in ePub HOT 3
- Intersphinx Mapping link not working with Plotly objects in signature HOT 4
- Internationalization doc mentions deprecated transifex-client HOT 1
- 7.3.7: missing `defusedxml` install time dependency HOT 2
- THYDUX COIN ๐ ๐ฅ
- Multiple labels inside math directives HOT 1
- LaTeX: footnote mark may indicate "Page N, M" but footnote M is already on page N
- Gettext builder cannot extract 'option' directive HOT 4
- `autodoc_class_signature = "separated"` cause a warning for enum with no `__init__` HOT 12
- [search] issues with the new HTML search algorithm HOT 12
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.