8000 DOC: restore toctree maxdepth by jorisvandenbossche · Pull Request #25134 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

DOC: restore toctree maxdepth #25134

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

Merged
merged 7 commits into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make it hidden + make sure it is still in sidebar
  • Loading branch information
jorisvandenbossche committed Mar 10, 2019
commit d092acf04dbce996ffe2f7af947dc2d56362b74e
1 change: 1 addition & 0 deletions doc/source/index.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ See the :ref:`overview` for more detail about what's in the library.
{% else -%}
.. toctree::
:maxdepth: 3
:hidden:
{% endif %}

{% if not single_doc -%}
Expand Down
4 changes: 2 additions & 2 deletions doc/source/themes/nature_with_gtoc/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{%- block sidebar1 %}
{%- block sidebartoc %}
<h3>{{ _('Table Of Contents') }}</h3>
{{ toctree() }}
{{ toctree(includehidden=True) }}
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

{%- endblock %}
{%- block sidebarsearch %}
<h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
Expand Down Expand Up @@ -105,4 +105,4 @@ <h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
{% endblock %}
{% endblock %}
0