Usage¶
sphinx-highlights
provides a single directive:
-
.. api-highlights::
¶ Shows 4 random highlights of the library.
The objects to include in the highlights are given in the body of the directive. For example:
.. api-highlights:: domdf_python_tools.stringlist.StringList domdf_python_tools.testing.check_file_regression domdf_python_tools.paths.PathPlus domdf_python_tools.iterative.groupfloats
More than four objects can be listed. A random selection of those will be chosen when the documentation is built.
-
:module:
(string)¶ The parent module of all of these objects.
Allows the module name to be replaced with a dot (
.
). For example:.. api-highlights:: :module: domdf_python_tools .stringlist.StringList
-
:colours:
(Comma- or space-separated list of strings.)¶ - The colours to use for the panel headers. Choose from “blue”, “green”, “red”, or “orange”.Default “blue”.
Changed in version 0.2.0: If more than four colours are provided four will be chosen at random.
-
:classes:
(Comma- or space-separated list of strings.)¶ - The classes to use for the panels.Default
col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12 p-2
.
-
Customising the colours¶
By default the only colours available are:
|
|
|
|
Additional colours can be created by adding your own custom CSS to Sphinx:
div.sphinx-highlights div.highlight-purple div.card-header {
background-color: #B452CD;
}
where purple
is the name of the colour to use in the colours
option.
|
See also
https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html for more information on adding custom CSS.