Skip to content

Commit a459719

Browse files
committed
Add support for concatinating multi line notes and description
1 parent abad5fc commit a459719

File tree

3 files changed

+110
-105
lines changed

3 files changed

+110
-105
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- [`generate_docs`](./lazydocs.generation.md#function-generate_docs): Generates markdown documentation for provided paths based on Google-style docstrings.
1515
- [`to_md_file`](./lazydocs.generation.md#function-to_md_file): Creates an API docs file from a provided text.
1616

17+
1718
---
1819

1920
_This file was automatically generated via [lazydocs](https://github.com/ml-tooling/lazydocs)._

docs/lazydocs.generation.md

Lines changed: 73 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<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>
33

44
# <kbd>module</kbd> `lazydocs.generation`
5-
Main module for markdown generation.
5+
Main module for markdown generation.
66

77

88
---
99

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>
1111

1212
## <kbd>function</kbd> `to_md_file`
1313

@@ -20,24 +20,21 @@ to_md_file(
2020
) → None
2121
```
2222

23-
Creates an API docs file from a provided text.
23+
Creates an API docs file from a provided text.
2424

2525

26-
**Args:**
27-
28-
29-
- <b>`string`</b> (str): String with line breaks to write to file.
3026

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
3633

3734

3835
---
3936

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>
4138

4239
## <kbd>function</kbd> `generate_docs`
4340

@@ -55,41 +52,32 @@ generate_docs(
5552
) → None
5653
```
5754

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.
6756

68-
- <b>`src_root_path`</b>: The root folder name containing all the sources. Fallback to git repo root.
6957

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.
7158

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.
8170

8271

8372
---
8473

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>
8675

8776
## <kbd>class</kbd> `MarkdownGenerator`
88-
Markdown generator class.
89-
77+
Markdown generator class.
9078

9179

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>
9381

9482
### <kbd>method</kbd> `__init__`
9583

@@ -101,162 +89,154 @@ __init__(
10189
)
10290
```
10391

104-
Initializes the markdown API generator.
92+
Initializes the markdown API generator.
10593

10694

107-
**Args:**
108-
109-
110-
- <b>`src_root_path`</b>: The root folder name containing all the sources.
11195

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.
116101

117102

118103

119104
---
120105

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>
122107

123108
### <kbd>method</kbd> `class2md`
124109

125110
```python
126111
class2md(cls: Any, depth: int = 2) → str
127112
```
128113

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.
131115

132-
**Args:**
133116

134117

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.
136122

137-
- <b>`depth`</b> (int, optional): Number of # to append to function name. Defaults to 2.
138123

139124

140125
**Returns:**
141-
142-
143-
- <b>`str`</b>: Markdown documentation for selected class.
126+
127+
- <b>`str`</b>: Markdown documentation for selected class.
144128

145129
---
146130

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>
148132

149133
### <kbd>method</kbd> `doc2md`
150134

151135
```python
152136
doc2md(obj: Any) → str
153137
```
154138

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.
156140

157141

158-
**Args:**
159142

143+
**Args:**
144+
145+
- <b>`obj`</b>: Selected object for markdown generation.
160146

161-
- <b>`obj`</b>: Selected object for markdown generation.
162147

163148

164149
**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.
168152

169153
---
170154

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>
172156

173157
### <kbd>method</kbd> `func2md`
174158

175159
```python
176160
func2md(func: Callable, clsname: str = '', depth: int = 3) → str
177161
```
178162

179-
Takes a function (or method) and generates markdown docs.
180-
181-
182-
**Args:**
163+
Takes a function (or method) and generates markdown docs.
183164

184165

185-
- <b>`func`</b> (Callable): Selected function (or method) for markdown generation.
186166

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.
188172

189-
- <b>`depth`</b> (int, optional): Number of # to append to class name. Defaults to 3.
190173

191174

192175
**Returns:**
193-
194-
195-
- <b>`str`</b>: Markdown documentation for selected function.
176+
177+
- <b>`str`</b>: Markdown documentation for selected function.
196178

197179
---
198180

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>
200182

201183
### <kbd>method</kbd> `import2md`
202184

203185
```python
204186
import2md(obj: Any, depth: int = 1) → str
205187
```
206188

207-
Generates markdown documentation for a selected object/import.
208-
189+
Generates markdown documentation for a selected object/import.
209190

210-
**Args:**
211191

212192

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.
214197

215-
- <b>`depth`</b> (int, optional): Number of # to append before heading. Defaults to 1.
216198

217199

218200
**Returns:**
219-
220-
221-
- <b>`str`</b>: Markdown documentation of selected object.
201+
202+
- <b>`str`</b>: Markdown documentation of selected object.
222203

223204
---
224205

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>
226207

227208
### <kbd>method</kbd> `module2md`
228209

229210
```python
230211
module2md(module: module, depth: int = 1) → str
231212
```
232213

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.
235215

236-
**Args:**
237216

238217

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.
240222

241-
- <b>`depth`</b> (int, optional): Number of # to append before module heading. Defaults to 1.
242223

243224

244225
**Returns:**
245-
246-
247-
- <b>`str`</b>: Markdown documentation for selected module.
226+
227+
- <b>`str`</b>: Markdown documentation for selected module.
248228

249229
---
250230

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>
252232

253233
### <kbd>method</kbd> `overview2md`
254234

255235
```python
256236
overview2md() → str
257237
```
258238

259-
Generates a documentation overview file based on the generated docs.
239+
Generates a documentation overview file based on the generated docs.
260240

261241

262242

0 commit comments

Comments
 (0)