@@ -211,16 +211,17 @@ def to_md_file(
211
211
Args:
212
212
markdown_str (str): Markdown string with line breaks to write to file.
213
213
filename (str): Filename without the .md
214
+ out_path (str): The output directory.
214
215
watermark (bool): If `True`, add a watermark with a timestamp to bottom of the markdown files.
215
216
disable_markdownlint (bool): If `True`, an inline tag is added to disable markdownlint for this file.
216
- out_path (str ): The output directory
217
+ is_mdx (bool, optional ): JSX support. Default to False.
217
218
"""
218
219
if not markdown_str :
219
220
# Dont write empty files
220
221
return
221
222
222
223
md_file = filename
223
-
224
+
224
225
if is_mdx :
225
226
if not filename .endswith (".mdx" ):
226
227
md_file = filename + ".mdx"
@@ -538,6 +539,7 @@ def func2md(self, func: Callable, clsname: str = "", depth: int = 3, is_mdx: boo
538
539
func (Callable): Selected function (or method) for markdown generation.
539
540
clsname (str, optional): Class name to prepend to funcname. Defaults to "".
540
541
depth (int, optional): Number of # to append to class name. Defaults to 3.
542
+ is_mdx (bool, optional): JSX support. Default to False.
541
543
542
544
Returns:
543
545
str: Markdown documentation for selected function.
@@ -614,7 +616,7 @@ def func2md(self, func: Callable, clsname: str = "", depth: int = 3, is_mdx: boo
614
616
if path :
615
617
if is_mdx :
616
618
markdown = _MDX_SOURCE_BADGE_TEMPLATE .format (path = path ) + markdown
617
- else :
619
+ else :
618
620
markdown = _SOURCE_BADGE_TEMPLATE .format (path = path ) + markdown
619
621
620
622
return markdown
@@ -625,6 +627,7 @@ def class2md(self, cls: Any, depth: int = 2, is_mdx: bool = False) -> str:
625
627
Args:
626
628
cls (class): Selected class for markdown generation.
627
629
depth (int, optional): Number of # to append to function name. Defaults to 2.
630
+ is_mdx (bool, optional): JSX support. Default to False.
628
631
629
632
Returns:
630
633
str: Markdown documentation for selected class.
@@ -739,6 +742,7 @@ def module2md(self, module: types.ModuleType, depth: int = 1, is_mdx: bool = Fal
739
742
Args:
740
743
module (types.ModuleType): Selected module for markdown generation.
741
744
depth (int, optional): Number of # to append before module heading. Defaults to 1.
745
+ is_mdx (bool, optional): JSX support. Default to False.
742
746
743
747
Returns:
744
748
str: Markdown documentation for selected module.
@@ -837,6 +841,7 @@ def import2md(self, obj: Any, depth: int = 1, is_mdx: bool = False) -> str:
837
841
Args:
838
842
obj (Any): Selcted object for markdown docs generation.
839
843
depth (int, optional): Number of # to append before heading. Defaults to 1.
844
+ is_mdx (bool, optional): JSX support. Default to False.
840
845
841
846
Returns:
842
847
str: Markdown documentation of selected object.
@@ -852,7 +857,14 @@ def import2md(self, obj: Any, depth: int = 1, is_mdx: bool = False) -> str:
852
857
return ""
853
858
854
859
def overview2md (self , is_mdx : bool = False ) -> str :
855
- """Generates a documentation overview file based on the generated docs."""
860
+ """Generates a documentation overview file based on the generated docs.
861
+
862
+ Args:
863
+ is_mdx (bool, optional): JSX support. Default to False.
864
+
865
+ Returns:
866
+ str: Markdown documentation of overview file.
867
+ """
856
868
857
869
entries_md = ""
858
870
for obj in list (
@@ -935,6 +947,7 @@ def generate_docs(
935
947
src_base_url: The base url of the github link. Should include branch name. All source links are generated with this prefix.
936
948
remove_package_prefix: If `True`, the package prefix will be removed from all functions and methods.
937
949
ignored_modules: A list of modules that should be ignored.
950
+ output_format: Markdown file extension and format.
938
951
overview_file: Filename of overview file. If not provided, no overview file will be generated.
939
952
watermark: If `True`, add a watermark with a timestamp to bottom of the markdown files.
940
953
validate: If `True`, validate the docstrings via pydocstyle. Requires pydocstyle to be installed.
0 commit comments