[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/14] docs/sphinx: add CSS styling for qmp-example directive
From: |
Markus Armbruster |
Subject: |
[PULL 10/14] docs/sphinx: add CSS styling for qmp-example directive |
Date: |
Wed, 17 Jul 2024 12:49:03 +0200 |
From: Harmonie Snow <harmonie@gmail.com>
Add CSS styling for qmp-example directives to increase readability and
consistently style all example blocks.
Signed-off-by: Harmonie Snow <harmonie@gmail.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240717021312.606116-6-jsnow@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
docs/sphinx-static/theme_overrides.css | 49 ++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/docs/sphinx-static/theme_overrides.css
b/docs/sphinx-static/theme_overrides.css
index c70ef95128..965ecac54f 100644
--- a/docs/sphinx-static/theme_overrides.css
+++ b/docs/sphinx-static/theme_overrides.css
@@ -87,6 +87,55 @@ div[class^="highlight"] pre {
padding-bottom: 1px;
}
+/* qmp-example directive styling */
+
+.rst-content .admonition-example {
+ /* do not apply the standard admonition background */
+ background-color: transparent;
+ border: solid #ffd2ed 1px;
+}
+
+.rst-content .admonition-example > .admonition-title:before {
+ content: "â·";
+}
+
+.rst-content .admonition-example > .admonition-title {
+ background-color: #5980a6;
+}
+
+.rst-content .admonition-example > div[class^="highlight"] {
+ /* make code boxes take up the full width of the admonition w/o margin */
+ margin-left: -12px;
+ margin-right: -12px;
+
+ border-top: 1px solid #ffd2ed;
+ border-bottom: 1px solid #ffd2ed;
+ border-left: 0px;
+ border-right: 0px;
+}
+
+.rst-content .admonition-example > div[class^="highlight"]:nth-child(2) {
+ /* If a code box is the second element in an example admonition,
+ * it is the first child after the title. let it sit flush against
+ * the title. */
+ margin-top: -12px;
+ border-top: 0px;
+}
+
+.rst-content .admonition-example > div[class^="highlight"]:last-child {
+ /* If a code box is the final element in an example admonition, don't
+ * render margin below it; let it sit flush with the end of the
+ * admonition box */
+ margin-bottom: -12px;
+ border-bottom: 0px;
+}
+
+.rst-content .admonition-example .highlight {
+ background-color: #fffafd;
+}
+
+/* end qmp-example styling */
+
@media screen {
/* content column
--
2.45.0
- [PULL 00/14] QAPI patches patches for 2024-07-17, Markus Armbruster, 2024/07/17
- [PULL 02/14] qapi/pci: Clean up documentation around PciDeviceClass, Markus Armbruster, 2024/07/17
- [PULL 04/14] qapi/machine: Clarify query-uuid value when none has been specified, Markus Armbruster, 2024/07/17
- [PULL 03/14] qapi/machine: Clean up documentation around CpuInstanceProperties, Markus Armbruster, 2024/07/17
- [PULL 12/14] qapi: convert "Example" sections with titles, Markus Armbruster, 2024/07/17
- [PULL 06/14] qapi/ui: Drop note on naming of SpiceQueryMouseMode, Markus Armbruster, 2024/07/17
- [PULL 05/14] qapi/sockets: Move deprecation note out of SocketAddress doc comment, Markus Armbruster, 2024/07/17
- [PULL 01/14] qapi/qom: Document feature unstable of @x-vfio-user-server, Markus Armbruster, 2024/07/17
- [PULL 10/14] docs/sphinx: add CSS styling for qmp-example directive,
Markus Armbruster <=
- [PULL 09/14] docs/qapidoc: add QMP highlighting to annotated qmp-example blocks, Markus Armbruster, 2024/07/17
- [PULL 14/14] qapi: remove "Example" doc section, Markus Armbruster, 2024/07/17
- [PULL 07/14] docs/qapidoc: factor out do_parse(), Markus Armbruster, 2024/07/17
- [PULL 11/14] qapi: convert "Example" sections without titles, Markus Armbruster, 2024/07/17
- [PULL 13/14] qapi: convert "Example" sections with longer prose, Markus Armbruster, 2024/07/17
- [PULL 08/14] docs/qapidoc: create qmp-example directive, Markus Armbruster, 2024/07/17
- Re: [PULL 00/14] QAPI patches patches for 2024-07-17, Richard Henderson, 2024/07/18