[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a973d72bc678443b9a0d672327a06595c665a4a8.1638346585.git.mchehab+huawei@kernel.org>
Date: Wed, 1 Dec 2021 09:22:03 +0100
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Jonathan Corbet <corbet@....net>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
"Akira Yokosawa" <akiyks@...il.com>,
"Jani Nikula" <jani.nikula@...ux.intel.com>,
"Randy Dunlap" <rdunlap@...radead.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] docs: add support for dark mode
There's an extension to RTD theme which allows to switch
between dark mode and normal one. Use it, if available.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH 0/1] at: https://lore.kernel.org/all/cover.1638346585.git.mchehab+huawei@kernel.org/
Documentation/conf.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 76e5eb5cb62b..dfbd4dd4bc5e 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -216,6 +216,14 @@ try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+
+ # If dark mode is available, use it
+ try:
+ extensions.append('sphinx_rtd_dark_mode')
+ html_theme = 'sphinx_rtd_dark_mode'
+ except:
+ pass
+
except ImportError:
sys.stderr.write('Warning: The Sphinx \'sphinx_rtd_theme\' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.\n')
--
2.33.1
Powered by blists - more mailing lists