Skip to content

Consider enabling collapse_navigation by default #323

@Cadair

Description

@Cadair

Describe the performance issue

We default to collapse_navigation=False which means our navigation sidebar looks like this:

Image

where the whole tree is navigable from all pages.

if set to True it looks like this:

Image

Building the sunpy documentation with collapse_navigation=True takes 145.82 s.

Details
$ tox -e build_docs -- -D html_theme_options.collapse_navigation=True -aE -j 2
[...]
build_docs: commands[2] /home/stuart/Git/sunpy/docs> python -c 'import pathlib; print("Documentation available under file://{0}".format(pathlib.Path(r"/home/stuart/Git/sunpy") / "docs" / "_build" / "index.html"))'
Documentation available under file:///home/stuart/Git/sunpy/docs/_build/index.html
  build_docs: OK (156.30=setup[9.88]+cmd[0.29,0.29,145.82,0.03] seconds)
  congratulations :) (156.35 seconds)

and building the sunpy documentation with collapse_navigation=False takes 372.00 s.

Details
$ tox -e build_docs -- -D html_theme_options.collapse_navigation=False -aE -j 2
[...]
build_docs: commands[2] /home/stuart/Git/sunpy/docs> python -c 'import pathlib; print("Documentation available under file://{0}".format(pathlib.Path(r"/home/stuart/Git/sunpy") / "docs" / "_build" / "index.html"))'
Documentation available under file:///home/stuart/Git/sunpy/docs/_build/index.html
  build_docs: OK (381.91=setup[9.35]+cmd[0.27,0.27,372.00,0.03] seconds)
  congratulations :) (381.95 seconds)
**

Proposed fix

We could set this as the default in the theme, as astropy have done. Or we could conditionally set it for just sunpy, or just tox builds of the sunpy docs (but not RTD) for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions