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

DOC: restore toctree maxdepth #25134

Merged
merged 7 commits into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
68 changes: 66 additions & 2 deletions doc/source/index.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ See the :ref:`overview` for more detail about what's in the library.

{% if single_doc and single_doc.endswith('.rst') -%}
.. toctree::
:maxdepth: 2
:maxdepth: 3

{{ single_doc[:-4] }}
{% elif single_doc %}
Expand All @@ -35,7 +35,8 @@ See the :ref:`overview` for more detail about what's in the library.
{{ single_doc }}
{% else -%}
.. toctree::
:maxdepth: 2
:maxdepth: 3
:hidden:
{% endif %}

{% if not single_doc -%}
Expand All @@ -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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this right?

Copy link
Member Author

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)

Copy link
Member Author

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.

* :doc:`install`
* :doc:`getting_started/index`

* :doc:`getting_started/overview`
* :doc:`getting_started/10min`
* :doc:`getting_started/basics`
* :doc:`getting_started/dsintro`
* :doc:`getting_started/comparison/index`
* :doc:`getting_started/tutorials`

* :doc:`user_guide/index`

* :doc:`user_guide/io`
* :doc:`user_guide/indexing`
* :doc:`user_guide/advanced`
* :doc:`user_guide/merging`
* :doc:`user_guide/reshaping`
* :doc:`user_guide/text`
* :doc:`user_guide/missing_data`
* :doc:`user_guide/categorical`
* :doc:`user_guide/integer_na`
* :doc:`user_guide/visualization`
* :doc:`user_guide/computation`
* :doc:`user_guide/groupby`
* :doc:`user_guide/timeseries`
* :doc:`user_guide/timedeltas`
* :doc:`user_guide/style`
* :doc:`user_guide/options`
* :doc:`user_guide/enhancingperf`
* :doc:`user_guide/sparse`
* :doc:`user_guide/gotchas`
* :doc:`user_guide/cookbook`

* :doc:`ecosystem`
* :doc:`reference/index`

* :doc:`reference/io`
* :doc:`reference/general_functions`
* :doc:`reference/series`
* :doc:`reference/frame`
* :doc:`reference/arrays`
* :doc:`reference/panel`
* :doc:`reference/indexing`
* :doc:`reference/offset_frequency`
* :doc:`reference/window`
* :doc:`reference/groupby`
* :doc:`reference/resampling`
* :doc:`reference/style`
* :doc:`reference/plotting`
* :doc:`reference/general_utility_functions`
* :doc:`reference/extensions`

* :doc:`development/index`

* :doc:`development/contributing`
* :doc:`development/internals`
* :doc:`development/extending`
* :doc:`development/developer`

* :doc:`whatsnew/index`
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 %}