lkml.org 
[lkml]   [2021]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] docs: conf.py: fix support for Readthedocs v 1.0.0
From
Date
On 26/11/2021 11:50, 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 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>

Much appreciated! Looks a lot better now :-)

Regards,

Hans

> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> Documentation/conf.py | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index 17f7cee56987..7bc72be63fd2 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -249,11 +249,16 @@ except ImportError:
>
> html_static_path = ['sphinx-static']
>
> -html_context = {
> - 'css_files': [
> +if major <= 1 and (minor < 8):
> + html_context = {
> + 'css_files': [
> + '_static/theme_overrides.css',
> + ],
> + }
> +else:
> + html_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
>

\
 
 \ /
  Last update: 2021-11-26 12:48    [W:1.118 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site