2
2
<a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L0 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
3
3
4
4
# <kbd >module</kbd > ` lazydocs.generation `
5
- Main module for markdown generation.
5
+ Main module for markdown generation.
6
6
7
7
8
8
---
9
9
10
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L172 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
10
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L177 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
11
11
12
12
## <kbd >function</kbd > ` to_md_file `
13
13
@@ -20,24 +20,21 @@ to_md_file(
20
20
) → None
21
21
```
22
22
23
- Creates an API docs file from a provided text.
23
+ Creates an API docs file from a provided text.
24
24
25
25
26
- ** Args:**
27
-
28
-
29
- - <b >` string ` </b > (str): String with line breaks to write to file.
30
26
31
- - <b >` filename ` </b > (str): Filename without the .md
32
-
33
- - <b >` watermark ` </b > (bool): If ` True ` , add a watermark with a timestamp to bottom of the markdown files.
34
-
35
- - <b >` out_path ` </b > (str): The output directory
27
+ ** Args:**
28
+
29
+ - <b >` string ` </b > (str): String with line breaks to write to file.
30
+ - <b >` filename ` </b > (str): Filename without the .md
31
+ - <b >` watermark ` </b > (bool): If ` True ` , add a watermark with a timestamp to bottom of the markdown files.
32
+ - <b >` out_path ` </b > (str): The output directory
36
33
37
34
38
35
---
39
36
40
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L757 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
37
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L788 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
41
38
42
39
## <kbd >function</kbd > ` generate_docs `
43
40
@@ -55,41 +52,32 @@ generate_docs(
55
52
) → None
56
53
```
57
54
58
- Generates markdown documentation for provided paths based on Google-style docstrings.
59
-
60
-
61
- ** Args:**
62
-
63
-
64
- - <b >` paths ` </b >: Selected paths or import name for markdown generation.
65
-
66
- - <b >` output_path ` </b >: The output path for the creation of the markdown files. Set this to ` stdout ` to print all markdown to stdout.
55
+ Generates markdown documentation for provided paths based on Google-style docstrings.
67
56
68
- - <b >` src_root_path ` </b >: The root folder name containing all the sources. Fallback to git repo root.
69
57
70
- - <b >` src_base_url ` </b >: The base url of the github link. Should include branch name. All source links are generated with this prefix.
71
58
72
- - <b >` remove_package_prefix ` </b >: If ` True ` , the package prefix will be removed from all functions and methods.
73
-
74
- - <b >` ignored_modules ` </b >: A list of modules that should be ignored.
75
-
76
- - <b >` overview_file ` </b >: Filename of overview file. If not provided, no overview file will be generated.
77
-
78
- - <b >` watermark ` </b >: If ` True ` , add a watermark with a timestamp to bottom of the markdown files.
79
-
80
- - <b >` validate ` </b >: If ` True ` , validate the docstrings via pydocstyle. Requires pydocstyle to be installed.
59
+ ** Args:**
60
+
61
+ - <b >` paths ` </b >: Selected paths or import name for markdown generation.
62
+ - <b >` output_path ` </b >: The output path for the creation of the markdown files. Set this to ` stdout ` to print all markdown to stdout.
63
+ - <b >` src_root_path ` </b >: The root folder name containing all the sources. Fallback to git repo root.
64
+ - <b >` src_base_url ` </b >: The base url of the github link. Should include branch name. All source links are generated with this prefix.
65
+ - <b >` remove_package_prefix ` </b >: If ` True ` , the package prefix will be removed from all functions and methods.
66
+ - <b >` ignored_modules ` </b >: A list of modules that should be ignored.
67
+ - <b >` overview_file ` </b >: Filename of overview file. If not provided, no overview file will be generated.
68
+ - <b >` watermark ` </b >: If ` True ` , add a watermark with a timestamp to bottom of the markdown files.
69
+ - <b >` validate ` </b >: If ` True ` , validate the docstrings via pydocstyle. Requires pydocstyle to be installed.
81
70
82
71
83
72
---
84
73
85
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L247 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
74
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L252 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
86
75
87
76
## <kbd >class</kbd > ` MarkdownGenerator `
88
- Markdown generator class.
89
-
77
+ Markdown generator class.
90
78
91
79
92
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L250 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
80
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L255 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
93
81
94
82
### <kbd >method</kbd > ` __init__ `
95
83
@@ -101,162 +89,154 @@ __init__(
101
89
)
102
90
```
103
91
104
- Initializes the markdown API generator.
92
+ Initializes the markdown API generator.
105
93
106
94
107
- ** Args:**
108
-
109
-
110
- - <b >` src_root_path ` </b >: The root folder name containing all the sources.
111
95
112
- - <b >` src_base_url ` </b >: The base github link. Should include branch name.
113
- All source links are generated with this prefix.
114
-
115
- - <b >` remove_package_prefix ` </b >: If ` True ` , the package prefix will be removed from all functions and methods.
96
+ ** Args:**
97
+
98
+ - <b >` src_root_path ` </b >: The root folder name containing all the sources.
99
+ - <b >` src_base_url ` </b >: The base github link. Should include branch name. All source links are generated with this prefix.
100
+ - <b >` remove_package_prefix ` </b >: If ` True ` , the package prefix will be removed from all functions and methods.
116
101
117
102
118
103
119
104
---
120
105
121
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L516 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
106
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L540 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
122
107
123
108
### <kbd >method</kbd > ` class2md `
124
109
125
110
``` python
126
111
class2md(cls : Any, depth: int = 2 ) → str
127
112
```
128
113
129
- Takes a class and creates markdown text to document its methods and variables.
130
-
114
+ Takes a class and creates markdown text to document its methods and variables.
131
115
132
- ** Args:**
133
116
134
117
135
- - <b >` cls ` </b > (class): Selected class for markdown generation.
118
+ ** Args:**
119
+
120
+ - <b >` cls ` </b > (class): Selected class for markdown generation.
121
+ - <b >` depth ` </b > (int, optional): Number of # to append to function name. Defaults to 2.
136
122
137
- - <b >` depth ` </b > (int, optional): Number of # to append to function name. Defaults to 2.
138
123
139
124
140
125
** Returns:**
141
-
142
-
143
- - <b >` str ` </b >: Markdown documentation for selected class.
126
+
127
+ - <b >` str ` </b >: Markdown documentation for selected class.
144
128
145
129
---
146
130
147
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L339 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
131
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L344 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
148
132
149
133
### <kbd >method</kbd > ` doc2md `
150
134
151
135
``` python
152
136
doc2md(obj: Any) → str
153
137
```
154
138
155
- Parse docstring (with getdoc) according to Google-style formatting and convert to markdown.
139
+ Parse docstring (with getdoc) according to Google-style formatting and convert to markdown.
156
140
157
141
158
- ** Args:**
159
142
143
+ ** Args:**
144
+
145
+ - <b >` obj ` </b >: Selected object for markdown generation.
160
146
161
- - <b >` obj ` </b >: Selected object for markdown generation.
162
147
163
148
164
149
** Returns:**
165
-
166
-
167
- - <b >` str ` </b >: Markdown documentation for docstring of selected object.
150
+
151
+ - <b >` str ` </b >: Markdown documentation for docstring of selected object.
168
152
169
153
---
170
154
171
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L434 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
155
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L458 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
172
156
173
157
### <kbd >method</kbd > ` func2md `
174
158
175
159
``` python
176
160
func2md(func: Callable, clsname: str = ' ' , depth: int = 3 ) → str
177
161
```
178
162
179
- Takes a function (or method) and generates markdown docs.
180
-
181
-
182
- ** Args:**
163
+ Takes a function (or method) and generates markdown docs.
183
164
184
165
185
- - <b >` func ` </b > (Callable): Selected function (or method) for markdown generation.
186
166
187
- - <b >` clsname ` </b > (str, optional): Class name to prepend to funcname. Defaults to "".
167
+ ** Args:**
168
+
169
+ - <b >` func ` </b > (Callable): Selected function (or method) for markdown generation.
170
+ - <b >` clsname ` </b > (str, optional): Class name to prepend to funcname. Defaults to "".
171
+ - <b >` depth ` </b > (int, optional): Number of # to append to class name. Defaults to 3.
188
172
189
- - <b >` depth ` </b > (int, optional): Number of # to append to class name. Defaults to 3.
190
173
191
174
192
175
** Returns:**
193
-
194
-
195
- - <b >` str ` </b >: Markdown documentation for selected function.
176
+
177
+ - <b >` str ` </b >: Markdown documentation for selected function.
196
178
197
179
---
198
180
199
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L690 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
181
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L721 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
200
182
201
183
### <kbd >method</kbd > ` import2md `
202
184
203
185
``` python
204
186
import2md(obj: Any, depth: int = 1 ) → str
205
187
```
206
188
207
- Generates markdown documentation for a selected object/import.
208
-
189
+ Generates markdown documentation for a selected object/import.
209
190
210
- ** Args:**
211
191
212
192
213
- - <b >` obj ` </b > (Any): Selcted object for markdown docs generation.
193
+ ** Args:**
194
+
195
+ - <b >` obj ` </b > (Any): Selcted object for markdown docs generation.
196
+ - <b >` depth ` </b > (int, optional): Number of # to append before heading. Defaults to 1.
214
197
215
- - <b >` depth ` </b > (int, optional): Number of # to append before heading. Defaults to 1.
216
198
217
199
218
200
** Returns:**
219
-
220
-
221
- - <b >` str ` </b >: Markdown documentation of selected object.
201
+
202
+ - <b >` str ` </b >: Markdown documentation of selected object.
222
203
223
204
---
224
205
225
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L603 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
206
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L634 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
226
207
227
208
### <kbd >method</kbd > ` module2md `
228
209
229
210
``` python
230
211
module2md(module: module, depth: int = 1 ) → str
231
212
```
232
213
233
- Takes an imported module object and create a Markdown string containing functions and classes.
234
-
214
+ Takes an imported module object and create a Markdown string containing functions and classes.
235
215
236
- ** Args:**
237
216
238
217
239
- - <b >` module ` </b > (types.ModuleType): Selected module for markdown generation.
218
+ ** Args:**
219
+
220
+ - <b >` module ` </b > (types.ModuleType): Selected module for markdown generation.
221
+ - <b >` depth ` </b > (int, optional): Number of # to append before module heading. Defaults to 1.
240
222
241
- - <b >` depth ` </b > (int, optional): Number of # to append before module heading. Defaults to 1.
242
223
243
224
244
225
** Returns:**
245
-
246
-
247
- - <b >` str ` </b >: Markdown documentation for selected module.
226
+
227
+ - <b >` str ` </b >: Markdown documentation for selected module.
248
228
249
229
---
250
230
251
- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L710 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
231
+ <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L741 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " ></a >
252
232
253
233
### <kbd >method</kbd > ` overview2md `
254
234
255
235
``` python
256
236
overview2md() → str
257
237
```
258
238
259
- Generates a documentation overview file based on the generated docs.
239
+ Generates a documentation overview file based on the generated docs.
260
240
261
241
262
242
0 commit comments