@@ -29,76 +29,41 @@ The following CSS classes are used in the generated HTML:
29
29
30
30
//// tab | CSS
31
31
``` 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 ; }
37
37
```
38
38
////
39
39
40
40
//// tab | Result
41
41
<style >
42
- .lbl { border-radius : 15px ; padding : 0 5 px ; }
42
+ .lbl { border-radius : 15px ; padding : 2 px 8 px ; font-weight : bold ; }
43
43
</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 >
50
52
////
51
53
52
54
///
53
55
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 <
10000
span class="pl-c1">solid rgba (200 , 200 , 200 , 0.2 );
73
- }
74
- ```
75
-
76
56
## Templates
77
57
78
58
Templates are organized into the following tree:
79
59
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 " " ))
102
67
```
103
68
104
69
See 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:
131
96
```
132
97
133
98
WARNING: ** 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