on master help sign in
doc: reST primer -- describe admonitions & customize their CSS

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commitb82f61f7044665b900b0d8f556cbe207f3133837 authorMarkus Heiser <markus.heiser@darmarit.de> dateFri 20 Dec 2019, 11:01 (7 years ago) parente1566e6
2 files changed+111−36
docs/_themes/searx/static/searx.css+43−32 docs/dev/reST.rst+68−4
docs/_themes/searx/static/searx.css+43−32
@@ -28,53 +28,64 @@ p.sidebar-title, .sidebar p {
2828 list-style-type: disclosure-closed;
2929}
3030
31+/* admonitions
32+*/
3133
32−div.admonition,
33−div.topic {
34+div.admonition, div.topic {
3435 background-color: #fafafa;
3536 margin: 8px 0px;
3637 padding: 1em;
37− border: none;
38+ border-radius: 3pt 0 0 3pt;
39+ border-top: none;
40+ border-right: none;
41+ border-bottom: none;
42+ border-left: 5pt solid #ccc;
43+}
44+
45+p.admonition-title:after {
46+ content: none;
47+}
48+
49+.admonition.hint { border-color: #416dc0b0; }
50+.admonition.note { border-color: #6c856cb0; }
51+.admonition.tip { border-color: #85c5c2b0; }
52+.admonition.attention { border-color: #ecec97b0; }
53+.admonition.caution { border-color: #a6c677b0; }
54+.admonition.danger { border-color: #d46262b0; }
55+.admonition.important { border-color: #dfa3a3b0; }
56+.admonition.error { border-color: red; }
57+.admonition.warning { border-color: darkred; }
58+
59+.admonition.admonition-generic-admonition-title {
60+ border-color: #416dc0b0;
3861}
3962
63+
4064/* admonitions with (rendered) reST markup examples (:class: rst-example)
4165 *
4266 * .. admonition:: title of the example
4367 * :class: rst-example
4468 * ....
45−/* navigation menu: use sans font and select light/dark colors for better
46−* contrast.
4769*/
4870
4971div.rst-example {
50− padding-left: 12px;
51− padding-right: 12px;
52− background-color: white;
53− transform: scale(0.9);
54− transition: transform 1s;
72+ padding-left: 12px;
73+ padding-right: 12px;
74+ background-color: inherit;
75+ transform: scale(0.9);
76+ transition: transform 1s;
77+ border-left: none;
5578}
5679
57−/* div.rst-example > .admonition-title { */
58−/* background-color: inherit; */
59−/* color: inherit; */
60−/* } */
61−
62−/* div.rst-example > .admonition-title:after{ */
63−/* font-family: inherit; */
64−/* font-style: italic; */
65−/* content: " // hover mouse over .."; */
66−/* } */
67−
6880@media screen {
69− div.rst-example:hover {
70− transform: scale(1);
71− background-color: inherit;
72− padding-left: inherit;
73− padding-right: inherit;
74− border-left: inherit;
75− }
76−
77− div.rst-example:hover > .admonition-title {
78− display: none;
79− }
81+ div.rst-example:hover {
82+ transform: scale(1);
83+ padding-left: inherit;
84+ padding-right: inherit;
85+ border-left: inherit;
86+ }
87+
88+ div.rst-example:hover > .admonition-title {
89+ display: none;
90+ }
8091}
docs/dev/reST.rst+68−4
@@ -16,8 +16,6 @@ generated and deployed at :docs:`github.io <.>`.
1616The sources of Searx's documentation are located at :origin:`docs`. Run
1717:ref:`make docs-live <make docs-live>` to build HTML while editing.
1818
19−------
20−
2119.. sidebar:: Further reading
2220
2321 - Sphinx-Primer_
@@ -36,8 +34,6 @@ The sources of Searx's documentation are located at :origin:`docs`. Run
3634 :local:
3735 :backlinks: entry
3836
39−------
40−
4137Sphinx_ and reST_ have their place in the python ecosystem. Over that reST is
4238used in popular projects, e.g the Linux kernel documentation `[kernel doc]`_.
4339
@@ -593,6 +589,74 @@ Further list blocks
593589- doctest blocks (:duref:`ref <doctest-blocks>`)
594590
595591
592+Admonitions
593+===========
594+
595+Admonitions: :dudir:`hint`, :dudir:`note`, :dudir:`tip` :dudir:`attention`,
596+:dudir:`caution`, :dudir:`danger`, :dudir:`error`, , :dudir:`important`, ,
597+:dudir:`warning` and the generic :dudir:`admonition <admonitions>`.
598+
599+.. code:: reST
600+
601+ .. admonition:: generic admonition title
602+
603+ lorem ipsum ..
604+
605+ .. hint::
606+
607+ lorem ipsum ..
608+
609+ .. note::
610+
611+ lorem ipsum ..
612+
613+ .. warning::
614+
615+ lorem ipsum ..
616+
617+
618+.. admonition:: generic admonition title
619+
620+ lorem ipsum ..
621+
622+.. hint::
623+
624+ lorem ipsum ..
625+
626+.. note::
627+
628+ lorem ipsum ..
629+
630+.. tip::
631+
632+ lorem ipsum ..
633+
634+.. attention::
635+
636+ lorem ipsum ..
637+
638+.. caution::
639+
640+ lorem ipsum ..
641+
642+.. danger::
643+
644+ lorem ipsum ..
645+
646+.. important::
647+
648+ lorem ipsum ..
649+
650+.. error::
651+
652+ lorem ipsum ..
653+
654+.. warning::
655+
656+ lorem ipsum ..
657+
658+
659+
596660.. _KISS: https://en.wikipedia.org/wiki/KISS_principle
597661.. _readability: https://docs.python-guide.org/writing/style/
598662.. _Sphinx-Primer: