2018-01-29 20:44:03 -05:00
Installation
2021-08-17 14:33:19 -06:00
============
2018-01-29 20:44:03 -05:00
2022-11-09 13:40:16 +01:00
How to install and use the theme
--------------------------------
Install the `` sphinx_rtd_theme `` package (or add it to your `` requirements.txt `` file):
2018-01-29 20:44:03 -05:00
2019-07-19 11:35:12 -06:00
.. code :: console
2018-01-29 20:44:03 -05:00
2019-10-23 11:08:08 -04:00
$ pip install sphinx_rtd_theme
2018-01-29 20:44:03 -05:00
2022-11-09 13:40:16 +01:00
In your Sphinx project's `` conf.py `` file, add `` sphinx_rtd_theme `` to the list of enabled extensions and as the active theme:
2018-01-29 20:44:03 -05:00
.. code :: python
2019-07-16 20:27:16 -06:00
extensions = [
...
'sphinx_rtd_theme',
]
2018-01-29 20:44:03 -05:00
2019-07-16 20:27:16 -06:00
html_theme = "sphinx_rtd_theme"
2018-01-29 20:44:03 -05:00
2021-08-17 14:33:19 -06:00
.. seealso ::
:ref: `supported-browsers`
Officially supported and tested browser/operating system combinations
:ref: `supported-dependencies`
Officially Supported versions of Python, Sphinx, and other dependencies.
2018-01-29 20:44:03 -05:00
2022-11-09 13:40:16 +01:00
2019-07-16 20:27:16 -06:00
.. note ::
2021-03-15 10:12:50 -05:00
Adding this theme as an extension is what enables localization of theme
strings in your translated output. If these strings are not translated in
your output, either we lack the localized strings for your locale, or you
are using an old version of the theme.
2019-07-19 15:29:24 -06:00
2022-11-09 13:40:16 +01:00
..
comment about this note: it's possibly not necessary to add the theme as an extension.
Rather, this is an issue caused by setting html_theme_path.
See: https://github.com/readthedocs/readthedocs.org/pull/9654
.. _howto_upgrade:
How to upgrade
--------------
Adding `` sphinx-rtd-theme `` to your project's dependencies will make pip install the latest compatible version of the theme.
If you want to test a **pre-release** , you need to be explicit about the version you specify.
Otherwise, pip will ignore pre-releases. Add for instance `` sphinx-rtd-theme==1.1.0b3 `` to test a pre-release.
.. tip ::
We recommend that you pin the version of Sphinx that your project is built with.
We won't release sphinx-rtd-theme without marking its compatibility with Sphinx. So if you do not pin `` sphinx-rtd-theme `` itself, you will always get the *latest compatible* release.
More information is available in Read the Docs' documentation on :doc: `rtd:guides/reproducible-builds` .
2019-07-19 15:29:24 -06:00
Via Git or Download
2021-08-17 14:34:25 -06:00
-------------------
2019-07-19 15:29:24 -06:00
2021-03-15 10:12:50 -05:00
.. warning ::
2021-08-17 14:34:25 -06:00
Installing directly from the repository source is deprecated and is not
recommended. Static assets won't be included in the repository starting in
2022-11-09 13:40:16 +01:00
release :ref: `roadmap-release-3.0.0` .
2021-03-15 10:12:50 -05:00
2019-07-19 15:29:24 -06:00
Symlink or subtree the `` sphinx_rtd_theme/sphinx_rtd_theme `` repository into your documentation at
`` docs/_themes/sphinx_rtd_theme `` then add the following two settings to your Sphinx
`` conf.py `` file:
.. code :: python
html_theme = "sphinx_rtd_theme"
html_theme_path = ["_themes", ]