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

Mangled section order by add_domain_to_toctree #283

Closed
jakobandersen opened this issue Apr 16, 2021 · 3 comments
Closed

Mangled section order by add_domain_to_toctree #283

jakobandersen opened this issue Apr 16, 2021 · 3 comments
Labels

Comments

@jakobandersen
Copy link
Contributor

The automatic toctree entries from domain directives is usually nice, but I encountered an odd case. Consider

Big Header
##########

.. py:class:: MyClass

Sub-header
==========

.. py:function:: doStuff()

then I get
autoapi
The structure I would expect is

  • Big Header
    • MyClass
    • Sub-header
      • doStuff

Minimal working example: autoapiTest.tar.gz

@AWhetter
Copy link
Collaborator

AWhetter commented May 8, 2021

Really we should restrict the addition of toctree nodes to only where the documentation is generated.
But the fact that it edits the toctree in this way is also an issue.

This functionality exists to overcome what I see as a shortcoming of Sphinx, and ideally Sphinx would be capable of adding domain nodes to the toctree itself. I've started work on this in sphinx-doc/sphinx#6316, but it might take a while.

@AWhetter AWhetter added the Bug label May 8, 2021
@jakobandersen
Copy link
Contributor Author

This functionality exists to overcome what I see as a shortcoming of Sphinx, and ideally Sphinx would be capable of adding domain nodes to the toctree itself. I've started work on this in sphinx-doc/sphinx#6316, but it might take a while.

I completely agree, and the interface you suggest there seems nice to me. Though, I don't know much about the toctree part of Sphinx, so I can't say what the best implementation strategy is.

@AWhetter
Copy link
Collaborator

AWhetter commented Apr 7, 2023

Sphinx is now capable of adding domain objects to the toctree itself. Therefore add_domain_to_toctree was removed from AutoAPI and this issue is no longer relevant.

@AWhetter AWhetter closed this as completed Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants