You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lazydocs makes it easy to generate beautiful markdown documentation for your Python API. It provides a simple command-line interface as well as a Python API to get full-fledged API documentation within seconds based on all of the [Google-style docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) in your code. This markdown documentation can be pushed to Github or integrated into your MkDocs site.
27
+
Lazydocs makes it easy to generate beautiful markdown documentation for your Python API (see this [example](./docs)). It provides a simple command-line interface as well as a Python API to get full-fledged API documentation within seconds based on all of the [Google-style docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) in your code. This markdown documentation can be pushed to Github or integrated into your MkDocs site.
29
28
30
29
## Highlights
31
30
@@ -35,12 +34,32 @@ Lazydocs makes it easy to generate beautiful markdown documentation for your Pyt
35
34
36
35
## Getting Started
37
36
38
-
_This section should contain the simplest and most basic way to run and use the project, preferably with one command._
37
+
### Installation
38
+
39
+
> _Requirements: Python 3.6+._
40
+
41
+
To install lazydocs, simply execute:
42
+
43
+
```bash
44
+
pip install lazydocs
45
+
```
46
+
47
+
### Usage
48
+
49
+
To generate Markdown-based API documentation for your Python project, simply execute:
39
50
40
51
```bash
41
-
lazydocs generate <path/to/package/or/module>
52
+
lazydocs path/to/your/package
42
53
```
43
54
55
+
The path can be either a python package (folder) or a specific script. You can also specify one or multiple module, classe or function imports:
56
+
57
+
```bash
58
+
lazydocs my_package.AwesomeClass
59
+
```
60
+
61
+
With the default configuration, the Markdown documentation will be generated inside a `./docs` in your working directory. You can find additional configuration options in the documentation section.
62
+
44
63
## Support & Feedback
45
64
46
65
This project is maintained by [Benjamin Räthlein](https://twitter.com/raethlein), [Lukas Masuch](https://twitter.com/LukasMasuch), and [Jan Kalkan](https://www.linkedin.com/in/jan-kalkan-b5390284/). Please understand that we won't be able to provide individual support via email. We also believe that help is much more valuable if it's shared publicly so that more people can benefit from it.
@@ -55,11 +74,76 @@ This project is maintained by [Benjamin Räthlein](https://twitter.com/raethlein
55
74
56
75
## Features
57
76
58
-
_Use this section for advertising the most important features and advantages of the project. Also, add screenshots or examples to showcase important features. The main purpose of this section is marketing._
_Either put the documentation here or use a deployed documentation site via mkdocs and link to the documentation._
97
+
### CLI Interface
98
+
99
+
<!-- generated via typer-cli: typer src/lazydocs/_cli.py utils docs -->
100
+
101
+
```console
102
+
laydocs [OPTIONS] PATHS...
103
+
```
104
+
105
+
**Arguments**:
106
+
107
+
*`PATHS...`: Selected paths or imports for markdown generation. [required]
108
+
109
+
**Options**:
110
+
111
+
*`--output-path TEXT`: The output path for the creation of the markdown files. Set this to `stdout` to print all markdown to stdout. [default: ./docs/]
112
+
*`--src-base-url TEXT`: The base repo link used as prefix for all source links. Should also include the branch name.
113
+
*`--overview-file TEXT`: Filename of overview file. If not provided, no API overview file will be generated.
114
+
*`--remove-package-prefix / --no-remove-package-prefix`: If `True`, the package prefix will be removed from all functions and methods. [default: True]
115
+
*`--ignored-modules TEXT`: A list of modules that should be ignored. [default: ]
116
+
*`--watermark / --no-watermark`: If `True`, add a watermark with a timestamp to bottom of the markdown files. [default: True]
117
+
*`--validate / --no-validate`: If `True`, validate the docstrings via pydocstyle. Requires pydocstyle to be installed. [default: False]
118
+
*`--install-completion`: Install completion for the current shell.
119
+
*`--show-completion`: Show completion for the current shell, to copy it or customize the installation.
120
+
*`--help`: Show this message and exit.
121
+
122
+
### Programmatic API
123
+
124
+
Lazydocs can also be used and integrated via its [Python API](https://github.com/ml-tooling/lazydocs/tree/main/docs). For example, to generate markdown for an arbitrary Python import or object:
125
+
126
+
```python
127
+
from lazydocs import MarkdownGenerator
128
+
129
+
generator = MarkdownGenerator()
130
+
131
+
# Select a module to generate markdown documentation
132
+
# Here we use the generation module itself as an example
133
+
my_module = generation
134
+
markdown_docs = generator.import2md(my_module)
135
+
```
136
+
137
+
To programmatically generate all markdown documentation files you can use [`generate_docs`](https://github.com/ml-tooling/lazydocs/blob/main/docs/lazydocs.generator.md#function-generate_docs):
138
+
139
+
```python
140
+
from lazydocs import generate_docs
141
+
142
+
# The parameters of this function correspond to the CLI options
0 commit comments