Skip to content

[Docs] Switch documentation theme to sphinx-book-theme#19828

Open
tlopex wants to merge 1 commit into
apache:mainfrom
tlopex:docs-sphinx-book-theme
Open

[Docs] Switch documentation theme to sphinx-book-theme#19828
tlopex wants to merge 1 commit into
apache:mainfrom
tlopex:docs-sphinx-book-theme

Conversation

@tlopex

@tlopex tlopex commented Jun 18, 2026

Copy link
Copy Markdown
Member

This pr migrates the documentation site from sphinx_rtd_theme to sphinx-book-theme (pydata-sphinx-theme based)

docs/conf.py:

  • html_theme = "sphinx_book_theme"; drop the dead TVM_THEME/READTHEDOCS indirection that always resolved to sphinx_rtd_theme.
  • Replace the RTD-only html_theme_options ({"logo_only": True}) with book-theme options: repository_url/branch + path_to_docs driving the repository/edit/ source/issue buttons, GitHub + TVM-home icon_links, and an extra_footer with the Community/Download/Docs links, ASF dropdown, and Apache trademark notice (the copyright line is rendered natively by the theme, not duplicated).
  • Remove the tlcpack_sphinx_addon import and its templates_path/html_static_path injection, plus the now-unused html_context header/footer machinery and fixup_tutorials.
  • sphinx_gallery_conf["show_signature"] = False to drop the "Gallery generated by Sphinx-Gallery" line.
  • Remove the dead docs/_static/css/tvm_theme.css (RTD-only selectors, never linked).

Dependency pins updated in lockstep (sphinx-book-theme==1.2.0 is the minimum release compatible with Sphinx 8.1.3; it pins pydata-sphinx-theme==0.16.1):

  • docker/install/ubuntu_install_sphinx.sh: sphinx_rtd_theme + tlcpack addon ->
    sphinx-book-theme + pydata-sphinx-theme.
  • docker/install/ubuntu_install_python_package.sh: drop the tlcpack addon pin.
  • tests/scripts/ci.py: reconcile the stale local docs requirements to the ci-gpu docs stack.
  • docs/README.md: native-build instructions install sphinx-book-theme.

Preserved in the footer: ASF dropdown, Community/Download/Docs links, copyright, and Apache trademark notice. Intentionally dropped (no book-theme equivalent): the branded top nav bar, the version_prefixes dropdown (which did not render on the deployed site), and the tlcpack search-summary snippet. sphinx-gallery's own sg_gallery.css is unaffected, so tutorial thumbnail grids still render.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@tlopex tlopex force-pushed the docs-sphinx-book-theme branch from c5d97dc to 5ed38bc Compare June 18, 2026 17:10
@tlopex

tlopex commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

@tvm-bot rerun

Migrate the documentation site from sphinx_rtd_theme to sphinx-book-theme
(pydata-sphinx-theme based), matching the in-repo 3rdparty/tvm-ffi docs which
already use this theme.

The published theme was not plain sphinx_rtd_theme: it was tlcpack-sphinx-addon's
full standalone layout.html, injected via templates_path, which overrides any
html_theme. Switching the theme therefore also removes the addon's
template/static injection (otherwise the switch is a visual no-op).

docs/conf.py:
- html_theme = "sphinx_book_theme"; drop the dead TVM_THEME/READTHEDOCS
  indirection that always resolved to sphinx_rtd_theme.
- Replace the RTD-only html_theme_options ({"logo_only": True}) with book-theme
  options: repository_url/branch + path_to_docs driving the repository/edit/
  source/issue buttons, GitHub + TVM-home icon_links, and an extra_footer with
  the Community/Download/Docs links, ASF dropdown, and Apache trademark notice
  (the copyright line is rendered natively by the theme, not duplicated).
- Remove the tlcpack_sphinx_addon import and its templates_path/html_static_path
  injection, plus the now-unused html_context header/footer machinery and
  fixup_tutorials.
- sphinx_gallery_conf["show_signature"] = False to drop the "Gallery generated
  by Sphinx-Gallery" line.
- Remove the dead docs/_static/css/tvm_theme.css (RTD-only selectors, never linked).

tests/scripts/ci.py and docs/README.md: point the local docs requirements /
native-build instructions at sphinx-book-theme.

The ci-gpu Docker image dependency change (add sphinx-book-theme, drop
sphinx_rtd_theme + tlcpack-sphinx-addon) is handled in a companion PR so the CI
image is rebuilt with the new theme before this switch lands.
@tlopex tlopex force-pushed the docs-sphinx-book-theme branch from 5ed38bc to 3dcf69b Compare June 18, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant