Metadata-Version: 2.4
Name: markdownizer
Version: 0.2.1
Summary: Extract documentation from Python projects into Markdown without rewriting it
Author-email: Mohammad Hasan Khoddami <mohammadh.khoddami@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Mohammad Hasan Khoddami
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/mohammadkhoddami/Markdownizer
Project-URL: Repository, https://github.com/mohammadkhoddami/Markdownizer
Project-URL: Issues, https://github.com/mohammadkhoddami/Markdownizer/issues
Keywords: documentation,markdown,docstring,django,drf,ast
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: ruff>=0.8; extra == "dev"
Requires-Dist: tomli>=2.0; python_version < "3.11" and extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# Markdownizer

Extract existing documentation from Python projects into Markdown.

![CI](https://github.com/mohammadkhoddami/Markdownizer/actions/workflows/ci.yml/badge.svg)
[![PyPI](https://img.shields.io/pypi/v/markdownizer)](https://pypi.org/project/markdownizer/)
![Python](https://img.shields.io/pypi/pyversions/markdownizer)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Markdownizer **never** generates, rewrites, summarizes, or improves documentation.
It only extracts what is already present in your source code: docstrings,
comments, decorators, and source.

## Installation

```bash
pip install markdownizer
```

Or with [pipx](https://pipx.pypa.io/) for an isolated CLI:

```bash
pipx install markdownizer
```

Requires Python 3.9+. No runtime dependencies.

## Usage

### CLI

```bash
markdownizer /path/to/project -o ./docs
```

This recursively scans the project, parses every Python file with the AST, and
writes one Markdown file per package into `./docs`.

Common options:

```bash
markdownizer . -o ./docs \
  --exclude "tests/*" --exclude "migrations" \
  --only-documented --no-source
```

| Option | Description |
| --- | --- |
| `-o, --output DIR` | Output directory (default: `./docs`) |
| `--root-name NAME` | Filename for files at the project root (default: `_root`) |
| `--exclude GLOB` | Skip matching paths; may be repeated |
| `--no-source` | Omit the `## Source Code` section |
| `--no-comments` | Omit the `## Comments` section |
| `--only-documented` | Only include objects with a docstring |
| `-v, --verbose` | Increase logging verbosity |
| `-q, --quiet` | Suppress non-error output |
| `--version` | Show the version |

Run `markdownizer --help` for the full list.

### Python API

```python
from pathlib import Path
from markdownizer import extract_project

written = extract_project(
    Path("."),
    Path("docs"),
    exclude=["tests/*"],
    include_source=False,
)
print(written)  # list of written Markdown files
```

## What is extracted

For every documented object (modules, packages, classes, dataclasses, enums,
functions, async functions, methods, properties, Django models, Django forms,
Django admin classes, DRF serializers, DRF viewsets, signals, middleware,
management commands, URL configuration, and any other object with a docstring):

- The docstring, verbatim
- Comments that belong to the object (preceding and inline)
- Decorators
- The complete source code

## Output format

Each generated Markdown file groups all modules inside a single package and
uses specialized headers such as:

```
# Django Model: User
# DRF Serializer: UserSerializer
# DRF ViewSet: UserViewSet
# Enum: Status
# Dataclass: Point
# Async Function: fetch_data
```

Every section preserves the original formatting of the source documentation.

## Development

See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, checks, and release steps.
Changes are recorded in [CHANGELOG.md](CHANGELOG.md).

## License

MIT — see [LICENSE](LICENSE).
