pydoc2markdown 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pydoc2markdown-0.1.0/.github/workflows/ci.yml +74 -0
- pydoc2markdown-0.1.0/.github/workflows/release.yml +45 -0
- pydoc2markdown-0.1.0/.gitignore +134 -0
- pydoc2markdown-0.1.0/.pre-commit-config.yaml +22 -0
- pydoc2markdown-0.1.0/CHANGELOG.md +26 -0
- pydoc2markdown-0.1.0/CONTRIBUTING.md +80 -0
- pydoc2markdown-0.1.0/LICENSE +21 -0
- pydoc2markdown-0.1.0/PKG-INFO +104 -0
- pydoc2markdown-0.1.0/PROJECT_STRUCTURE.md +259 -0
- pydoc2markdown-0.1.0/README.md +68 -0
- pydoc2markdown-0.1.0/docs/.gitkeep +0 -0
- pydoc2markdown-0.1.0/examples/basic_usage.py +31 -0
- pydoc2markdown-0.1.0/examples/custom_template.md.j2 +41 -0
- pydoc2markdown-0.1.0/pyproject.toml +104 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/__init__.py +26 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/cli.py +131 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/core/__init__.py +1 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/core/config.py +39 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/core/generator.py +271 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/core/parser.py +396 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/core/watcher.py +88 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/templates/minimal.md +31 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/templates/module.md +137 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/utils/__init__.py +1 -0
- pydoc2markdown-0.1.0/src/pydoc2markdown/utils/helpers.py +34 -0
- pydoc2markdown-0.1.0/tests/__init__.py +1 -0
- pydoc2markdown-0.1.0/tests/conftest.py +139 -0
- pydoc2markdown-0.1.0/tests/test_cli.py +56 -0
- pydoc2markdown-0.1.0/tests/test_config.py +21 -0
- pydoc2markdown-0.1.0/tests/test_generator.py +118 -0
- pydoc2markdown-0.1.0/tests/test_parser.py +174 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repository
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
pip install -e ".[dev]"
|
|
29
|
+
|
|
30
|
+
- name: Lint with ruff
|
|
31
|
+
run: |
|
|
32
|
+
ruff check src tests
|
|
33
|
+
ruff format --check src tests
|
|
34
|
+
|
|
35
|
+
- name: Type check with mypy
|
|
36
|
+
run: mypy src
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: pytest --cov-report=xml
|
|
40
|
+
|
|
41
|
+
- name: Upload coverage
|
|
42
|
+
if: matrix.python-version == '3.12'
|
|
43
|
+
uses: codecov/codecov-action@v3
|
|
44
|
+
with:
|
|
45
|
+
files: ./coverage.xml
|
|
46
|
+
fail_ci_if_error: false
|
|
47
|
+
|
|
48
|
+
release:
|
|
49
|
+
needs: test
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
52
|
+
|
|
53
|
+
steps:
|
|
54
|
+
- name: Checkout repository
|
|
55
|
+
uses: actions/checkout@v4
|
|
56
|
+
|
|
57
|
+
- name: Set up Python
|
|
58
|
+
uses: actions/setup-python@v5
|
|
59
|
+
with:
|
|
60
|
+
python-version: "3.12"
|
|
61
|
+
|
|
62
|
+
- name: Install build tools
|
|
63
|
+
run: |
|
|
64
|
+
python -m pip install --upgrade pip
|
|
65
|
+
pip install build twine
|
|
66
|
+
|
|
67
|
+
- name: Build package
|
|
68
|
+
run: python -m build
|
|
69
|
+
|
|
70
|
+
- name: Publish to PyPI
|
|
71
|
+
env:
|
|
72
|
+
TWINE_USERNAME: __token__
|
|
73
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
74
|
+
run: twine upload dist/*
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
release-please:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
outputs:
|
|
17
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
18
|
+
tag_name: ${{ steps.release.outputs.tag_name }}
|
|
19
|
+
steps:
|
|
20
|
+
- uses: google-github-actions/release-please-action@v3
|
|
21
|
+
id: release
|
|
22
|
+
with:
|
|
23
|
+
release-type: python
|
|
24
|
+
package-name: pydoc2markdown
|
|
25
|
+
|
|
26
|
+
publish:
|
|
27
|
+
needs: release-please
|
|
28
|
+
if: ${{ needs.release-please.outputs.release_created }}
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
environment:
|
|
31
|
+
name: pypi
|
|
32
|
+
url: https://pypi.org/project/pydoc2markdown/${{ needs.release-please.outputs.tag_name }}
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
- uses: actions/setup-python@v5
|
|
36
|
+
with:
|
|
37
|
+
python-version: "3.12"
|
|
38
|
+
- name: Install build dependencies
|
|
39
|
+
run: |
|
|
40
|
+
python -m pip install --upgrade pip
|
|
41
|
+
pip install build
|
|
42
|
+
- name: Build package
|
|
43
|
+
run: python -m build
|
|
44
|
+
- name: Publish to PyPI
|
|
45
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.nox/
|
|
42
|
+
.coverage
|
|
43
|
+
.coverage.*
|
|
44
|
+
.cache
|
|
45
|
+
nosetests.xml
|
|
46
|
+
coverage.xml
|
|
47
|
+
*.cover
|
|
48
|
+
*.py,cover
|
|
49
|
+
.hypothesis/
|
|
50
|
+
.pytest_cache/
|
|
51
|
+
|
|
52
|
+
# Translations
|
|
53
|
+
*.mo
|
|
54
|
+
*.pot
|
|
55
|
+
|
|
56
|
+
# Django stuff:
|
|
57
|
+
*.log
|
|
58
|
+
local_settings.py
|
|
59
|
+
db.sqlite3
|
|
60
|
+
db.sqlite3-journal
|
|
61
|
+
|
|
62
|
+
# Flask stuff:
|
|
63
|
+
instance/
|
|
64
|
+
.webassets-cache
|
|
65
|
+
|
|
66
|
+
# Scrapy stuff:
|
|
67
|
+
.scrapy
|
|
68
|
+
|
|
69
|
+
# Sphinx documentation
|
|
70
|
+
docs/_build/
|
|
71
|
+
|
|
72
|
+
# PyBuilder
|
|
73
|
+
target/
|
|
74
|
+
|
|
75
|
+
# Jupyter Notebook
|
|
76
|
+
.ipynb_checkpoints
|
|
77
|
+
|
|
78
|
+
# IPython
|
|
79
|
+
profile_default/
|
|
80
|
+
ipython_config.py
|
|
81
|
+
|
|
82
|
+
# pyenv
|
|
83
|
+
.python-version
|
|
84
|
+
|
|
85
|
+
# pipenv
|
|
86
|
+
Pipfile.lock
|
|
87
|
+
|
|
88
|
+
# PEP 582
|
|
89
|
+
__pypackages__/
|
|
90
|
+
|
|
91
|
+
# Celery stuff
|
|
92
|
+
celerybeat-schedule
|
|
93
|
+
celerybeat.pid
|
|
94
|
+
|
|
95
|
+
# SageMath parsed files
|
|
96
|
+
*.sage.py
|
|
97
|
+
|
|
98
|
+
# Environments
|
|
99
|
+
.env
|
|
100
|
+
.venv
|
|
101
|
+
env/
|
|
102
|
+
venv/
|
|
103
|
+
ENV/
|
|
104
|
+
env.bak/
|
|
105
|
+
venv.bak/
|
|
106
|
+
|
|
107
|
+
# Spyder project settings
|
|
108
|
+
.spyderproject
|
|
109
|
+
.spyproject
|
|
110
|
+
|
|
111
|
+
# Rope project settings
|
|
112
|
+
.ropeproject
|
|
113
|
+
|
|
114
|
+
# mkdocs documentation
|
|
115
|
+
/site
|
|
116
|
+
|
|
117
|
+
# mypy
|
|
118
|
+
.mypy_cache/
|
|
119
|
+
.dmypy.json
|
|
120
|
+
dmypy.json
|
|
121
|
+
|
|
122
|
+
# Pyre type checker
|
|
123
|
+
.pyre/
|
|
124
|
+
|
|
125
|
+
# IDE
|
|
126
|
+
.vscode/
|
|
127
|
+
.idea/
|
|
128
|
+
*.swp
|
|
129
|
+
*.swo
|
|
130
|
+
*~
|
|
131
|
+
|
|
132
|
+
# OS
|
|
133
|
+
.DS_Store
|
|
134
|
+
Thumbs.db
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.15.14
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff
|
|
6
|
+
args: ["--fix"]
|
|
7
|
+
- id: ruff-format
|
|
8
|
+
|
|
9
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
10
|
+
rev: v1.15.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: mypy
|
|
13
|
+
additional_dependencies:
|
|
14
|
+
["docstring-parser>=0.15", "Jinja2>=3.1.0"]
|
|
15
|
+
|
|
16
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
17
|
+
rev: v5.0.0
|
|
18
|
+
hooks:
|
|
19
|
+
- id: trailing-whitespace
|
|
20
|
+
- id: end-of-file-fixer
|
|
21
|
+
- id: check-yaml
|
|
22
|
+
- id: check-added-large-files
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2026-05-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add --theme support with default and minimal built-in themes ([d4db85a](https://github.com/f1sherFM/PyDoc2Markdown/commit/d4db85a110bb60e6c73c80c37525af8b106a6e63))
|
|
9
|
+
* add --watch mode, pyproject.toml config, release-please CI workflow ([29cb01c](https://github.com/f1sherFM/PyDoc2Markdown/commit/29cb01c96cae5f9cdbdfd635bdba505d06397844))
|
|
10
|
+
* add property, classmethod, staticmethod, dataclass, enum, typeddict, __all__ parsing ([8f3b548](https://github.com/f1sherFM/PyDoc2Markdown/commit/8f3b54865e118ab8b00817d18cbf8f3a359b8f6c))
|
|
11
|
+
* add TOC and auto-generated index.md ([9616e8a](https://github.com/f1sherFM/PyDoc2Markdown/commit/9616e8a3cdfafd37e1789bba409f3ea1720e972d))
|
|
12
|
+
* group output by package and create nested directories ([fe7d629](https://github.com/f1sherFM/PyDoc2Markdown/commit/fe7d6293e537163a7c2305c24a8044f1396badef))
|
|
13
|
+
* initial project structure for PyDoc2Markdown ([07a480d](https://github.com/f1sherFM/PyDoc2Markdown/commit/07a480d72f95cea98151c736b50b6867e9627706))
|
|
14
|
+
* initial release on PyPI ([fc612f5](https://github.com/f1sherFM/PyDoc2Markdown/commit/fc612f52185ed53dd84f49aaa0969b4c61152b15))
|
|
15
|
+
* integrate docstring-parser, add verbose logging, setup pre-commit hooks ([acd4ab6](https://github.com/f1sherFM/PyDoc2Markdown/commit/acd4ab61c2de458095e58f8ffbc2b9dfd41f1241))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* Python 3.10 compat for tomllib, downgrade release-please to v3 ([e9f5cce](https://github.com/f1sherFM/PyDoc2Markdown/commit/e9f5cce27a70d1c7994b2991b220b8c424c0024b))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Documentation
|
|
24
|
+
|
|
25
|
+
* update CONTRIBUTING.md with release-please and versioning info ([a82ba61](https://github.com/f1sherFM/PyDoc2Markdown/commit/a82ba61fe55a249139dd40875195fcfcafc6e374))
|
|
26
|
+
* update README with new features and usage examples ([ca47680](https://github.com/f1sherFM/PyDoc2Markdown/commit/ca476807eeddf3f36442f02373f67eb83a9823df))
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Contributing to PyDoc2Markdown
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing! This document provides guidelines to help you get started.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
1. **Clone the repository**
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/f1sherFM/PyDoc2Markdown.git
|
|
10
|
+
cd PyDoc2Markdown
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. **Create a virtual environment**
|
|
14
|
+
```bash
|
|
15
|
+
python -m venv .venv
|
|
16
|
+
source .venv/bin/activate # Linux/macOS
|
|
17
|
+
.venv\Scripts\activate # Windows
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
3. **Install in development mode**
|
|
21
|
+
```bash
|
|
22
|
+
pip install -e ".[dev]"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Conventional Commits
|
|
26
|
+
|
|
27
|
+
We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification. Prefix your commit messages:
|
|
28
|
+
|
|
29
|
+
- `feat:` — New features (triggers **MINOR** version bump)
|
|
30
|
+
- `fix:` — Bug fixes (triggers **PATCH** version bump)
|
|
31
|
+
- `docs:` — Documentation changes
|
|
32
|
+
- `style:` — Code style changes (formatting, semicolons, etc.)
|
|
33
|
+
- `refactor:` — Code refactoring
|
|
34
|
+
- `test:` — Adding or updating tests
|
|
35
|
+
- `chore:` — Build process or auxiliary tool changes
|
|
36
|
+
|
|
37
|
+
Example:
|
|
38
|
+
```bash
|
|
39
|
+
git commit -m "feat: add support for NumPy-style docstrings"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Automated Releases
|
|
43
|
+
|
|
44
|
+
This project uses [release-please](https://github.com/googleapis/release-please) to automate versioning and publishing:
|
|
45
|
+
|
|
46
|
+
1. When a PR with conventional commits is merged to `main`, release-please analyzes the commit history.
|
|
47
|
+
2. If there are releasable changes, release-please opens a **Release PR** containing:
|
|
48
|
+
- Bumped version in `pyproject.toml`
|
|
49
|
+
- Updated `CHANGELOG.md`
|
|
50
|
+
3. Merging the Release PR creates a **GitHub Release** and triggers a PyPI publish via Trusted Publishing.
|
|
51
|
+
|
|
52
|
+
**Version bumping rules:**
|
|
53
|
+
- `feat:` commits bump the **minor** version (e.g. `0.1.0` → `0.2.0`)
|
|
54
|
+
- `fix:` commits bump the **patch** version (e.g. `0.1.0` → `0.1.1`)
|
|
55
|
+
- A commit footer with `BREAKING CHANGE:` bumps the **major** version
|
|
56
|
+
|
|
57
|
+
Commits with prefixes `docs:`, `style:`, `refactor:`, `test:`, `chore:` do not trigger a release by themselves.
|
|
58
|
+
|
|
59
|
+
## Code Quality
|
|
60
|
+
|
|
61
|
+
Before submitting a PR, ensure all checks pass:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
ruff check src tests
|
|
65
|
+
ruff format --check src tests
|
|
66
|
+
mypy src
|
|
67
|
+
pytest
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Pull Request Process
|
|
71
|
+
|
|
72
|
+
1. Fork the repository and create a feature branch.
|
|
73
|
+
2. Make your changes with clear, focused commits.
|
|
74
|
+
3. Add or update tests for any new functionality.
|
|
75
|
+
4. Update documentation if needed.
|
|
76
|
+
5. Open a PR with a descriptive title and summary.
|
|
77
|
+
|
|
78
|
+
## Questions?
|
|
79
|
+
|
|
80
|
+
Open an [issue](https://github.com/f1sherFM/PyDoc2Markdown/issues) or start a [discussion](https://github.com/f1sherFM/PyDoc2Markdown/discussions).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 f1sherFM
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pydoc2markdown
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Convert Python docstrings to Markdown documentation.
|
|
5
|
+
Project-URL: Homepage, https://github.com/f1sherFM/PyDoc2Markdown
|
|
6
|
+
Project-URL: Repository, https://github.com/f1sherFM/PyDoc2Markdown
|
|
7
|
+
Project-URL: Issues, https://github.com/f1sherFM/PyDoc2Markdown/issues
|
|
8
|
+
Author-email: f1sherFM <f1sherFM@example.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: docstring,documentation,markdown,python
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Documentation
|
|
20
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: docstring-parser>=0.15
|
|
24
|
+
Requires-Dist: jinja2>=3.1.0
|
|
25
|
+
Requires-Dist: tomli>=1.2.0; python_version < '3.11'
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: mypy>=1.5.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pre-commit>=3.5.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: watchdog>=3.0; extra == 'dev'
|
|
33
|
+
Provides-Extra: watch
|
|
34
|
+
Requires-Dist: watchdog>=3.0; extra == 'watch'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# PyDoc2Markdown
|
|
38
|
+
|
|
39
|
+
[](https://github.com/f1sherFM/PyDoc2Markdown/actions/workflows/ci.yml)
|
|
40
|
+
[](https://codecov.io/gh/f1sherFM/PyDoc2Markdown)
|
|
41
|
+
[](https://pypi.org/project/pydoc2markdown/)
|
|
42
|
+
|
|
43
|
+
> Convert Python docstrings into clean, structured Markdown documentation.
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- **Docstring parsing** — Extract Google, NumPy, and reStructuredText style docstrings with structured params, returns, and raises.
|
|
48
|
+
- **Markdown generation** — Produce beautiful Markdown files with customizable Jinja2 templates.
|
|
49
|
+
- **Auto-generated index & TOC** — Each module gets a Table of Contents; an `index.md` with package grouping is created automatically.
|
|
50
|
+
- **Package grouping** — Output files are organized into subdirectories matching the package structure.
|
|
51
|
+
- **Built-in themes** — Choose between `default` (detailed) and `minimal` themes, or supply your own template.
|
|
52
|
+
- **CLI & API** — Use via command line or import as a Python library.
|
|
53
|
+
- **Recursive processing** — Scan entire packages in one command.
|
|
54
|
+
- **Type-aware** — Respects type hints and annotations.
|
|
55
|
+
- **Advanced constructs** — Supports `property`, `classmethod`, `staticmethod`, `dataclass`, `Enum`, `TypedDict`, and `__all__`.
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install pydoc2markdown
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
### CLI Usage
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Generate docs for a single file
|
|
69
|
+
pydoc2markdown my_module.py -o docs
|
|
70
|
+
|
|
71
|
+
# Recursively process a package
|
|
72
|
+
pydoc2markdown src/my_package --recursive -o docs
|
|
73
|
+
|
|
74
|
+
# Use a built-in theme
|
|
75
|
+
pydoc2markdown src/my_package --recursive --theme minimal -o docs
|
|
76
|
+
|
|
77
|
+
# Use a custom template
|
|
78
|
+
pydoc2markdown src/my_package --recursive --template custom.md.j2 -o docs
|
|
79
|
+
|
|
80
|
+
# Enable verbose logging
|
|
81
|
+
pydoc2markdown src/my_package --recursive -vv -o docs
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Library Usage
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from pathlib import Path
|
|
88
|
+
from pydoc2markdown import DocstringParser, MarkdownGenerator
|
|
89
|
+
|
|
90
|
+
parser = DocstringParser()
|
|
91
|
+
modules = parser.parse(Path("src/my_package"), recursive=True)
|
|
92
|
+
|
|
93
|
+
generator = MarkdownGenerator(theme="default")
|
|
94
|
+
generator.generate(modules, output_dir=Path("docs"))
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Documentation
|
|
98
|
+
|
|
99
|
+
- [Contributing Guide](CONTRIBUTING.md)
|
|
100
|
+
- [Project Structure](PROJECT_STRUCTURE.md)
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT License — see [LICENSE](LICENSE) for details.
|