Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/axelgard/inkpot

a simple library for generating documentation from docstrings
https://github.com/axelgard/inkpot

docs-generator docstrings documentation markdown pip python python-library python-package python3 simple tool

Last synced: 1 day ago
JSON representation

a simple library for generating documentation from docstrings

Awesome Lists containing this project

README

        

# inkpot
A small simple library for generating documentation from docstrings

inkpot is available on [pip](https://pypi.org/project/inkpot/). **Please give it a star if you like it!**

drawing

![GitHub stars](https://img.shields.io/github/stars/AxelGard/inkpot?style=social)
![GitHub forks](https://img.shields.io/github/forks/AxelGard/inkpot?style=social)
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/Axel_Gard)

![GitHub](https://img.shields.io/github/license/AxelGard/inkpot?style=plastic)
![PyPI](https://img.shields.io/pypi/v/inkpot)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/inkpot)
![PyPI - Downloads](https://img.shields.io/pypi/dm/inkpot)

To know more about way this project was started, checkout this **[blog post](https://axelgard.github.io/blog/inkpot/2021/07/01/inkpot-init.html)**.

## Installation
```bash
pip install inkpot
```

## Usage
single file
```bash
python3 -m inkpot myfile.py
```
or directory
```bash
python3 -m inkpot myproject/
```
output to a file (also works with directories)
```bash
python3 -m inkpot myfile.py > doc.md
python3 -m inkpot myproject/ > doc.md
```

More functionality and better formatting might be added.

## Example

On the [wiki](https://github.com/AxelGard/inkpot/wiki/inkpot-src-docs) you can se the result of running inkpot on the inkpot source code.

Here is a small example from the test files.

Python file `tests/.ex/add.py`
```python
def add(a,b):
""" add to objects """
return a + b

```

```bash
python3 -m inkpot tests/.ex/add.py
```
returns markdown
```
# tests/.ex/add.py
## tests/.ex/add.py
**def add(a, b)** \
`add to objects `
```

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE.txt) file for details

## Acknowledgement

A special thanks to:

* [Astunparse](https://pypi.org/project/astunparse/), which is used in inkpot to unparse python files