-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
DOC: restore toctree maxdepth #25134
DOC: restore toctree maxdepth #25134
Conversation
Codecov Report
@@ Coverage Diff @@
## master #25134 +/- ##
==========================================
+ Coverage 92.37% 92.37% +<.01%
==========================================
Files 166 166
Lines 52408 52408
==========================================
+ Hits 48411 48412 +1
+ Misses 3997 3996 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25134 +/- ##
=======================================
Coverage 91.26% 91.26%
=======================================
Files 173 173
Lines 52968 52968
=======================================
Hits 48339 48339
Misses 4629 4629
Continue to review full report at Codecov.
|
-1 on this. Didn't realise that the home page depth was affecting the sidebar levels (I understand that's this is what it's being fixed). In Or I guess that creating an invisible toctree with depth 3 or 4 after this one should have the same effect (I guess the depth is being propagated from page to page after this toctree is being rendered). |
Yes, that is what is being fixed.
I am not sure that is what it is supposed to control. At least, from trying both in the pandas docs, as in a dummy test docs, it does not do that .. It's not really clear to me what it then actually does control.
Yes, I tried that as well, but it cannot be combined with another visible toctree with less depth. Because it will simply put the two toctrees in the sidebar ... It's a trade-off between a better side-bar navigation and a shorter (more useful) table of contents on the main index page. Personally, I find the side bar more important. The only solution I see at the moment is to make the main toctree |
BTW, I opened an issue about the :tocdepth: on sphinx: sphinx-doc/sphinx#6033 |
@datapythonista I implemented what I describe above (last paragraph in #25134 (comment)):
I needed to edit out sphinx theme template to include hidden toctrees in the sidebar |
@jreback @TomAugspurger I would like to include this for 0.24.2. And before you complain about the added complexity (separate manual toctree to keep up to date): as far as I know, there is no way with sphinx to have both the sidebar toc go up to a level of 3, and have that same toctree shown on the main page with a depth up to a level of 2. See the discussion above. |
@jorisvandenbossche thoughts on #25614 before this? I find the default TOC navigation that comes with that on the left hand side rather nice. |
@@ -19,7 +19,7 @@ | |||
{%- block sidebar1 %} | |||
{%- block sidebartoc %} | |||
<h3>{{ _('Table Of Contents') }}</h3> | |||
{{ toctree() }} | |||
{{ toctree(includehidden=True) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use a few hidden toctrees in the API docs to prevent sphinx /numpydoc from throwing a warning (e.g. reference/index.rst has api/pandas.api.extensions.ExtensionDtype.na_value
. Do you know if those show up in the sidebar now? Or is the include_hidden
limited to just certain pages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. And yes, they do ...
Checking now if by putting them in a comment instead of using :hidden:
helps for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option may be to put them in a different toctree on a page that is an orphan? Not sure if Sphinx will complain about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both seemed to work, used the commented toctrees now.
doc/source/index.rst.template
Outdated
@@ -52,3 +53,66 @@ See the :ref:`overview` for more detail about what's in the library. | |||
development/index | |||
whatsnew/index | |||
{% endif -%} | |||
|
|||
|
|||
* :doc:`whatsnew/v0.24.1` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the link we currently have on the main page (I only omitted the subsections for this page)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I suppose you meant the "0.24.1". That should indeed be 0.25.0 for master (and needs to be changed to 0.24.2 on the 0.24.x branch), thanks for the catch.
@WillAyd I am personally slighly -1 on hurrying that, but will try to answer there soon. But also, both PRs should be quite independent (except of the one-line change I made in the theme layout here, which would not be needed with the rtd theme. But the main part of this PR (changing the maxdepth etc) is also needed for the rtd theme) |
(failure is the sparse one which is fixed on master) Going to merge this soon, any more comments? |
I think this is good to merge now (or soon. Maybe leave a couple hours). This solves the biggest complain with the 0.24.0 reorganization. But it shouldn't preclude further improvements in navigation and restructuring of our very large pages. |
Yes, for sure. This is only meant for patching up what we currently have to make it more usable again, not to be a final solution. |
* upstream/master: (110 commits) DOC: hardcode contributors for 0.24.x releases (pandas-dev#25662) DOC: restore toctree maxdepth (pandas-dev#25134) BUG: Redefine IndexOpsMixin.size, fix pandas-dev#25580. (pandas-dev#25584) BUG: to_csv line endings with compression (pandas-dev#25625) DOC: file obj for to_csv must be newline='' (pandas-dev#25624) Suppress incorrect warning in nargsort for timezone-aware DatetimeIndex (pandas-dev#25629) TST: fix incorrect sparse test (now failing on scipy master) (pandas-dev#25653) CLN: Removed debugging code (pandas-dev#25647) DOC: require Return section only if return is not None nor commentary (pandas-dev#25008) DOC:Remove hard-coded examples from _flex_doc_SERIES (pandas-dev#24589) (pandas-dev#25524) TST: xref pandas-dev#25630 (pandas-dev#25643) BUG: Fix pandas-dev#25481 by fixing the error message in TypeError (pandas-dev#25540) Fixturize tests/frame/test_mutate_columns.py (pandas-dev#25642) Fixturize tests/frame/test_join.py (pandas-dev#25639) Fixturize tests/frame/test_combine_concat.py (pandas-dev#25634) Fixturize tests/frame/test_asof.py (pandas-dev#25628) BUG: Fix user-facing AssertionError with to_html (pandas-dev#25608) (pandas-dev#25620) DOC: resolve all GL03 docstring validation errors (pandas-dev#25525) TST: failing wheel building on PY2 and old numpy (pandas-dev#25631) DOC: Remove makePanel from docs (pandas-dev#25609) (pandas-dev#25612) ...
Closes #25131
I used a
maxdepth
of 3 now, instead of the original 4.Now, the problem is that this makes the toctree on the main page (the one in the actual page body, not the one in the left sidebar) again very long and not very usable ..
cc @datapythonista @neili02