Main module for markdown generation.
to_md_file(
markdown_str: str,
filename: str,
out_path: str = '.',
watermark: bool = True,
disable_markdownlint: bool = True
) → None
Creates an API docs file from a provided text.
Args:
markdown_str
(str): Markdown string with line breaks to write to file.filename
(str): Filename without the .mdwatermark
(bool): IfTrue
, add a watermark with a timestamp to bottom of the markdown files.disable_markdownlint
(bool): IfTrue
, an inline tag is added to disable markdownlint for this file.out_path
(str): The output directory
generate_docs(
paths: List[str],
output_path: str = './docs',
src_root_path: Optional[str] = None,
src_base_url: Optional[str] = None,
remove_package_prefix: bool = False,
ignored_modules: Optional[List[str]] = None,
overview_file: Optional[str] = None,
watermark: bool = True,
validate: bool = False
) → None
Generates markdown documentation for provided paths based on Google-style docstrings.
Args:
paths
: Selected paths or import name for markdown generation.output_path
: The output path for the creation of the markdown files. Set this tostdout
to print all markdown to stdout.src_root_path
: The root folder name containing all the sources. Fallback to git repo root.src_base_url
: The base url of the github link. Should include branch name. All source links are generated with this prefix.remove_package_prefix
: IfTrue
, the package prefix will be removed from all functions and methods.ignored_modules
: A list of modules that should be ignored.overview_file
: Filename of overview file. If not provided, no overview file will be generated.watermark
: IfTrue
, add a watermark with a timestamp to bottom of the markdown files.validate
: IfTrue
, validate the docstrings via pydocstyle. Requires pydocstyle to be installed.
Markdown generator class.
__init__(
src_root_path: Optional[str] = None,
src_base_url: Optional[str] = None,
remove_package_prefix: bool = False
)
Initializes the markdown API generator.
Args:
src_root_path
: The root folder name containing all the sources.src_base_url
: The base github link. Should include branch name. All source links are generated with this prefix.remove_package_prefix
: IfTrue
, the package prefix will be removed from all functions and methods.
class2md(cls: Any, depth: int = 2) → str
Takes a class and creates markdown text to document its methods and variables.
Args:
cls
(class): Selected class for markdown generation.depth
(int, optional): Number of # to append to function name. Defaults to 2.
Returns:
str
: Markdown documentation for selected class.
func2md(func: Callable, clsname: str = '', depth: int = 3) → str
Takes a function (or method) and generates markdown docs.
Args:
func
(Callable): Selected function (or method) for markdown generation.clsname
(str, optional): Class name to prepend to funcname. Defaults to "".depth
(int, optional): Number of # to append to class name. Defaults to 3.
Returns:
str
: Markdown documentation for selected function.
import2md(obj: Any, depth: int = 1) → str
Generates markdown documentation for a selected object/import.
Args:
obj
(Any): Selcted object for markdown docs generation.depth
(int, optional): Number of # to append before heading. Defaults to 1.
Returns:
str
: Markdown documentation of selected object.
module2md(module: module, depth: int = 1) → str
Takes an imported module object and create a Markdown string containing functions and classes.
Args:
module
(types.ModuleType): Selected module for markdown generation.depth
(int, optional): Number of # to append before module heading. Defaults to 1.
Returns:
str
: Markdown documentation for selected module.
overview2md() → str
Generates a documentation overview file based on the generated docs.
This file was automatically generated via lazydocs.