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

Menu hierarchy broken for local TOCs #834

Open
peterthomassen opened this issue Oct 16, 2019 · 9 comments
Open

Menu hierarchy broken for local TOCs #834

peterthomassen opened this issue Oct 16, 2019 · 9 comments
Labels
Bug A bug Needed: replication Bug replication is required

Comments

@peterthomassen
Copy link

Details

Expected Result

In the menu on the left, submenus should expand correctly. For example, under the item "Retrieving and Manipulating DNS Information", there is an item "Creating an RRset". This section has subsections, and thus the menu item is preceded by a + symbol.

The expectation is that when you click on the + symbol in front of "Creating an RRset", the menu expands and displays the titles of the subsections.

Actual Result

The "Creating an RRset" menu item has a + in front, but click on it does not expand any items. Instead, the subsections already are displayed in the minute from the beginning, on the same hierarchy level as the "Creating an RRset" section itself (although it is the parent section).

Other thoughts

I believe this is a rtd problem, but it also may be a problem with the documentation source. However, in the text itself, the hierarchy itself is displayed correctly, so I'm not sure what to think. Here's the documentation source: https://github.com/desec-io/desec-stack/tree/master/docs/

@stsewd
Copy link
Member

stsewd commented Oct 16, 2019

Hmm, this works fine on https://docs.readthedocs.io/en/stable/config-file/v2.html

Also, you should try creating a sphinx project (currently rtd is generating some default files for you)
https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html It may be related to that.

And If this is a bug, you should report it to https://github.com/readthedocs/sphinx_rtd_theme

And finally, looks like you are using a single html instead of several pages. Please create a sphinx project and let us know if you replicate that locally with a normal build and single html.

@stsewd stsewd transferred this issue from readthedocs/readthedocs.org Oct 16, 2019
@stsewd
Copy link
Member

stsewd commented Oct 16, 2019

And If this is a bug, you should report it to https://github.com/readthedocs/sphinx_rtd_theme

I just transferred the issue for you :)

@agjohnson
Copy link
Collaborator

The RTD docs have the correct behavior likely because it's using the global toc (we are linking pages with toctree directives). These docs rely on a localtoc, which behaves far differently in Spinx. The local toc tree is what you get when you omit a toctree directive and rely on just the page headings to populate the navigation.

The results here don't look correct though, obviously. However, we haven't had this issue with local toctrees before, so this is either a regression (or it could just be a poorly tested use case), or something like the usage of something like include is causing problems with the toctree (unlikely).

@agjohnson agjohnson added Bug A bug Needed: replication Bug replication is required labels Oct 18, 2019
@peterthomassen
Copy link
Author

@agjohnson I'm not sure: Does your message imply that there's something we can do in our docs themselves to fix the problem (like adding or removing a directive)?

peterthomassen added a commit to desec-io/desec-stack that referenced this issue Dec 8, 2019
While increasing the comprehensibility of our docs, this should
also make the problem reported in readthedocs/sphinx_rtd_theme#834
go away.
peterthomassen added a commit to desec-io/desec-stack that referenced this issue Dec 8, 2019
While increasing the comprehensibility of our docs, this should
also make the problem reported in readthedocs/sphinx_rtd_theme#834
go away.
peterthomassen added a commit to desec-io/desec-stack that referenced this issue Dec 8, 2019
While increasing the comprehensibility of our docs, this should
also make the problem reported in readthedocs/sphinx_rtd_theme#834
go away.
peterthomassen added a commit to desec-io/desec-stack that referenced this issue Dec 8, 2019
While increasing the comprehensibility of our docs, this should
also make the problem reported in readthedocs/sphinx_rtd_theme#834
go away.
peterthomassen added a commit to desec-io/desec-stack that referenced this issue Dec 8, 2019
While increasing the comprehensibility of our docs, this should
also make the problem reported in readthedocs/sphinx_rtd_theme#834
go away.
peterthomassen added a commit to desec-io/desec-stack that referenced this issue Dec 8, 2019
While increasing the comprehensibility of our docs, this should
also make the problem reported in readthedocs/sphinx_rtd_theme#834
go away.
peterthomassen added a commit to desec-io/desec-stack that referenced this issue Dec 8, 2019
While increasing the comprehensibility of our docs, this should
also make the problem reported in readthedocs/sphinx_rtd_theme#834
go away.
@peterthomassen
Copy link
Author

We switched to a proper Sphinx project with toctree directives, so the problem is no longer relevant for us. Thanks for the advice!

However, I guess it's still a bug, so if you would like to investigate in the future, here's the historic revision of our docs that reproduces the problem: https://github.com/desec-io/desec-stack/tree/4136abc442255b9bbf379dad7f28085b9d0586a8/docs

On the other hand, I don't mind if you close this.

@omarryhan
Copy link

omarryhan commented Dec 8, 2020

Hey, I'm also facing a similar problem here: https://aiogoogle.readthedocs.io/en/latest/.
Under "Authentication", the hierarchy should be as follows:

  • (-) User Account
    • OAuth2
    • OpenID Connect
  • (-) Service Account
    • OAuth2
  • Anonymous Principal (API Keys)

Instead, it's like this

  • (+/-) User Account
  • OAuth2
  • OpenID Connect
  • (+/-) Service Account
  • OAuth2
  • Anonymous Principal (API Keys)

What would be the easiest way to fix it? Thanks.

@stsewd
Copy link
Member

stsewd commented Feb 9, 2021

@omarryhan your index.rst should have a toctree directive https://github.com/omarryhan/aiogoogle/blob/master/docs/index.rst. This is mentioned by the auto generated comment from sphinx as well

.. Aiogoogle documentation master file, created by
   sphinx-quickstart on Tue Nov 20 20:02:59 2018.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

See https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#toctree-directive

omarryhan added a commit to omarryhan/aiogoogle that referenced this issue Feb 9, 2021
@omarryhan
Copy link

Thanks, that fixed it!

I'm getting these two lines of error now:

preparing documents... /home/omar/aiogoogle/docs/index.rst: WARNING: self referenced toctree found. Ignored.
/home/omar/aiogoogle/docs/index.rst: WARNING: circular toctree references detected, ignoring: index <- index

But judging by the fact that it says that this is being ignored and also the fact that the docs are being generated just fine, I'll probably ignore it for now.

@stsewd stsewd changed the title Menu hierarchy broken Menu hierarchy broken for local TOCs Feb 9, 2021
@flying-sheep
Copy link

flying-sheep commented Jul 14, 2021

I guess the correct way to avoid cycles is

.. toctree::

   self

but I can’t figure out how to get subheadings into the sidebar that way, no config option seems to have an effect.

See sphinx-doc/sphinx#2103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: replication Bug replication is required
Projects
None yet
Development

No branches or pull requests

5 participants