docgenie-cli 1.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.
- docgenie_cli-1.1.0/.gitignore +131 -0
- docgenie_cli-1.1.0/LICENSE +21 -0
- docgenie_cli-1.1.0/PKG-INFO +256 -0
- docgenie_cli-1.1.0/README.md +183 -0
- docgenie_cli-1.1.0/pyproject.toml +106 -0
- docgenie_cli-1.1.0/src/docgenie/__init__.py +15 -0
- docgenie_cli-1.1.0/src/docgenie/__main__.py +13 -0
- docgenie_cli-1.1.0/src/docgenie/cli.py +499 -0
- docgenie_cli-1.1.0/src/docgenie/config.py +89 -0
- docgenie_cli-1.1.0/src/docgenie/convert_to_html.py +19 -0
- docgenie_cli-1.1.0/src/docgenie/core.py +511 -0
- docgenie_cli-1.1.0/src/docgenie/exceptions.py +68 -0
- docgenie_cli-1.1.0/src/docgenie/generator.py +957 -0
- docgenie_cli-1.1.0/src/docgenie/html_generator.py +658 -0
- docgenie_cli-1.1.0/src/docgenie/index_store.py +322 -0
- docgenie_cli-1.1.0/src/docgenie/logging.py +115 -0
- docgenie_cli-1.1.0/src/docgenie/models.py +174 -0
- docgenie_cli-1.1.0/src/docgenie/parsers.py +415 -0
- docgenie_cli-1.1.0/src/docgenie/py.typed +1 -0
- docgenie_cli-1.1.0/src/docgenie/redaction.py +48 -0
- docgenie_cli-1.1.0/src/docgenie/sanitize.py +111 -0
- docgenie_cli-1.1.0/src/docgenie/utils.py +597 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
|
|
2
|
+
# Byte-compiled / optimized / DLL files
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*$py.class
|
|
6
|
+
|
|
7
|
+
# C extensions
|
|
8
|
+
*.so
|
|
9
|
+
|
|
10
|
+
# Distribution / packaging
|
|
11
|
+
.Python
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
.python-version
|
|
87
|
+
|
|
88
|
+
# celery beat schedule file
|
|
89
|
+
celerybeat-schedule
|
|
90
|
+
|
|
91
|
+
# SageMath parsed files
|
|
92
|
+
*.sage.py
|
|
93
|
+
|
|
94
|
+
# Environments
|
|
95
|
+
.env
|
|
96
|
+
.venv
|
|
97
|
+
env/
|
|
98
|
+
venv/
|
|
99
|
+
ENV/
|
|
100
|
+
env.bak/
|
|
101
|
+
venv.bak/
|
|
102
|
+
|
|
103
|
+
# Spyder project settings
|
|
104
|
+
.spyderproject
|
|
105
|
+
.spyproject
|
|
106
|
+
|
|
107
|
+
# Rope project settings
|
|
108
|
+
.ropeproject
|
|
109
|
+
|
|
110
|
+
# mkdocs documentation
|
|
111
|
+
/site
|
|
112
|
+
|
|
113
|
+
# mypy
|
|
114
|
+
.mypy_cache/
|
|
115
|
+
.dmypy.json
|
|
116
|
+
dmypy.json
|
|
117
|
+
|
|
118
|
+
# Pyre type checker
|
|
119
|
+
.pyre/
|
|
120
|
+
|
|
121
|
+
# pytype static type analyzer
|
|
122
|
+
.pytype/
|
|
123
|
+
|
|
124
|
+
# Cython debug symbols
|
|
125
|
+
cython_debug/
|
|
126
|
+
|
|
127
|
+
# IDEs
|
|
128
|
+
.idea/
|
|
129
|
+
.vscode/
|
|
130
|
+
*.swp
|
|
131
|
+
*.swo
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 DocGenie Team
|
|
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,256 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: docgenie-cli
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Auto-documentation tool that generates comprehensive README and HTML docs for any codebase.
|
|
5
|
+
Project-URL: Homepage, https://github.com/ch1kim0n1/DocGenie
|
|
6
|
+
Project-URL: Repository, https://github.com/ch1kim0n1/DocGenie
|
|
7
|
+
Project-URL: Documentation, https://github.com/ch1kim0n1/DocGenie
|
|
8
|
+
Project-URL: Changelog, https://github.com/ch1kim0n1/DocGenie/blob/main/CHANGELOG.md
|
|
9
|
+
Author-email: DocGenie Team <contact@docgenie.dev>
|
|
10
|
+
License: MIT License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2025 DocGenie Team
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
SOFTWARE.
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Operating System :: OS Independent
|
|
36
|
+
Classifier: Programming Language :: Python
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
42
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
43
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
44
|
+
Requires-Python: >=3.10
|
|
45
|
+
Requires-Dist: click>=8.1
|
|
46
|
+
Requires-Dist: gitpython>=3.1
|
|
47
|
+
Requires-Dist: jinja2>=3.1
|
|
48
|
+
Requires-Dist: markdown>=3.3
|
|
49
|
+
Requires-Dist: pathspec>=0.9
|
|
50
|
+
Requires-Dist: pygments>=2.10
|
|
51
|
+
Requires-Dist: pyyaml>=6.0
|
|
52
|
+
Requires-Dist: requests>=2.25
|
|
53
|
+
Requires-Dist: rich>=13.7
|
|
54
|
+
Requires-Dist: structlog>=24.1
|
|
55
|
+
Requires-Dist: toml>=0.10
|
|
56
|
+
Requires-Dist: tree-sitter-language-pack>=0.13.0
|
|
57
|
+
Requires-Dist: typer>=0.12
|
|
58
|
+
Provides-Extra: dev
|
|
59
|
+
Requires-Dist: bandit>=1.7; extra == 'dev'
|
|
60
|
+
Requires-Dist: hypothesis>=6.0; extra == 'dev'
|
|
61
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'dev'
|
|
62
|
+
Requires-Dist: mkdocs>=1.5; extra == 'dev'
|
|
63
|
+
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'dev'
|
|
64
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
65
|
+
Requires-Dist: pre-commit>=3.6; extra == 'dev'
|
|
66
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
67
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
68
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
69
|
+
Requires-Dist: types-markdown; extra == 'dev'
|
|
70
|
+
Requires-Dist: types-pyyaml; extra == 'dev'
|
|
71
|
+
Requires-Dist: types-toml; extra == 'dev'
|
|
72
|
+
Description-Content-Type: text/markdown
|
|
73
|
+
|
|
74
|
+
# DocGenie
|
|
75
|
+
|
|
76
|
+
Auto-documentation tool that generates `README.md` and HTML docs for a codebase.
|
|
77
|
+
|
|
78
|
+
## Quick Guide
|
|
79
|
+
|
|
80
|
+
### Installation
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
python3 -m pip install "docgenie"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Requirements: **Python 3.10+**
|
|
87
|
+
|
|
88
|
+
### Setup (from source)
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
git clone https://github.com/ch1kim0n1/DocGenie.git
|
|
92
|
+
cd DocGenie
|
|
93
|
+
python3 -m pip install -e "."
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Usage
|
|
97
|
+
|
|
98
|
+
#### Generate Markdown README
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
docgenie generate /path/to/project --format markdown
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
#### Generate HTML Documentation
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
docgenie generate /path/to/project --format html
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### Generate Both Formats
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
docgenie generate /path/to/project --format both
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### Convert Existing README to HTML
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
docgenie html README.md --source readme --output docs.html
|
|
120
|
+
# or, using the legacy convenience command:
|
|
121
|
+
docgenie-html README.md --source readme --output docs.html
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Programmatic Usage (Python API)
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
from docgenie.core import CodebaseAnalyzer
|
|
128
|
+
from docgenie.html_generator import HTMLGenerator
|
|
129
|
+
|
|
130
|
+
analyzer = CodebaseAnalyzer('/path/to/project')
|
|
131
|
+
data = analyzer.analyze()
|
|
132
|
+
|
|
133
|
+
html_generator = HTMLGenerator()
|
|
134
|
+
html_content = html_generator.generate_from_analysis(data, "output.html")
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Troubleshooting
|
|
138
|
+
|
|
139
|
+
- Ensure all dependencies are installed
|
|
140
|
+
- Check write permissions for output directory
|
|
141
|
+
- Use UTF-8 encoding for source files
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT License. See LICENSE file for details.
|
|
146
|
+
|
|
147
|
+
## What DocGenie Analyzes
|
|
148
|
+
|
|
149
|
+
- **Project Structure**: Directory tree and file organization
|
|
150
|
+
- **Source Code**: Functions, classes, methods, and documentation
|
|
151
|
+
- **Dependencies**: Package files (requirements.txt, package.json, etc.)
|
|
152
|
+
- **Configuration**: Config files and project settings
|
|
153
|
+
- **Documentation**: Existing docs and README files
|
|
154
|
+
- **Git Information**: Repository details, branches, contributors
|
|
155
|
+
- **Statistics**: Language distribution, code metrics
|
|
156
|
+
|
|
157
|
+
## Example Output
|
|
158
|
+
|
|
159
|
+
DocGenie generates README files with:
|
|
160
|
+
|
|
161
|
+
- **Project Overview**: Auto-generated description and features
|
|
162
|
+
- **Installation Instructions**: Detected from your dependency files
|
|
163
|
+
- **Usage Examples**: Based on your code structure
|
|
164
|
+
- **API Documentation**: Extracted from functions and classes
|
|
165
|
+
- **Project Structure**: Visual directory tree
|
|
166
|
+
- **Dependencies**: Organized by package manager
|
|
167
|
+
- **Contributing Guidelines**: Standard open-source templates
|
|
168
|
+
|
|
169
|
+
## Advanced Usage
|
|
170
|
+
|
|
171
|
+
### Command Line Options
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Basic usage
|
|
175
|
+
docgenie --help # Show help
|
|
176
|
+
docgenie generate . --verbose # Enable detailed output
|
|
177
|
+
docgenie generate . --force # Overwrite existing files
|
|
178
|
+
|
|
179
|
+
# Format options
|
|
180
|
+
docgenie generate . --format markdown # README.md only (default)
|
|
181
|
+
docgenie generate . --format html # HTML documentation only
|
|
182
|
+
docgenie generate . --format both # Generate both README.md and HTML
|
|
183
|
+
|
|
184
|
+
# Output options
|
|
185
|
+
docgenie generate . --output custom_path # Custom output location
|
|
186
|
+
docgenie generate . --preview # Preview without saving
|
|
187
|
+
|
|
188
|
+
# HTML converter
|
|
189
|
+
docgenie html README.md --source readme # Convert README to HTML
|
|
190
|
+
docgenie html . --source codebase # Generate HTML from code
|
|
191
|
+
|
|
192
|
+
# Analysis tools
|
|
193
|
+
docgenie analyze . --format json # Output analysis as JSON
|
|
194
|
+
docgenie init # Create basic README template
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Configuration
|
|
198
|
+
|
|
199
|
+
Create a `.docgenie.yaml` file in your project root:
|
|
200
|
+
|
|
201
|
+
```yaml
|
|
202
|
+
ignore_patterns:
|
|
203
|
+
- "*.log"
|
|
204
|
+
- "temp/*"
|
|
205
|
+
- "private/"
|
|
206
|
+
|
|
207
|
+
template_customizations:
|
|
208
|
+
include_api_docs: true
|
|
209
|
+
include_directory_tree: true
|
|
210
|
+
max_functions_documented: 20
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Architecture
|
|
214
|
+
|
|
215
|
+
DocGenie consists of several key components:
|
|
216
|
+
|
|
217
|
+
- **CodebaseAnalyzer**: Multi-language code analysis engine with caching and concurrency
|
|
218
|
+
- **ParserRegistry**: Pluggable parsers (AST, tree-sitter, regex fallback) per language
|
|
219
|
+
- **ReadmeGenerator**: Jinja2-based template rendering system for markdown
|
|
220
|
+
- **HTMLGenerator**: Beautiful HTML documentation generator with responsive design
|
|
221
|
+
- **CLI Interface**: Typer + Rich powered user experience
|
|
222
|
+
|
|
223
|
+
## Contributing
|
|
224
|
+
|
|
225
|
+
We welcome contributions! Here's how to get started:
|
|
226
|
+
|
|
227
|
+
1. Fork the repository
|
|
228
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
229
|
+
3. Make your changes and add tests
|
|
230
|
+
4. Run the test suite (`pytest`)
|
|
231
|
+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
232
|
+
6. Push to the branch (`git push origin feature/amazing-feature`)
|
|
233
|
+
7. Open a Pull Request
|
|
234
|
+
|
|
235
|
+
### Development Setup
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
git clone https://github.com/ch1kim0n1/DocGenie.git
|
|
239
|
+
cd DocGenie
|
|
240
|
+
pip install -e ".[dev]"
|
|
241
|
+
pytest
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## License
|
|
245
|
+
|
|
246
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
247
|
+
|
|
248
|
+
## Acknowledgments
|
|
249
|
+
|
|
250
|
+
- Thanks to all contributors who help make DocGenie better
|
|
251
|
+
- Inspired by the need for better automated documentation tools
|
|
252
|
+
- Built with love for the open-source community
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
If DocGenie helps you, please star this repository.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# DocGenie
|
|
2
|
+
|
|
3
|
+
Auto-documentation tool that generates `README.md` and HTML docs for a codebase.
|
|
4
|
+
|
|
5
|
+
## Quick Guide
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
python3 -m pip install "docgenie"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requirements: **Python 3.10+**
|
|
14
|
+
|
|
15
|
+
### Setup (from source)
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git clone https://github.com/ch1kim0n1/DocGenie.git
|
|
19
|
+
cd DocGenie
|
|
20
|
+
python3 -m pip install -e "."
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Usage
|
|
24
|
+
|
|
25
|
+
#### Generate Markdown README
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
docgenie generate /path/to/project --format markdown
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Generate HTML Documentation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
docgenie generate /path/to/project --format html
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### Generate Both Formats
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
docgenie generate /path/to/project --format both
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### Convert Existing README to HTML
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
docgenie html README.md --source readme --output docs.html
|
|
47
|
+
# or, using the legacy convenience command:
|
|
48
|
+
docgenie-html README.md --source readme --output docs.html
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### Programmatic Usage (Python API)
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from docgenie.core import CodebaseAnalyzer
|
|
55
|
+
from docgenie.html_generator import HTMLGenerator
|
|
56
|
+
|
|
57
|
+
analyzer = CodebaseAnalyzer('/path/to/project')
|
|
58
|
+
data = analyzer.analyze()
|
|
59
|
+
|
|
60
|
+
html_generator = HTMLGenerator()
|
|
61
|
+
html_content = html_generator.generate_from_analysis(data, "output.html")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Troubleshooting
|
|
65
|
+
|
|
66
|
+
- Ensure all dependencies are installed
|
|
67
|
+
- Check write permissions for output directory
|
|
68
|
+
- Use UTF-8 encoding for source files
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
MIT License. See LICENSE file for details.
|
|
73
|
+
|
|
74
|
+
## What DocGenie Analyzes
|
|
75
|
+
|
|
76
|
+
- **Project Structure**: Directory tree and file organization
|
|
77
|
+
- **Source Code**: Functions, classes, methods, and documentation
|
|
78
|
+
- **Dependencies**: Package files (requirements.txt, package.json, etc.)
|
|
79
|
+
- **Configuration**: Config files and project settings
|
|
80
|
+
- **Documentation**: Existing docs and README files
|
|
81
|
+
- **Git Information**: Repository details, branches, contributors
|
|
82
|
+
- **Statistics**: Language distribution, code metrics
|
|
83
|
+
|
|
84
|
+
## Example Output
|
|
85
|
+
|
|
86
|
+
DocGenie generates README files with:
|
|
87
|
+
|
|
88
|
+
- **Project Overview**: Auto-generated description and features
|
|
89
|
+
- **Installation Instructions**: Detected from your dependency files
|
|
90
|
+
- **Usage Examples**: Based on your code structure
|
|
91
|
+
- **API Documentation**: Extracted from functions and classes
|
|
92
|
+
- **Project Structure**: Visual directory tree
|
|
93
|
+
- **Dependencies**: Organized by package manager
|
|
94
|
+
- **Contributing Guidelines**: Standard open-source templates
|
|
95
|
+
|
|
96
|
+
## Advanced Usage
|
|
97
|
+
|
|
98
|
+
### Command Line Options
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Basic usage
|
|
102
|
+
docgenie --help # Show help
|
|
103
|
+
docgenie generate . --verbose # Enable detailed output
|
|
104
|
+
docgenie generate . --force # Overwrite existing files
|
|
105
|
+
|
|
106
|
+
# Format options
|
|
107
|
+
docgenie generate . --format markdown # README.md only (default)
|
|
108
|
+
docgenie generate . --format html # HTML documentation only
|
|
109
|
+
docgenie generate . --format both # Generate both README.md and HTML
|
|
110
|
+
|
|
111
|
+
# Output options
|
|
112
|
+
docgenie generate . --output custom_path # Custom output location
|
|
113
|
+
docgenie generate . --preview # Preview without saving
|
|
114
|
+
|
|
115
|
+
# HTML converter
|
|
116
|
+
docgenie html README.md --source readme # Convert README to HTML
|
|
117
|
+
docgenie html . --source codebase # Generate HTML from code
|
|
118
|
+
|
|
119
|
+
# Analysis tools
|
|
120
|
+
docgenie analyze . --format json # Output analysis as JSON
|
|
121
|
+
docgenie init # Create basic README template
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Configuration
|
|
125
|
+
|
|
126
|
+
Create a `.docgenie.yaml` file in your project root:
|
|
127
|
+
|
|
128
|
+
```yaml
|
|
129
|
+
ignore_patterns:
|
|
130
|
+
- "*.log"
|
|
131
|
+
- "temp/*"
|
|
132
|
+
- "private/"
|
|
133
|
+
|
|
134
|
+
template_customizations:
|
|
135
|
+
include_api_docs: true
|
|
136
|
+
include_directory_tree: true
|
|
137
|
+
max_functions_documented: 20
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Architecture
|
|
141
|
+
|
|
142
|
+
DocGenie consists of several key components:
|
|
143
|
+
|
|
144
|
+
- **CodebaseAnalyzer**: Multi-language code analysis engine with caching and concurrency
|
|
145
|
+
- **ParserRegistry**: Pluggable parsers (AST, tree-sitter, regex fallback) per language
|
|
146
|
+
- **ReadmeGenerator**: Jinja2-based template rendering system for markdown
|
|
147
|
+
- **HTMLGenerator**: Beautiful HTML documentation generator with responsive design
|
|
148
|
+
- **CLI Interface**: Typer + Rich powered user experience
|
|
149
|
+
|
|
150
|
+
## Contributing
|
|
151
|
+
|
|
152
|
+
We welcome contributions! Here's how to get started:
|
|
153
|
+
|
|
154
|
+
1. Fork the repository
|
|
155
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
156
|
+
3. Make your changes and add tests
|
|
157
|
+
4. Run the test suite (`pytest`)
|
|
158
|
+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
159
|
+
6. Push to the branch (`git push origin feature/amazing-feature`)
|
|
160
|
+
7. Open a Pull Request
|
|
161
|
+
|
|
162
|
+
### Development Setup
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
git clone https://github.com/ch1kim0n1/DocGenie.git
|
|
166
|
+
cd DocGenie
|
|
167
|
+
pip install -e ".[dev]"
|
|
168
|
+
pytest
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## License
|
|
172
|
+
|
|
173
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
174
|
+
|
|
175
|
+
## Acknowledgments
|
|
176
|
+
|
|
177
|
+
- Thanks to all contributors who help make DocGenie better
|
|
178
|
+
- Inspired by the need for better automated documentation tools
|
|
179
|
+
- Built with love for the open-source community
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
If DocGenie helps you, please star this repository.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.24"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "docgenie-cli"
|
|
7
|
+
version = "1.1.0"
|
|
8
|
+
description = "Auto-documentation tool that generates comprehensive README and HTML docs for any codebase."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "DocGenie Team", email = "contact@docgenie.dev" },
|
|
13
|
+
]
|
|
14
|
+
requires-python = ">=3.10"
|
|
15
|
+
dependencies = [
|
|
16
|
+
"click>=8.1",
|
|
17
|
+
"typer>=0.12",
|
|
18
|
+
"rich>=13.7",
|
|
19
|
+
"structlog>=24.1",
|
|
20
|
+
"tree-sitter-language-pack>=0.13.0",
|
|
21
|
+
"gitpython>=3.1",
|
|
22
|
+
"jinja2>=3.1",
|
|
23
|
+
"pyyaml>=6.0",
|
|
24
|
+
"toml>=0.10",
|
|
25
|
+
"pygments>=2.10",
|
|
26
|
+
"pathspec>=0.9",
|
|
27
|
+
"requests>=2.25",
|
|
28
|
+
"markdown>=3.3",
|
|
29
|
+
]
|
|
30
|
+
classifiers = [
|
|
31
|
+
"Development Status :: 4 - Beta",
|
|
32
|
+
"Intended Audience :: Developers",
|
|
33
|
+
"License :: OSI Approved :: MIT License",
|
|
34
|
+
"Operating System :: OS Independent",
|
|
35
|
+
"Programming Language :: Python",
|
|
36
|
+
"Programming Language :: Python :: 3",
|
|
37
|
+
"Programming Language :: Python :: 3.10",
|
|
38
|
+
"Programming Language :: Python :: 3.11",
|
|
39
|
+
"Programming Language :: Python :: 3.12",
|
|
40
|
+
"Programming Language :: Python :: 3.13",
|
|
41
|
+
"Topic :: Software Development :: Documentation",
|
|
42
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[project.optional-dependencies]
|
|
46
|
+
dev = [
|
|
47
|
+
"pytest>=8.0",
|
|
48
|
+
"pytest-cov>=4.0",
|
|
49
|
+
"hypothesis>=6.0",
|
|
50
|
+
"ruff>=0.6",
|
|
51
|
+
"mypy>=1.10",
|
|
52
|
+
"types-PyYAML",
|
|
53
|
+
"types-toml",
|
|
54
|
+
"types-Markdown",
|
|
55
|
+
"bandit>=1.7",
|
|
56
|
+
"pre-commit>=3.6",
|
|
57
|
+
"mkdocs>=1.5",
|
|
58
|
+
"mkdocs-material>=9.5",
|
|
59
|
+
"mkdocstrings[python]>=0.24",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[project.urls]
|
|
63
|
+
Homepage = "https://github.com/ch1kim0n1/DocGenie"
|
|
64
|
+
Repository = "https://github.com/ch1kim0n1/DocGenie"
|
|
65
|
+
Documentation = "https://github.com/ch1kim0n1/DocGenie"
|
|
66
|
+
Changelog = "https://github.com/ch1kim0n1/DocGenie/blob/main/CHANGELOG.md"
|
|
67
|
+
|
|
68
|
+
[project.scripts]
|
|
69
|
+
docgenie-cli = "docgenie.cli:app"
|
|
70
|
+
docgenie-html = "docgenie.convert_to_html:main"
|
|
71
|
+
|
|
72
|
+
[tool.hatch.build]
|
|
73
|
+
include = ["src/docgenie", "README.md", "LICENSE"]
|
|
74
|
+
exclude = [".github", "examples", "docs"]
|
|
75
|
+
|
|
76
|
+
[tool.hatch.build.targets.wheel]
|
|
77
|
+
packages = ["src/docgenie"]
|
|
78
|
+
|
|
79
|
+
[tool.ruff]
|
|
80
|
+
target-version = "py310"
|
|
81
|
+
line-length = 100
|
|
82
|
+
lint.select = ["E", "F", "I", "B", "UP", "S", "N", "A", "C4", "TID", "T20", "RET", "SIM", "PL"]
|
|
83
|
+
lint.ignore = ["B008"]
|
|
84
|
+
lint.per-file-ignores = { "src/docgenie/cli.py" = ["PLR0913"], "src/docgenie/generator.py" = ["UP006", "UP035", "PLR0912", "E501", "PLR2004"], "src/docgenie/html_generator.py" = ["UP006", "UP035", "E501"], "src/docgenie/utils.py" = ["UP006", "UP035", "PLR0911", "PLR0912", "PLR2004"] }
|
|
85
|
+
|
|
86
|
+
[tool.mypy]
|
|
87
|
+
python_version = "3.10"
|
|
88
|
+
warn_unused_configs = true
|
|
89
|
+
warn_unused_ignores = true
|
|
90
|
+
disallow_untyped_defs = true
|
|
91
|
+
disallow_incomplete_defs = true
|
|
92
|
+
check_untyped_defs = true
|
|
93
|
+
no_implicit_optional = true
|
|
94
|
+
strict_equality = true
|
|
95
|
+
pretty = true
|
|
96
|
+
mypy_path = ["typings"]
|
|
97
|
+
exclude = ["examples", "docs"]
|
|
98
|
+
|
|
99
|
+
[tool.pytest.ini_options]
|
|
100
|
+
addopts = "-ra -q --cov=docgenie --cov-report=term-missing"
|
|
101
|
+
pythonpath = ["src"]
|
|
102
|
+
|
|
103
|
+
[tool.bandit]
|
|
104
|
+
targets = ["src"]
|
|
105
|
+
exclude_dirs = ["tests", "examples"]
|
|
106
|
+
skips = ["B101"] # assert_used - we use asserts in tests
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""
|
|
2
|
+
DocGenie - Auto-documentation tool for codebases
|
|
3
|
+
|
|
4
|
+
A powerful Python library that automatically generates comprehensive README documentation
|
|
5
|
+
for any codebase by analyzing source code, dependencies, and project structure.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "1.1.0"
|
|
9
|
+
__author__ = "DocGenie Team"
|
|
10
|
+
__email__ = "contact@docgenie.dev"
|
|
11
|
+
|
|
12
|
+
from .core import CodebaseAnalyzer
|
|
13
|
+
from .generator import ReadmeGenerator
|
|
14
|
+
|
|
15
|
+
__all__ = ["CodebaseAnalyzer", "ReadmeGenerator"]
|