Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:46:50 +08:00
commit a3a73d67d7
67 changed files with 19703 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
#!/usr/bin/env python3
"""Documentation generator - creates documentation from code and knowledge."""
import sys
import json
from pathlib import Path
from datetime import datetime
def generate_readme(project_path):
"""Generate README from project structure."""
package_json = project_path / 'package.json'
name = project_path.name
description = "Project description"
if package_json.exists():
with open(package_json) as f:
data = json.load(f)
name = data.get('name', name)
description = data.get('description', description)
readme = f"""# {name}
{description}
## Installation
\`\`\`bash
npm install
\`\`\`
## Usage
\`\`\`typescript
// Add usage examples here
\`\`\`
## Documentation
- [API Documentation](./docs/api/)
- [Architecture Decision Records](./docs/adr/)
- [Contributing Guidelines](./CONTRIBUTING.md)
## License
See LICENSE file.
---
*Generated by Documentation Wizard on {datetime.now().strftime('%Y-%m-%d')}*
"""
output = project_path / 'README.md'
with open(output, 'w') as f:
f.write(readme)
print(f"[OK] Generated: {output}")
def main():
project = Path(sys.argv[1] if len(sys.argv) > 1 else '.').resolve()
print(f"[NOTE] Generating documentation for: {project}\n")
generate_readme(project)
print("\n[OK] Documentation generated!")
if __name__ == '__main__':
main()