From ec761273df6d6288458ab19320c1a2d645a12cbe Mon Sep 17 00:00:00 2001 From: David Runge Date: Wed, 22 Nov 2023 22:32:53 +0100 Subject: [PATCH] Modify CSS for admonition environments when building EPUB Add a lightgray `background-color` for all admonition environments. Add a palevioletred `background-color` for all admonition-warning and warning environments. Signed-off-by: David Runge --- book/source/_static/epub/css/custom.css | 13 +++++++++++++ book/source/conf.py | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 book/source/_static/epub/css/custom.css diff --git a/book/source/_static/epub/css/custom.css b/book/source/_static/epub/css/custom.css new file mode 100644 index 0000000..40ca147 --- /dev/null +++ b/book/source/_static/epub/css/custom.css @@ -0,0 +1,13 @@ +/* +SPDX-FileCopyrightText: 2023 The "Notes on OpenPGP" project +SPDX-License-Identifier: CC0-1.0 +*/ + +div.admonition { + background-color: lightgray; +} + +div.warning, +div.admonition-warning { + background-color: palevioletred; +} \ No newline at end of file diff --git a/book/source/conf.py b/book/source/conf.py index 96f5eb4..abacb6f 100644 --- a/book/source/conf.py +++ b/book/source/conf.py @@ -24,7 +24,12 @@ source_suffix = ['.md', '.rst'] templates_path = ['_templates'] exclude_patterns = [] +# -- Options for EPUB output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-epub-output +epub_css_files = [ + 'epub/css/custom.css' +] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output