autoredocs 0.3.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.
- autoredocs-0.3.0/.env.example +37 -0
- autoredocs-0.3.0/.github/workflows/ci.yml +62 -0
- autoredocs-0.3.0/.github/workflows/deploy.yml +55 -0
- autoredocs-0.3.0/.github/workflows/docs.yml +53 -0
- autoredocs-0.3.0/.gitignore +37 -0
- autoredocs-0.3.0/CONTRIBUTING.md +62 -0
- autoredocs-0.3.0/LICENSE +21 -0
- autoredocs-0.3.0/PKG-INFO +540 -0
- autoredocs-0.3.0/README.md +488 -0
- autoredocs-0.3.0/pyproject.toml +80 -0
- autoredocs-0.3.0/src/autoredocs/__init__.py +3 -0
- autoredocs-0.3.0/src/autoredocs/ai.py +360 -0
- autoredocs-0.3.0/src/autoredocs/cli.py +620 -0
- autoredocs-0.3.0/src/autoredocs/config.py +136 -0
- autoredocs-0.3.0/src/autoredocs/deploy.py +273 -0
- autoredocs-0.3.0/src/autoredocs/generator.py +145 -0
- autoredocs-0.3.0/src/autoredocs/models.py +134 -0
- autoredocs-0.3.0/src/autoredocs/parser.py +10 -0
- autoredocs-0.3.0/src/autoredocs/parsers/__init__.py +84 -0
- autoredocs-0.3.0/src/autoredocs/parsers/base.py +145 -0
- autoredocs-0.3.0/src/autoredocs/parsers/cpp.py +291 -0
- autoredocs-0.3.0/src/autoredocs/parsers/csharp.py +306 -0
- autoredocs-0.3.0/src/autoredocs/parsers/go.py +217 -0
- autoredocs-0.3.0/src/autoredocs/parsers/java.py +248 -0
- autoredocs-0.3.0/src/autoredocs/parsers/kotlin.py +249 -0
- autoredocs-0.3.0/src/autoredocs/parsers/python_parser.py +176 -0
- autoredocs-0.3.0/src/autoredocs/parsers/ruby.py +162 -0
- autoredocs-0.3.0/src/autoredocs/parsers/rust.py +279 -0
- autoredocs-0.3.0/src/autoredocs/parsers/typescript.py +312 -0
- autoredocs-0.3.0/src/autoredocs/reporter.py +212 -0
- autoredocs-0.3.0/src/autoredocs/scaffold.py +161 -0
- autoredocs-0.3.0/src/autoredocs/server.py +134 -0
- autoredocs-0.3.0/src/autoredocs/serverless/__init__.py +0 -0
- autoredocs-0.3.0/src/autoredocs/serverless/lambda_handler.py +100 -0
- autoredocs-0.3.0/src/autoredocs/serverless/vercel_handler.py +92 -0
- autoredocs-0.3.0/src/autoredocs/state.py +112 -0
- autoredocs-0.3.0/src/autoredocs/templates/index.html.j2 +42 -0
- autoredocs-0.3.0/src/autoredocs/templates/index.md.j2 +19 -0
- autoredocs-0.3.0/src/autoredocs/templates/module.html.j2 +113 -0
- autoredocs-0.3.0/src/autoredocs/templates/module.md.j2 +76 -0
- autoredocs-0.3.0/src/autoredocs/templates/page.html.j2 +87 -0
- autoredocs-0.3.0/src/autoredocs/templates/style.css +797 -0
- autoredocs-0.3.0/src/autoredocs/watcher.py +72 -0
- autoredocs-0.3.0/tests/__init__.py +0 -0
- autoredocs-0.3.0/tests/fixtures/Calculator.java +63 -0
- autoredocs-0.3.0/tests/fixtures/bad_syntax.py +3 -0
- autoredocs-0.3.0/tests/fixtures/sample_module.py +136 -0
- autoredocs-0.3.0/tests/fixtures/sample_module.ts +67 -0
- autoredocs-0.3.0/tests/test_cli.py +89 -0
- autoredocs-0.3.0/tests/test_generator.py +89 -0
- autoredocs-0.3.0/tests/test_parser.py +166 -0
- autoredocs-0.3.0/tests/test_phase2.py +169 -0
- autoredocs-0.3.0/tests/test_phase4.py +132 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Autoredocs Environment Configuration
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# Copy this file to .env and fill in your values:
|
|
5
|
+
# cp .env.example .env
|
|
6
|
+
#
|
|
7
|
+
# NEVER commit .env to version control. It is already in .gitignore.
|
|
8
|
+
# =============================================================================
|
|
9
|
+
|
|
10
|
+
# --- AI (Groq) ---------------------------------------------------------------
|
|
11
|
+
# Required for: autoredocs ai-fill, autoredocs generate --ai
|
|
12
|
+
# Get your key at: https://console.groq.com/keys
|
|
13
|
+
GROQ_API_KEY=
|
|
14
|
+
|
|
15
|
+
# --- Netlify ------------------------------------------------------------------
|
|
16
|
+
# Required for: autoredocs deploy --target netlify
|
|
17
|
+
# Get your token at: https://app.netlify.com/user/applications#personal-access-tokens
|
|
18
|
+
NETLIFY_TOKEN=
|
|
19
|
+
NETLIFY_SITE_ID=
|
|
20
|
+
|
|
21
|
+
# --- Vercel -------------------------------------------------------------------
|
|
22
|
+
# Required for: autoredocs deploy --target vercel
|
|
23
|
+
# Get your token at: https://vercel.com/account/tokens
|
|
24
|
+
VERCEL_TOKEN=
|
|
25
|
+
VERCEL_PROJECT_ID=
|
|
26
|
+
|
|
27
|
+
# --- AWS S3 -------------------------------------------------------------------
|
|
28
|
+
# Required for: autoredocs deploy --target s3
|
|
29
|
+
# Create credentials at: https://console.aws.amazon.com/iam
|
|
30
|
+
AWS_ACCESS_KEY_ID=
|
|
31
|
+
AWS_SECRET_ACCESS_KEY=
|
|
32
|
+
AWS_REGION=us-east-1
|
|
33
|
+
S3_BUCKET=
|
|
34
|
+
|
|
35
|
+
# --- GitHub Webhook -----------------------------------------------------------
|
|
36
|
+
# Required for: autoredocs serve --webhook-secret, serverless handlers
|
|
37
|
+
GITHUB_WEBHOOK_SECRET=
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
lint:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.12"
|
|
20
|
+
- name: Install ruff
|
|
21
|
+
run: pip install ruff
|
|
22
|
+
- name: Run ruff check
|
|
23
|
+
run: ruff check src/ tests/
|
|
24
|
+
- name: Run ruff format check
|
|
25
|
+
run: ruff format --check src/ tests/
|
|
26
|
+
|
|
27
|
+
test:
|
|
28
|
+
runs-on: ${{ matrix.os }}
|
|
29
|
+
strategy:
|
|
30
|
+
matrix:
|
|
31
|
+
os: [ubuntu-latest, windows-latest]
|
|
32
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
- uses: actions/setup-python@v5
|
|
36
|
+
with:
|
|
37
|
+
python-version: ${{ matrix.python-version }}
|
|
38
|
+
- name: Install package
|
|
39
|
+
run: pip install -e ".[dev]"
|
|
40
|
+
- name: Run tests
|
|
41
|
+
run: pytest tests/ -v --tb=short --cov=autoredocs --cov-report=term-missing
|
|
42
|
+
- name: Upload coverage
|
|
43
|
+
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
|
|
44
|
+
uses: codecov/codecov-action@v4
|
|
45
|
+
|
|
46
|
+
build:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
needs: [lint, test]
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
- uses: actions/setup-python@v5
|
|
52
|
+
with:
|
|
53
|
+
python-version: "3.12"
|
|
54
|
+
- name: Install build tools
|
|
55
|
+
run: pip install build
|
|
56
|
+
- name: Build wheel
|
|
57
|
+
run: python -m build
|
|
58
|
+
- name: Upload artifact
|
|
59
|
+
uses: actions/upload-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
name: dist
|
|
62
|
+
path: dist/
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
PYTHON_VERSION: "3.12"
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build-and-deploy:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
23
|
+
|
|
24
|
+
- name: Install autoredocs
|
|
25
|
+
run: pip install -e ".[ai,server]"
|
|
26
|
+
|
|
27
|
+
- name: Generate documentation
|
|
28
|
+
run: |
|
|
29
|
+
autoredocs generate \
|
|
30
|
+
--source ./src \
|
|
31
|
+
--output ./docs \
|
|
32
|
+
--format html \
|
|
33
|
+
--incremental \
|
|
34
|
+
--ai
|
|
35
|
+
env:
|
|
36
|
+
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
|
37
|
+
|
|
38
|
+
- name: Deploy to Netlify
|
|
39
|
+
if: env.NETLIFY_TOKEN != ''
|
|
40
|
+
run: autoredocs deploy --output ./docs --target netlify
|
|
41
|
+
env:
|
|
42
|
+
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
|
|
43
|
+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
44
|
+
|
|
45
|
+
- name: Upload build report
|
|
46
|
+
uses: actions/upload-artifact@v4
|
|
47
|
+
with:
|
|
48
|
+
name: build-report
|
|
49
|
+
path: docs/build_report.json
|
|
50
|
+
|
|
51
|
+
- name: Upload docs artifact
|
|
52
|
+
uses: actions/upload-artifact@v4
|
|
53
|
+
with:
|
|
54
|
+
name: documentation
|
|
55
|
+
path: docs/
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Deploy Docs to GitHub Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: "pages"
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
PYTHON_VERSION: "3.12"
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
build:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Set up Python
|
|
27
|
+
uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
30
|
+
|
|
31
|
+
- name: Install autoredocs
|
|
32
|
+
run: pip install -e ".[ai,dev]"
|
|
33
|
+
|
|
34
|
+
- name: Generate AI-enhanced documentation
|
|
35
|
+
run: autoredocs generate --source src/autoredocs --output _site --format html --ai --incremental
|
|
36
|
+
env:
|
|
37
|
+
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
|
|
38
|
+
|
|
39
|
+
- name: Upload Pages artifact
|
|
40
|
+
uses: actions/upload-pages-artifact@v3
|
|
41
|
+
with:
|
|
42
|
+
path: _site
|
|
43
|
+
|
|
44
|
+
deploy:
|
|
45
|
+
needs: build
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
environment:
|
|
48
|
+
name: github-pages
|
|
49
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
50
|
+
steps:
|
|
51
|
+
- name: Deploy to GitHub Pages
|
|
52
|
+
id: deployment
|
|
53
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.egg-info/
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
*.egg
|
|
9
|
+
.eggs/
|
|
10
|
+
|
|
11
|
+
# Virtual environments
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
env/
|
|
15
|
+
|
|
16
|
+
# IDE
|
|
17
|
+
.vscode/
|
|
18
|
+
.idea/
|
|
19
|
+
*.swp
|
|
20
|
+
*.swo
|
|
21
|
+
|
|
22
|
+
# Testing
|
|
23
|
+
.pytest_cache/
|
|
24
|
+
.coverage
|
|
25
|
+
htmlcov/
|
|
26
|
+
.tox/
|
|
27
|
+
.mypy_cache/
|
|
28
|
+
|
|
29
|
+
# Autoredocs
|
|
30
|
+
.autoredocs_state.json
|
|
31
|
+
docs/
|
|
32
|
+
test_output/
|
|
33
|
+
|
|
34
|
+
# Environment
|
|
35
|
+
.env
|
|
36
|
+
.env.local
|
|
37
|
+
.env.*.local
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Contributing to autoredocs
|
|
2
|
+
|
|
3
|
+
Thank you for considering contributing to autoredocs.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/ShivamBwaj/autoredocs.git
|
|
9
|
+
cd autoredocs
|
|
10
|
+
pip install -e ".[dev]"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Running Tests
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pytest tests/ -v
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
All 78 tests must pass before submitting a pull request.
|
|
20
|
+
|
|
21
|
+
## Code Style
|
|
22
|
+
|
|
23
|
+
This project uses [Ruff](https://github.com/astral-sh/ruff) for linting:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install ruff
|
|
27
|
+
ruff check src/ tests/
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Target: Python 3.10+, line length 100.
|
|
31
|
+
|
|
32
|
+
## Pull Request Guidelines
|
|
33
|
+
|
|
34
|
+
1. Fork the repository and create your branch from `main`.
|
|
35
|
+
2. Add tests for any new functionality.
|
|
36
|
+
3. Ensure all tests pass.
|
|
37
|
+
4. Run the linter with zero warnings.
|
|
38
|
+
5. Write clear commit messages.
|
|
39
|
+
|
|
40
|
+
## Adding a New Language Parser
|
|
41
|
+
|
|
42
|
+
1. Create a new parser class in `src/autoredocs/parsers/` that extends `BaseParser`.
|
|
43
|
+
2. Implement the `parse_file` method.
|
|
44
|
+
3. Set the `extensions` class attribute to the file extensions it handles.
|
|
45
|
+
4. The parser registry in `src/autoredocs/parsers/__init__.py` will auto-discover it.
|
|
46
|
+
5. Add tests in `tests/`.
|
|
47
|
+
|
|
48
|
+
## Adding a New Deploy Target
|
|
49
|
+
|
|
50
|
+
1. Create a new class in `src/autoredocs/deploy.py` that extends `BaseDeployer`.
|
|
51
|
+
2. Implement the `deploy(docs_dir: Path) -> str` method.
|
|
52
|
+
3. Add it to the `DEPLOYERS` registry dict.
|
|
53
|
+
4. Document the required environment variables in `README.md` and `.env.example`.
|
|
54
|
+
|
|
55
|
+
## Reporting Issues
|
|
56
|
+
|
|
57
|
+
Open an issue on GitHub with:
|
|
58
|
+
|
|
59
|
+
- Python version (`python --version`)
|
|
60
|
+
- Operating system
|
|
61
|
+
- Steps to reproduce
|
|
62
|
+
- Expected vs actual behavior
|
autoredocs-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Autoredocs
|
|
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.
|