镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[Doc] Use sphinx-remove-toctrees to generated docstring pages from navigation (and reduce build time) #30021

Closed as not planned

Description

@asfimport

The pydata-sphinx-theme tends to create large trees in the left-side navigation (and thus large generated large html sizes) because sphinx adds all generated docstring pages (from autosummary usage) to the global "toctrees". A small package (https://github.com/executablebooks/sphinx-remove-toctrees/) was created to help with this.

See https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/configuring.html#selectively-remove-pages-from-your-sidebar

Reporter: Joris Van den Bossche / @jorisvandenbossche

Note: This issue was originally created as ARROW-14460. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Oct 25, 2021

    @asfimport
    Author

    Joris Van den Bossche / @jorisvandenbossche:
    I tried this out and it works nicely, but it also has a downside of then no longer "highlighting" the parent page in the navigation left-sidebar (which is somewhat annoying for our docs, since the sidebar is quite long and doesn't fit on a single page). See also executablebooks/sphinx-remove-toctrees#1 (comment)

    On the other hand, with this change we can remove the if/else in the template here:

    {% if "python/api" in pagename or "python/generated" in pagename %}
    {{ generate_nav_html("sidebar", startdepth=0, maxdepth=3, collapse=False, includehidden=True, titles_only=True) }}
    {% else %}
    {{ generate_nav_html("sidebar", startdepth=0, maxdepth=4, collapse=False, includehidden=True, titles_only=True) }}
    {% endif %}
    (and have it a single generate_nav_html call instead).

  2. asfimport commented on Jul 12, 2022

    @asfimport
    Author

    Todd Farmer / @toddfarmer:
    This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.

  3. AlenkaF commented on Jul 12, 2023

    @AlenkaF
    Member

    I tried this out on the branch with the updated pydata sphinx theme and it works well. The fact that the left sidebar has a missing parent page is a bit confusing but not so much anymore because the parent page is visible in the article header, see:

    Screenshot 2023-07-12 at 11 15 54

  4. github-actions commented on Feb 21, 2026

    @github-actions

    This issue has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this issue will be closed in 14 days. If this improvement is still desired but has no current owner, please add the 'Status: needs champion' label.

  5. added
    Status: stale-warningIssues and PRs flagged as stale which are due to be closed if no indication otherwise
    on Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions