linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] docs: fix themes with newer Sphinx and RTD themes
@ 2021-11-27  9:14 Mauro Carvalho Chehab
  2021-11-27  9:14 ` [PATCH v2 1/1] docs: conf.py: fix support for Readthedocs v 1.0.0 Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-11-27  9:14 UTC (permalink / raw)
  To: Linux Doc Mailing List
  Cc: Mauro Carvalho Chehab, linux-kernel, Jonathan Corbet,
	Jani Nikula, Randy Dunlap, Akira Yokosawa, Laurent Pinchart,
	Hans Verkuil

Hi Jon,

That's the second version of the patch fixing themes with newer versions of
Sphinx and RTD themes.

On my past version, the theme was not actually applied on newer Kernels,
causing a regresion. This version addresses it. It also takes Laurent's suggestion
into account.

As this is actually a fix, I would pick it, independently on the discussions if
we should keep using RTD theme or not.

Regards,
Mauro

Mauro Carvalho Chehab (1):
  docs: conf.py: fix support for Readthedocs v 1.0.0

 Documentation/conf.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

-- 
2.33.1



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

* [PATCH v2 1/1] docs: conf.py: fix support for Readthedocs v 1.0.0
  2021-11-27  9:14 [PATCH v2 0/1] docs: fix themes with newer Sphinx and RTD themes Mauro Carvalho Chehab
@ 2021-11-27  9:14 ` Mauro Carvalho Chehab
  2021-11-27 12:13   ` Akira Yokosawa
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-11-27  9:14 UTC (permalink / raw)
  To: Linux Doc Mailing List
  Cc: Mauro Carvalho Chehab, Akira Yokosawa, Hans Verkuil, Jani Nikula,
	Jonathan Corbet, Laurent Pinchart, Randy Dunlap, linux-kernel

As described at:
	https://stackoverflow.com/questions/23211695/modifying-content-width-of-the-sphinx-theme-read-the-docs

since Sphinx 1.8, the standard way to setup a custom theme is
to use html_css_files. While using html_context is OK with RTD
0.5.2, it doesn't work with 1.0.0, causing the theme to not load,
producing a very weird html.

Tested with:
	- Sphinx 1.7.9 + sphinx-rtd-theme 0.5.2
	- Sphinx 2.4.4 + sphinx-rtd-theme 0.5.2
	- Sphinx 2.4.4 + sphinx-rtd-theme 1.0.0
	- Sphinx 4.3.0 + sphinx-rtd-theme 1.0.0

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Tested-by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---

See [PATCH v2 0/1] at: https://lore.kernel.org/all/cover.1638004294.git.mchehab+huawei@kernel.org/

 Documentation/conf.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 17f7cee56987..76e5eb5cb62b 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -249,11 +249,16 @@ except ImportError:
 
 html_static_path = ['sphinx-static']
 
-html_context = {
-    'css_files': [
-        '_static/theme_overrides.css',
-    ],
-}
+html_css_files = [
+    'theme_overrides.css',
+]
+
+if major <= 1 and minor < 8:
+    html_context = {
+        'css_files': [
+            '_static/theme_overrides.css',
+        ],
+    }
 
 # Add any extra paths that contain custom files (such as robots.txt or
 # .htaccess) here, relative to this directory. These files are copied
-- 
2.33.1


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

* Re: [PATCH v2 1/1] docs: conf.py: fix support for Readthedocs v 1.0.0
  2021-11-27  9:14 ` [PATCH v2 1/1] docs: conf.py: fix support for Readthedocs v 1.0.0 Mauro Carvalho Chehab
@ 2021-11-27 12:13   ` Akira Yokosawa
  0 siblings, 0 replies; 3+ messages in thread
From: Akira Yokosawa @ 2021-11-27 12:13 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Hans Verkuil, Jani Nikula, Jonathan Corbet, Laurent Pinchart,
	Randy Dunlap, linux-kernel, Linux Doc Mailing List

On Sat, 27 Nov 2021 10:14:49 +0100, Mauro Carvalho Chehab wrote:
> As described at:
> 	https://stackoverflow.com/questions/23211695/modifying-content-width-of-the-sphinx-theme-read-the-docs
> 
> since Sphinx 1.8, the standard way to setup a custom theme is
> to use html_css_files. While using html_context is OK with RTD
> 0.5.2, it doesn't work with 1.0.0, causing the theme to not load,
> producing a very weird html.
> 
> Tested with:
> 	- Sphinx 1.7.9 + sphinx-rtd-theme 0.5.2
> 	- Sphinx 2.4.4 + sphinx-rtd-theme 0.5.2
> 	- Sphinx 2.4.4 + sphinx-rtd-theme 1.0.0
> 	- Sphinx 4.3.0 + sphinx-rtd-theme 1.0.0
> 
> Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
> Tested-by: Hans Verkuil <hverkuil@xs4all.nl>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> 
> See [PATCH v2 0/1] at: https://lore.kernel.org/all/cover.1638004294.git.mchehab+huawei@kernel.org/

Hi Mauro,

Good to see the nice looking HTML pages as before!

Tested-by: Akira Yokosawa <akiyks@gmail.com>

        Thanks, Akira

> 
>  Documentation/conf.py | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index 17f7cee56987..76e5eb5cb62b 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -249,11 +249,16 @@ except ImportError:
>  
>  html_static_path = ['sphinx-static']
>  
> -html_context = {
> -    'css_files': [
> -        '_static/theme_overrides.css',
> -    ],
> -}
> +html_css_files = [
> +    'theme_overrides.css',
> +]
> +
> +if major <= 1 and minor < 8:
> +    html_context = {
> +        'css_files': [
> +            '_static/theme_overrides.css',
> +        ],
> +    }
>  
>  # Add any extra paths that contain custom files (such as robots.txt or
>  # .htaccess) here, relative to this directory. These files are copied
> 

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

end of thread, other threads:[~2021-11-27 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27  9:14 [PATCH v2 0/1] docs: fix themes with newer Sphinx and RTD themes Mauro Carvalho Chehab
2021-11-27  9:14 ` [PATCH v2 1/1] docs: conf.py: fix support for Readthedocs v 1.0.0 Mauro Carvalho Chehab
2021-11-27 12:13   ` Akira Yokosawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).