@@ -29,76 +29,41 @@ The following CSS classes are used in the generated HTML:
2929
3030//// tab | CSS
3131``` css
32- .doc-label { border-radius : 15px ; padding : 0 5 px ; }
33- .doc-label-special { background-color : blue ; color : white ; }
34- .doc-label-private { background-color : red ; color : white ; }
35- .doc-label-property { background-color : green ; color : white ; }
36- .doc-label-read-only { background-color : yellow ; color : black ; }
32+ .doc-label { border-radius : 15px ; padding : 2 px 8 px ; font-weight : bold ; }
33+ .doc-label-special { background-color : #3330E4 ; color : white ; }
34+ .doc-label-private { background-color : #F637EC ; color : white ; }
35+ .doc-label-property { background-color : #FBB454 ; color : black ; }
36+ .doc-label-read-only { background-color : #FAEA48 ; color : black ; }
3737```
3838////
3939
4040//// tab | Result
4141<style >
42- .lbl { border-radius : 15px ; padding : 0 5 px ; }
42+ .lbl { border-radius : 15px ; padding : 2 px 8 px ; font-weight : bold ; }
4343</style >
44- <h3 style =" margin : 0 ;" ><span >
45- <small class="lbl" style="background-color: blue; color: white !important;">special</small>
46- <small class="lbl" style="background-color: red; color: white !important;">private</small>
47- <small class="lbl" style="background-color: green; color: white !important;">property</small>
48- <small class="lbl" style="background-color: yellow; color: black !important;">read-only</small>
49- </span ></h3 >
44+ <h3 style =" margin : 0 ;" >
45+ <p >
46+ <small class =" lbl " style =" background-color : #3330E4 ; color : white !important ;" >special</small >
47+ <small class =" lbl " style =" background-color : #F637EC ; color : white !important ;" >private</small >
48+ <small class =" lbl " style =" background-color : #FBB454 ; color : black !important ;" >property</small >
49+ <small class =" lbl " style =" background-color : #FAEA48 ; color : black !important ;" >read-only</small >
50+ </p >
51+ </h3 >
5052////
5153
5254///
5355
54-
55- ### Recommended style (Material)
56-
57- Here are some CSS rules for the
58- [ * Material for MkDocs* ] ( https://squidfunk.github.io/mkdocs-material/ ) theme:
59-
60- ``` css
61- --8<-- "docs/css/mkdocstrings.css"
62- ```
63-
64- ### Recommended style (ReadTheDocs)
65-
66- Here are some CSS rules for the built-in * ReadTheDocs* theme:
67-
68- ```css
69- /* Indentation. */
70- div .doc-contents :not (.first ) {
71- padding-left : 25px ;
72- border-left : .05rem solid rgba (200 , 200 , 200 , 0.2 );
73- }
74- ```
75-
7656## Templates
7757
7858Templates are organized into the following tree:
7959
80- ``` tree result="text"
81- theme/
82- attribute.html
83- children.html
84- class.html
85- docstring/
86- admonition.html
87- attributes.html
88- examples.html
89- other_parameters.html
90- parameters.html
91- raises.html
92- receives.html
93- returns.html
94- warns.html
95- yields.html
96- docstring.html
97- expression.html
98- function.html
99- labels.html
100- module.html
101- signature.html
60+ ``` python exec="1" result="tree"
61+ from pathlib import Path
62+
63+ basedir = " src/mkdocstrings_handlers/python/templates/material"
64+ print (" theme/" )
65+ for filepath in sorted (path for path in Path(basedir).rglob(" *" ) if " _base" not in str (path) and path.suffix != " .css" ):
66+ print (" " * (len (filepath.relative_to(basedir).parent.parts) + 1 ) + filepath.name + (" /" if filepath.is_dir() else " " ))
10267```
10368
10469See them [ in the repository] ( https://github.com/mkdocstrings/python/tree/master/src/mkdocstrings_handlers/python/templates/ ) .
@@ -131,3 +96,29 @@ without having to fully copy-paste it into your project:
13196```
13297
13398WARNING: ** Block-level customization is not ready yet. We welcome [ suggestions] ( https://github.com/mkdocstrings/python/issues/new ) .**
99+
100+ ## Style recommendations
101+
102+ <a id =" recommended-style-material " ></a >
103+
104+ ### Material
105+
106+ Here are some CSS rules for the [ Material for MkDocs] theme:
107+
108+ ``` css
109+ --8<-- "docs/css/mkdocstrings.css"
110+ ```
111+
112+ <a id="recommended-style-readthedocs "> </a >
113+
114+ ### ReadTheDocs
115+
116+ Here are some CSS rules for the built-in ReadTheDocs theme:
117+
118+ ```css
119+ /* Indentation. */
120+ div .doc-contents :not (.first ) {
121+ padding-left : 25px ;
122+ border-left : .05rem solid rgba (200 , 200 , 200 , 0.2 );
123+ }
124+ ```
0 commit comments