Skip to content

Commit 3349e20

Browse files
committed
Update readme with additional documentation
1 parent 4add695 commit 3349e20

File tree

1 file changed

+90
-6
lines changed

1 file changed

+90
-6
lines changed

README.md

Lines changed: 90 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@
2020
<a href="#features">Features</a> •
2121
<a href="#documentation">Documentation</a> •
2222
<a href="#support--feedback">Support</a> •
23-
<a href="https://github.com/ml-tooling/lazydocs/issues/new?labels=bug&template=01_bug-report.md">Report a Bug</a> •
2423
<a href="#contribution">Contribution</a> •
2524
<a href="https://github.com/ml-tooling/lazydocs/releases">Changelog</a>
2625
</p>
2726

28-
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.
2928

3029
## Highlights
3130

@@ -35,12 +34,32 @@ Lazydocs makes it easy to generate beautiful markdown documentation for your Pyt
3534

3635
## Getting Started
3736

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:
3950

4051
```bash
41-
lazydocs generate <path/to/package/or/module>
52+
lazydocs path/to/your/package
4253
```
4354

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+
4463
## Support & Feedback
4564

4665
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
5574

5675
## Features
5776

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._
77+
<p align="center">
78+
<a href="#source-code-linking">Source Code Linking</a> •
79+
<a href="#api-overview">API Overview</a> •
80+
<a href="#mkdocs-integration">MKDocs Integration</a> •
81+
<a href="#docstyle-validation">Docstyle Validation</a>
82+
</p>
83+
84+
### Source Code Linking
85+
86+
### API Overview
87+
88+
### MKDocs Integration
89+
90+
### Docstyle Validation
91+
92+
### Console Output
93+
5994

6095
## Documentation
6196

62-
_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
143+
generate_docs(["my_module"], output_path="./docs")
144+
```
145+
146+
The full Python API documentation can be found [here](https://github.com/ml-tooling/lazydocs/tree/main/docs) _(generated via lazydocs)_.
63147

64148
## Contributors
65149

0 commit comments

Comments
 (0)