The `sphinx-rtd-theme` is the official Sphinx theme for Read the Docs, designed to provide an excellent reading experience for documentation users on both desktop and mobile devices. It is widely adopted across many open-source projects. The current version is 3.1.0, and it maintains an active development and release cadence.
pip install sphinx-rtd-themeVerified import paths — ran on the pinned version, not inferred.
After installing the theme, update your Sphinx project's `conf.py` file to specify `sphinx_rtd_theme` as the `html_theme` and add `sphinx_rtd_theme` to your `extensions` list. Then, build your Sphinx documentation.
Upgrade Sphinx to 6.0 or newer and Python to 3.8 or newer. If not possible, pin `sphinx-rtd-theme<2.0.0` or `sphinx-rtd-theme<3.1.0` depending on your Sphinx/Python versions.
Ensure your Sphinx project uses the HTML5 writer. Modern Sphinx versions use HTML5 by default.
Remove `analytics_id` and `analytics_anonymize_ip` from `conf.py` and configure `sphinxcontrib-googleanalytics` instead.
Remove `html_theme_path` from `conf.py` if it points to the installed theme. Migrate custom CSS to be included differently as per theme documentation.
Add `'sphinx_rtd_theme'` to your `extensions` list in `conf.py`.
If encountering build errors after switching themes, try unsetting `html_sidebars`, `html_theme_path`, or `html_theme_config` in your `conf.py`.