From 832578c70b3a8655cfafea56e71bd244c05795b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:38:35 +0400 Subject: [PATCH] Fix formatting of Markdown code blocks (#2750) (#2755) * Fix formatting of Markdown code blocks * Fix lint (cherry picked from commit 3599f01a189ddd1c3de709e2b35accce9650e6d4) Co-authored-by: Quentin Pradet --- docs/sphinx/_static/css/custom.css | 16 ++++++++++++++++ docs/sphinx/conf.py | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 docs/sphinx/_static/css/custom.css diff --git a/docs/sphinx/_static/css/custom.css b/docs/sphinx/_static/css/custom.css new file mode 100644 index 000000000..e6ffd086e --- /dev/null +++ b/docs/sphinx/_static/css/custom.css @@ -0,0 +1,16 @@ +/* Display GitHub Flavored Markdown code blocks correctly */ + +.rst-content pre { + background-color: #f5f5f5; + border-radius: 6px; + padding: 16px; + margin: 16px 0; + overflow-x: auto; +} + +.rst-content pre code { + background-color: #f5f5f5; + white-space: pre; + border: none; + padding: 0; +} diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index d7c3f7751..7104660b5 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -44,6 +44,8 @@ pygments_style = "sphinx" html_theme = "sphinx_rtd_theme" +html_static_path = ["_static"] +html_css_files = ["css/custom.css"] intersphinx_mapping = { "python": ("https://docs.python.org/3", None),