lkml.org 
[lkml]   [2021]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH v2 0/4] docs: add better support for Sphinx themes and CSS
Date
Hi Jon,

This series comes after my patch fixing Sphinx support for RTD 1.0.0:

https://lore.kernel.org/lkml/80009f0d17ea0840d81e7e16fff6e7677919fdfc.1638004294.git.mchehab+huawei@kernel.org/

It provides, IMHO, a nice improvement on themes selection. This series
is a v2 of the other theme-related patches I sent today.

-

Sphinx allows using different output templates for HTML (and e-pub).

Right now, the Kernel was hardcoded to use the Read the Docs theme,
falling back to whatever default is setup on a given Sphinx version.

Well, themes and templates are actually an user preference.

This patch set allows selecting different themes and even provide
extra CSS override files.

With that, one could, for instance, do things like:

$ echo "body { color: darkgreen; } div.body { color: darkgreen; } " >my_css.css && make SPHINXDIRS=input CSS=my_css.css THEME=nature htmldocs

In order to use the Sphinx nature theme with the normal font in green.

patch 1 adds a theme selection make variable (THEME);
patch 2 adds a css selection variable (CSS);
patch 3 sets the classic theme to look a little better;
patch 4 adds support for the RTD dark mode theme.

It should be noticed that the RTD dark mode currently has some issues,
as it is actually an override on the top of the original RTD theme.
I suspect it needs to be updated to properly support Sphinx 4.3.0 and
RTD 1.0.0 theme. Yet, it seems useful, as one can always switch to daylight
mode in runtime, if something looks odd with it enabled.

Mauro Carvalho Chehab (4):
docs: allow selecting a Sphinx theme
docs: allow to pass extra CSS themes via make
docs: set format for the classic mode
docs: add support for RTD dark mode

Documentation/Makefile | 9 +-
Documentation/conf.py | 102 ++++++++++++++----
Documentation/doc-guide/sphinx.rst | 11 ++
.../sphinx-static/theme_overrides.css | 16 +--
.../sphinx-static/theme_rtd_colors.css | 37 +++++++
5 files changed, 138 insertions(+), 37 deletions(-)
create mode 100644 Documentation/sphinx-static/theme_rtd_colors.css

--
2.33.1


\
 
 \ /
  Last update: 2021-12-01 14:53    [W:0.036 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site