Convert argparse based executable scripts to markdown documents. It is based on argdown but has a simpler interface and a cleaner code.
pip install argmark
Using argmark
is very simple. For a sample python file sample_argparse.py:
import argparse
parser = argparse.ArgumentParser(
prog="sample_argparse.py",
description="Just a test",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"-f", "--files", help="Files to read.", required=True, nargs="+",
)
values = parser.parse_args()
Run argmark -f sample_argparse.py
and it would generate:
sample_argparse.py
==================
# Description
Just a test
# Usage:
```bash
usage: sample_argparse.py [-h] -f FILES [FILES ...]
# Arguments
|short|long|default|help|
| :---: | :---: | :---: | :---: |
|`-h`|`--help`||show this help message and exit|
|`-f`|`--files`|`None`|Files to read.|
## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdevanshkv%2Fargmark.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdevanshkv%2Fargmark?ref=badge_large)