Skip to content

Commit 663685b

Browse files
refactoring
1 parent ac04cb6 commit 663685b

29 files changed

+961
-406
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# If no LLM is configured, code2docs falls back to algorithm-based generation.
44

55
# LLM model identifier (litellm format)
6-
# Examples: openai/gpt-4o-mini, anthropic/claude-3-haiku, ollama/llama3, groq/llama-3.1-8b
7-
CODE2DOCS_LLM_MODEL=openai/gpt-4o-mini
6+
# Examples: openai/gpt-5.4-mini, anthropic/claude-3-haiku, ollama/llama3, groq/llama-3.1-8b
7+
CODE2DOCS_LLM_MODEL=openai/gpt-5.4-mini
88

99
# API key for the LLM provider
1010
# Not needed for local models (ollama, etc.)

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.env.example
12
.idea
23

34
# Byte-compiled / optimized / DLL files

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
## AI Cost Tracking
55

6-
![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-3.0.26-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
6+
![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.1.31-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
77
![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-18.6h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
88

9-
- 🤖 **LLM usage:** $7.5000 (58 commits)
9+
- 🤖 **LLM usage:** $7.5000 (59 commits)
1010
- 👤 **Human dev:** ~$1857 (18.6h @ $100/h, 30min dedup)
1111

12-
Generated on 2026-04-08 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
12+
Generated on 2026-04-09 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
1313

1414
---
1515

code2docs/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def main() -> None:
3232
@click.option('--output', '-o', default=None, help='Output directory for docs')
3333
@click.option('--verbose', '-v', is_flag=True, help='Verbose output')
3434
@click.option('--dry-run', is_flag=True, help='Show what would be generated without writing')
35-
@click.option('--llm', 'llm_model', default=None, help='Enable LLM-assisted generation (e.g. openai/gpt-4o-mini, ollama/llama3)')
35+
@click.option('--llm', 'llm_model', default=None, help='Enable LLM-assisted generation (e.g. openai/gpt-5.4-mini, ollama/llama3)')
3636
@click.option('--org-name', default=None, help='Organization name for org-mode README generation')
3737
def generate(project_path, config_path, readme_only, sections, output, verbose, dry_run, llm_model, org_name) -> None:
3838
"""Generate documentation (default command)."""

code2docs/docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
| Option | Type | Default | Description |
5858
|--------|------|---------|-------------|
5959
| `enabled` | `bool` | false | Enable LLM-assisted documentation generation |
60-
| `model` | `str` | "" | LLM model identifier (litellm format, e.g. `openai/gpt-4o-mini`, `ollama/llama3`) |
60+
| `model` | `str` | "" | LLM model identifier (litellm format, e.g. `openai/gpt-5.4-mini`, `ollama/llama3`) |
6161
| `api_key` | `str` | "" | API key for the LLM provider (use `.env` or env var `CODE2DOCS_LLM_API_KEY`) |
6262
| `api_base` | `str` | "" | Custom API base URL (for self-hosted or proxy endpoints) |
6363
| `max_tokens` | `int` | 1024 | Maximum tokens per LLM call |

code2docs/generators/api_reference_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from collections import defaultdict
44
from pathlib import Path
5-
from typing import Dict, List, Optional
5+
from typing import Dict, List
66

77
from code2llm.api import AnalysisResult, FunctionInfo, ClassInfo, ModuleInfo
88

code2docs/generators/config_docs_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def generate(self) -> str:
5555
"watch": "Enable file watcher for auto-resync",
5656
"ignore": "Glob patterns to ignore during sync",
5757
"enabled": "Enable LLM-assisted documentation generation",
58-
"model": "LLM model identifier (litellm format, e.g. `openai/gpt-4o-mini`, `ollama/llama3`)",
58+
"model": "LLM model identifier (litellm format, e.g. `openai/gpt-5.4-mini`, `ollama/llama3`)",
5959
"api_key": "API key for the LLM provider (use `.env` or env var `CODE2DOCS_LLM_API_KEY`)",
6060
"api_base": "Custom API base URL (for self-hosted or proxy endpoints)",
6161
"max_tokens": "Maximum tokens per LLM call",

code2docs/generators/examples_gen.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
2-
3-
PORT_4 = 4
4-
CONSTANT_5 = 5
5-
CONSTANT_50 = 50
6-
7-
PORT_4 = 4
8-
CONSTANT_5 = 5
9-
CONSTANT_50 = 50
10-
111
"""Auto-generate usage examples from public signatures and entry points."""
122

133
from pathlib import Path
14-
from typing import Dict, List, Optional, Set
4+
from typing import Dict, List, Optional, Set, Type
155

166
from code2llm.api import AnalysisResult, FunctionInfo, ClassInfo
177

188
from ..config import Code2DocsConfig
199

20-
# Default type hints → example values
10+
# Constants
11+
CONSTANT_50 = 50
2112

22-
if __name__ == "__main__":
23-
_TYPE_EXAMPLES = {
13+
# Default type hints → example values
14+
_TYPE_EXAMPLES = {
2415
"str": '"./my-project"',
2516
"Path": 'Path("./my-project")',
2617
"int": "10",
@@ -35,7 +26,7 @@
3526
}
3627

3728
# Arg name → realistic example value
38-
_ARG_EXAMPLES = {
29+
_ARG_EXAMPLES = {
3930
"project_path": '"./my-project"',
4031
"path": '"./my-project"',
4132
"source": '"./src"',

0 commit comments

Comments
 (0)