11<!-- markdownlint-disable -->
22
3- <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+ <a href =" .. /src/lazydocs/generation.py#L0" ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
44
55# <kbd >module</kbd > ` lazydocs.generation `
6- Main module for markdown generation.
6+ Main module for markdown generation.
7+
8+
9+ ## Table of Contents
10+ - [ ` MarkdownGenerator ` ] ( ./lazydocs.generation.md#class-markdowngenerator )
11+ - [`__init__`](./lazydocs.generation.md#constructor-__init__)
12+ - [`class2md`](./lazydocs.generation.md#method-class2md)
13+ - [`func2md`](./lazydocs.generation.md#method-func2md)
14+ - [`import2md`](./lazydocs.generation.md#method-import2md)
15+ - [`module2md`](./lazydocs.generation.md#method-module2md)
16+ - [`overview2md`](./lazydocs.generation.md#method-overview2md)
17+ - [`toc2md`](./lazydocs.generation.md#method-toc2md)
18+ - [ ` generate_docs ` ] ( ./lazydocs.generation.md#function-generate_docs )
19+ - [ ` to_md_file ` ] ( ./lazydocs.generation.md#function-to_md_file )
20+
721
822
923---
1024
11- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/ src/lazydocs/generation.py#L197 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
25+ <a href =" ../ src/lazydocs/generation.py#L223 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
1226
1327## <kbd >function</kbd > ` to_md_file `
1428
@@ -18,26 +32,28 @@ to_md_file(
1832 filename: str ,
1933 out_path: str = ' .' ,
2034 watermark: bool = True ,
21- disable_markdownlint: bool = True
35+ disable_markdownlint: bool = True ,
36+ is_mdx: bool = False
2237) → None
2338```
2439
25- Creates an API docs file from a provided text.
26-
40+ Creates an API docs file from a provided text.
2741
2842
2943** Args:**
30-
31- - <b >` markdown_str ` </b > (str): Markdown string with line breaks to write to file.
32- - <b >` filename ` </b > (str): Filename without the .md
33- - <b >` watermark ` </b > (bool): If ` True ` , add a watermark with a timestamp to bottom of the markdown files.
34- - <b >` disable_markdownlint ` </b > (bool): If ` True ` , an inline tag is added to disable markdownlint for this file.
35- - <b >` out_path ` </b > (str): The output directory
44+
45+ - <b >` markdown_str ` </b > (str): Markdown string with line breaks to write to file.
46+ - <b >` filename ` </b > (str): Filename without the .md
47+ - <b >` out_path ` </b > (str): The output directory.
48+ - <b >` watermark ` </b > (bool): If ` True ` , add a watermark with a timestamp to bottom of the markdown files.
49+ - <b >` disable_markdownlint ` </b > (bool): If ` True ` , an inline tag is added to disable markdownlint for this file.
50+ - <b >` is_mdx ` </b > (bool, optional): JSX support. Default to False.
51+
3652
3753
3854---
3955
40- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/ src/lazydocs/generation.py#L889 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
56+ <a href =" ../ src/lazydocs/generation.py#L1158 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
4157
4258## <kbd >function</kbd > ` generate_docs `
4359
@@ -49,173 +65,225 @@ generate_docs(
4965 src_base_url: Optional[str ] = None ,
5066 remove_package_prefix: bool = False ,
5167 ignored_modules: Optional[List[str ]] = None ,
68+ output_format: Optional[str ] = None ,
5269 overview_file: Optional[str ] = None ,
5370 watermark: bool = True ,
54- validate: bool = False
71+ validate: bool = False ,
72+ private_modules: bool = False ,
73+ include_toc: bool = False ,
74+ url_line_prefix: Optional[str ] = None
5575) → None
5676```
5777
58- Generates markdown documentation for provided paths based on Google-style docstrings.
59-
78+ Generates markdown documentation for provided paths based on Google-style docstrings.
6079
6180
6281** Args:**
63-
64- - <b >` paths ` </b >: Selected paths or import name for markdown generation.
65- - <b >` output_path ` </b >: The output path for the creation of the markdown files. Set this to ` stdout ` to print all markdown to stdout.
66- - <b >` src_root_path ` </b >: The root folder name containing all the sources. Fallback to git repo root.
67- - <b >` src_base_url ` </b >: The base url of the github link. Should include branch name. All source links are generated with this prefix.
68- - <b >` remove_package_prefix ` </b >: If ` True ` , the package prefix will be removed from all functions and methods.
69- - <b >` ignored_modules ` </b >: A list of modules that should be ignored.
70- - <b >` overview_file ` </b >: Filename of overview file. If not provided, no overview file will be generated.
71- - <b >` watermark ` </b >: If ` True ` , add a watermark with a timestamp to bottom of the markdown files.
72- - <b >` validate ` </b >: If ` True ` , validate the docstrings via pydocstyle. Requires pydocstyle to be installed.
82+
83+ - <b >` paths ` </b >: Selected paths or import name for markdown generation.
84+ - <b >` output_path ` </b >: The output path for the creation of the markdown files. Set this to ` stdout ` to print all markdown to stdout.
85+ - <b >` src_root_path ` </b >: The root folder name containing all the sources. Fallback to git repo root.
86+ - <b >` src_base_url ` </b >: The base url of the github link. Should include branch name. All source links are generated with this prefix.
87+ - <b >` remove_package_prefix ` </b >: If ` True ` , the package prefix will be removed from all functions and methods.
88+ - <b >` ignored_modules ` </b >: A list of modules that should be ignored.
89+ - <b >` output_format ` </b >: Markdown file extension and format.
90+ - <b >` overview_file ` </b >: Filename of overview file. If not provided, no overview file will be generated.
91+ - <b >` watermark ` </b >: If ` True ` , add a watermark with a timestamp to bottom of the markdown files.
92+ - <b >` validate ` </b >: If ` True ` , validate the docstrings via pydocstyle. Requires pydocstyle to be installed.
93+ - <b >` private_modules ` </b >: If ` True ` , includes modules with ` _ ` prefix.
94+ - <b >` url_line_prefix: Line prefix for git repository line url anchors. Default ` </b >: None - github "L".
95+
7396
7497
7598---
7699
77- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/ src/lazydocs/generation.py#L454 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
100+ <a href =" ../ src/lazydocs/generation.py#L627 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
78101
79102## <kbd >class</kbd > ` MarkdownGenerator `
80- Markdown generator class.
103+ Markdown generator class.
81104
82- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/src/lazydocs/generation.py#L457 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
83105
84- ### <kbd >method</kbd > ` __init__ `
106+ <a href =" ../src/lazydocs/generation.py#L630 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
107+
108+ ### <kbd >constructor</kbd > ` __init__ `
85109
86110``` python
87- __init__ (
111+ MarkdownGenerator (
88112 src_root_path: Optional[str ] = None ,
89113 src_base_url: Optional[str ] = None ,
90- remove_package_prefix: bool = False
114+ remove_package_prefix: bool = False ,
115+ url_line_prefix: Optional[str ] = None
91116)
92117```
93118
94- Initializes the markdown API generator.
95-
119+ Initializes the markdown API generator.
96120
97121
98122** Args:**
99-
100- - <b >` src_root_path ` </b >: The root folder name containing all the sources.
101- - <b >` src_base_url ` </b >: The base github link. Should include branch name. All source links are generated with this prefix.
102- - <b >` remove_package_prefix ` </b >: If ` True ` , the package prefix will be removed from all functions and methods.
123+
124+ - <b >` src_root_path ` </b >: The root folder name containing all the sources.
125+ - <b >` src_base_url ` </b >: The base github link. Should include branch name.
126+ All source links are generated with this prefix.
127+ - <b >` remove_package_prefix ` </b >: If ` True ` , the package prefix will be removed from all functions and methods.
128+ - <b >` url_line_prefix: Line prefix for git repository line url anchors. Default ` </b >: None - github "L".
129+
103130
104131
105132
106133
107134---
108135
109- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/ src/lazydocs/generation.py#L609 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
136+ <a href =" ../ src/lazydocs/generation.py#L795 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
110137
111138### <kbd >method</kbd > ` class2md `
112139
113140``` python
114- class2md(cls : Any, depth: int = 2 ) → str
141+ class2md(cls : Any, depth: int = 2 , is_mdx: bool = False ) → str
115142```
116143
117- Takes a class and creates markdown text to document its methods and variables.
118-
144+ Takes a class and creates markdown text to document its methods and variables.
119145
120146
121147** Args:**
122-
123- - <b >` cls ` </b > (class): Selected class for markdown generation.
124- - <b >` depth ` </b > (int, optional): Number of # to append to function name. Defaults to 2.
125148
149+ - <b >` cls ` </b > (class): Selected class for markdown generation.
150+ - <b >` depth ` </b > (int, optional): Number of # to append to function name. Defaults to 2.
151+ - <b >` is_mdx ` </b > (bool, optional): JSX support. Default to False.
126152
127153
128154** Returns:**
129-
130- - <b >` str ` </b >: Markdown documentation for selected class.
155+
156+ - <b >` str ` </b >: Markdown documentation for selected class.
157+
131158
132159---
133160
134- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/ src/lazydocs/generation.py#L524 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
161+ <a href =" ../ src/lazydocs/generation.py#L706 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
135162
136163### <kbd >method</kbd > ` func2md `
137164
138165``` python
139- func2md(func: Callable, clsname: str = ' ' , depth: int = 3 ) → str
166+ func2md(
167+ func: Callable,
168+ clsname: str = ' ' ,
169+ depth: int = 3 ,
170+ is_mdx: bool = False
171+ ) → str
140172```
141173
142- Takes a function (or method) and generates markdown docs.
143-
174+ Takes a function (or method) and generates markdown docs.
144175
145176
146177** Args:**
147-
148- - <b >` func ` </b > (Callable): Selected function (or method) for markdown generation.
149- - <b >` clsname ` </b > (str, optional): Class name to prepend to funcname. Defaults to "".
150- - <b >` depth ` </b > (int, optional): Number of # to append to class name. Defaults to 3.
151178
179+ - <b >` func ` </b > (Callable): Selected function (or method) for markdown generation.
180+ - <b >` clsname ` </b > (str, optional): Class name to prepend to funcname. Defaults to "".
181+ - <b >` depth ` </b > (int, optional): Number of # to append to class name. Defaults to 3.
182+ - <b >` is_mdx ` </b > (bool, optional): JSX support. Default to False.
152183
153184
154185** Returns:**
155-
156- - <b >` str ` </b >: Markdown documentation for selected function.
186+
187+ - <b >` str ` </b >: Markdown documentation for selected function.
188+
157189
158190---
159191
160- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/ src/lazydocs/generation.py#L815 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
192+ <a href =" ../ src/lazydocs/generation.py#L1046 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
161193
162194### <kbd >method</kbd > ` import2md `
163195
164196``` python
165- import2md(obj: Any, depth: int = 1 ) → str
197+ import2md(
198+ obj: Any,
199+ depth: int = 1 ,
200+ is_mdx: bool = False ,
201+ include_toc: bool = False
202+ ) → str
166203```
167204
168- Generates markdown documentation for a selected object/import.
169-
205+ Generates markdown documentation for a selected object/import.
170206
171207
172208** Args:**
173-
174- - <b >` obj ` </b > (Any): Selcted object for markdown docs generation.
175- - <b >` depth ` </b > (int, optional): Number of # to append before heading. Defaults to 1.
176209
210+ - <b >` obj ` </b > (Any): Selcted object for markdown docs generation.
211+ - <b >` depth ` </b > (int, optional): Number of # to append before heading. Defaults to 1.
212+ - <b >` is_mdx ` </b > (bool, optional): JSX support. Default to False.
213+ - <b >` include_toc ` </b > (bool, Optional): Include table of contents for module file. Defaults to False.
177214
178215
179216** Returns:**
180-
181- - <b >` str ` </b >: Markdown documentation of selected object.
217+
218+ - <b >` str ` </b >: Markdown documentation of selected object.
219+
182220
183221---
184222
185- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/ src/lazydocs/generation.py#L720 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
223+ <a href =" ../ src/lazydocs/generation.py#L943 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
186224
187225### <kbd >method</kbd > ` module2md `
188226
189227``` python
190- module2md(module: module, depth: int = 1 ) → str
228+ module2md(
229+ module: module,
230+ depth: int = 1 ,
231+ is_mdx: bool = False ,
232+ include_toc: bool = False
233+ ) → str
191234```
192235
193- Takes an imported module object and create a Markdown string containing functions and classes.
194-
236+ Takes an imported module object and create a Markdown string containing functions and classes.
195237
196238
197239** Args:**
198-
199- - <b >` module ` </b > (types.ModuleType): Selected module for markdown generation.
200- - <b >` depth ` </b > (int, optional): Number of # to append before module heading. Defaults to 1.
201240
241+ - <b >` module ` </b > (types.ModuleType): Selected module for markdown generation.
242+ - <b >` depth ` </b > (int, optional): Number of # to append before module heading. Defaults to 1.
243+ - <b >` is_mdx ` </b > (bool, optional): JSX support. Default to False.
244+ - <b >` include_toc ` </b > (bool, optional): Include table of contents in module file. Defaults to False.
202245
203246
204247** Returns:**
205-
206- - <b >` str ` </b >: Markdown documentation for selected module.
248+
249+ - <b >` str ` </b >: Markdown documentation for selected module.
250+
207251
208252---
209253
210- <a href =" https://github.com/ml-tooling/lazydocs/blob/main/ src/lazydocs/generation.py#L835 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
254+ <a href =" ../ src/lazydocs/generation.py#L1068 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
211255
212256### <kbd >method</kbd > ` overview2md `
213257
214258``` python
215- overview2md() → str
259+ overview2md(is_mdx: bool = False ) → str
260+ ```
261+
262+ Generates a documentation overview file based on the generated docs.
263+
264+
265+ ** Args:**
266+
267+ - <b >` is_mdx ` </b > (bool, optional): JSX support. Default to False.
268+
269+
270+ ** Returns:**
271+
272+ - <b >` str ` </b >: Markdown documentation of overview file.
273+
274+
275+ ---
276+
277+ <a href =" ../src/lazydocs/generation.py#L1137 " ><img align =" right " style =" float :right ;" src =" https://img.shields.io/badge/-source-cccccc?style=flat-square " /></a >
278+
279+ ### <kbd >method</kbd > ` toc2md `
280+
281+ ``` python
282+ toc2md(module: module = None , is_mdx: bool = False ) → str
216283```
217284
218- Generates a documentation overview file based on the generated docs.
285+ Generates table of contents for imported object.
286+
219287
220288
221289
0 commit comments