[Docs] Switch documentation theme to sphinx-book-theme#19862
[Docs] Switch documentation theme to sphinx-book-theme#19862spectrometerHBH wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the default documentation theme from 'rtd' to 'sphinx_book_theme', adding specific configuration options and a custom CSS file (tirx_theme.css) to ensure the TVM logo displays correctly in dark mode. Additionally, the application of tlcpack_sphinx_addon overrides is restricted to RTD themes. The reviewer identified a potential issue where checking only for 'sphinx_rtd_theme' might miss cases where the theme is set to 'rtd' on Read the Docs, and suggested checking for both values to ensure the overrides are correctly applied.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| # add additional overrides. The tlcpack templates override layout.html for the | ||
| # RTD theme (and assume its header/footer html_context); only apply them when the | ||
| # RTD theme is active so they don't clobber another theme's own layout. | ||
| if html_theme == "sphinx_rtd_theme": |
There was a problem hiding this comment.
On Read the Docs (on_rtd = True), if TVM_THEME is set to "rtd", html_theme remains "rtd" because the local normalization block on line 361 does not execute. Checking only html_theme == "sphinx_rtd_theme" will evaluate to False in this case, preventing the tlcpack_sphinx_addon templates and static overrides from being applied. We should check for both "sphinx_rtd_theme" and "rtd" to ensure correctness.
| if html_theme == "sphinx_rtd_theme": | |
| if html_theme in ("sphinx_rtd_theme", "rtd"): |
19cfd49 to
ec3f985
Compare
- docs/conf.py: default html_theme -> sphinx-book-theme (book-theme options; tlcpack layout overrides scoped to the RTD theme); docs/_static/css/tirx_theme.css for the dark-mode logo backing. - tests/scripts/task_python_docs.sh: install sphinx-book-theme==1.1.4 at docs-build time. It is already declared in docker/install/ubuntu_install_sphinx.sh, but the currently-published ci-gpu image predates that dependency, so install it in the docs job until the CI image is refreshed. sphinx-book-theme 1.1.4 builds cleanly under Sphinx 8.1.3.
ec3f985 to
2f02fc7
Compare
Switches the documentation theme from
sphinx_rtd_themetosphinx-book-theme(already installed in the CI image via
docker/install/ubuntu_install_sphinx.sh,added in #19835).
html_themedefault →sphinx_book_theme;TVM_THEME=rtdstill selects RTD.html_theme_options(repo buttons, nav/toc depth); RTD keepslogo_only.are now applied only when the RTD theme is active.
_static/css/tirx_theme.css(dark-mode logo backing) loaded for the book theme.Opening to verify the docs build/
check_sphinx_warningspass on the book theme.