Re: [PATCH] Fix how CSS files are added to the Sphinx HTML.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 02 Sep 2016, Eric Holscher <eric@xxxxxxxxxxxxxxxx> wrote:
> This uses the proper Sphinx add_stylesheet API for adding style overrides:
>
> http://www.sphinx-doc.org/en/stable/extdev/appapi.html#sphinx.application.Sphinx.add_stylesheet
>
> Previously,
> if a user had any other `css_files` defined by extensions,
> they would be overwritten by the `html_context` redefinition here.

Removing html_context makes sense, but we don't seem to actually have
_static/theme_overrides.css, or _static directory for that matter, so
could we just drop the setup function altogether?

BR,
Jani.

>
> Signed-off-by: Eric Holscher <eric@xxxxxxxxxxxxxxxx>
> ---
>  Documentation/conf.py | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index 96b7aa6..1707193 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -179,12 +179,6 @@ except ImportError:
>  
>  html_static_path = ['sphinx-static']
>  
> -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
>  # directly to the root of the documentation.
> @@ -419,3 +413,11 @@ pdf_documents = [
>  # line arguments.
>  kerneldoc_bin = '../scripts/kernel-doc'
>  kerneldoc_srctree = '..'
> +
> +
> +def setup(app):
> +    """
> +    This is a basic Sphinx extension that adds our CSS overrides.
> +    """
> +    app.add_stylesheet('_static/theme_overrides.css')
> +    

-- 
Jani Nikula, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux