From a9cc5bf6f36fded951b58f6a3a4270cd1a04b69f Mon Sep 17 00:00:00 2001 From: Septatrix <24257556+Septatrix@users.noreply.github.com> Date: Sat, 14 Mar 2020 14:54:31 +0100 Subject: [PATCH] Add docs --- doc/theming.rst | 6 ++++++ doc/usage/configuration.rst | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/doc/theming.rst b/doc/theming.rst index e2ef1fcf2..50b5f8eaa 100644 --- a/doc/theming.rst +++ b/doc/theming.rst @@ -63,6 +63,12 @@ Python :mod:`ConfigParser` module) and has the following structure: highlighting. This can be overridden by the user in the :confval:`pygments_style` config value. +* The **pygments_dark_style** setting gives the name of a Pygments style to use + for highlighting when the CSS media query ``(prefers-color-scheme: dark)`` + evaluates to true. It is injected into the page using + :meth:`~Sphinx.add_css_file()`. This can be overriden by the user in the + :confval:`html_pygments_dark_style` config value. + * The **sidebars** setting gives the comma separated list of sidebar templates for constructing sidebars. This can be overridden by the user in the :confval:`html_sidebars` config value. diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst index e5ab9c7c0..5149bd931 100644 --- a/doc/usage/configuration.rst +++ b/doc/usage/configuration.rst @@ -939,6 +939,13 @@ that use Sphinx's HTMLWriter class. The image file will be copied to the ``_static`` directory of the output HTML, but only if the file does not already exist there. +.. confval:: html_pygments_dark_style + + The style name to use for an additional Pygments stylesheet similar to + :confval:`pygments_style` . If not set and the theme defines a default + ``'pygments_dark_style'`` it will be used, otherwise no additional style + will be generated. See :doc:`/usage/theming` for further information. + .. confval:: html_css_files A list of CSS files. The entry must be a *filename* string or a tuple