All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Docs: use RTD dark mode if available
@ 2021-12-01  8:22 Mauro Carvalho Chehab
  2021-12-01  8:22 ` [PATCH 1/1] docs: add support for dark mode Mauro Carvalho Chehab
  2021-12-01  8:41 ` [PATCH 0/1] Docs: use RTD dark mode if available Mauro Carvalho Chehab
  0 siblings, 2 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-12-01  8:22 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, linux-kernel, Jani Nikula, Randy Dunlap,
	Akira Yokosawa

Hi Jon,

As we're analyzing some theme alternatives, one of the things that annoys
me more at our theme is that it doesn't come with a dark mode.

At least here, I strongly prefer dark themes, as it seems to be a lot more
comfortable to my eyes, specially in the morning.

There's an extension to the RTD theme that allows building the docs with a
dark theme, with a button to select normal mode.

As this comes almost for free, optionally enable the dark mode extension if
such theme is installed at the machine.

Mauro Carvalho Chehab (1):
  docs: add support for dark mode

 Documentation/conf.py | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.33.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] docs: add support for dark mode
  2021-12-01  8:22 [PATCH 0/1] Docs: use RTD dark mode if available Mauro Carvalho Chehab
@ 2021-12-01  8:22 ` Mauro Carvalho Chehab
  2021-12-01  8:41 ` [PATCH 0/1] Docs: use RTD dark mode if available Mauro Carvalho Chehab
  1 sibling, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-12-01  8:22 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Akira Yokosawa, Jani Nikula, Randy Dunlap,
	linux-kernel

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@kernel.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] Docs: use RTD dark mode if available
  2021-12-01  8:22 [PATCH 0/1] Docs: use RTD dark mode if available Mauro Carvalho Chehab
  2021-12-01  8:22 ` [PATCH 1/1] docs: add support for dark mode Mauro Carvalho Chehab
@ 2021-12-01  8:41 ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-12-01  8:41 UTC (permalink / raw)
  To: Linux Doc Mailing List, Jonathan Corbet
  Cc: linux-kernel, Jani Nikula, Randy Dunlap, Akira Yokosawa

Em Wed,  1 Dec 2021 09:22:02 +0100
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> escreveu:

> Hi Jon,
> 
> As we're analyzing some theme alternatives, one of the things that annoys
> me more at our theme is that it doesn't come with a dark mode.
> 
> At least here, I strongly prefer dark themes, as it seems to be a lot more
> comfortable to my eyes, specially in the morning.
> 
> There's an extension to the RTD theme that allows building the docs with a
> dark theme, with a button to select normal mode.
> 
> As this comes almost for free, optionally enable the dark mode extension if
> such theme is installed at the machine.

Too good to be true... It won't work properly, as:

1. Some of the css custom configs at sphinx-static define colors;
2. It sounds that this overlay to RTD theme is missing some classes,
   as, at least here, function prototypes from driver-api/media/v4l2-async.html
   are written with a black color over a dark gray background.

I'll do more tests. If I find a solution, I'll submit another version.

Thanks,
Mauro

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-01  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01  8:22 [PATCH 0/1] Docs: use RTD dark mode if available Mauro Carvalho Chehab
2021-12-01  8:22 ` [PATCH 1/1] docs: add support for dark mode Mauro Carvalho Chehab
2021-12-01  8:41 ` [PATCH 0/1] Docs: use RTD dark mode if available Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.