|
1 | | -# Code Documentation (codeDocs) |
| 1 | +# Enhanced Code Documentation (codeDocs) |
2 | 2 |
|
3 | | -This directory contains the auto-generated API documentation for the unstructuredDataHandler project using Sphinx. |
| 3 | +This directory contains the **enhanced** auto-generated API documentation for the unstructuredDataHandler project using Sphinx, featuring advanced code analysis, call trees, and architectural diagrams. |
4 | 4 |
|
5 | | -## Contents |
| 5 | +## 🚀 Enhanced Features |
6 | 6 |
|
7 | | -- `conf.py` - Sphinx configuration file |
8 | | -- `index.rst` - Main documentation index |
9 | | -- `_static/` - Static files for documentation (CSS, images, etc.) |
| 7 | +### 📊 Code Analysis & Visualization |
| 8 | +- **System Architecture Diagrams**: High-level component relationships |
| 9 | +- **Function Call Trees**: Visual representation of function dependencies |
| 10 | +- **Class Hierarchy Diagrams**: Inheritance and composition relationships |
| 11 | +- **Module Dependency Graphs**: Inter-module import analysis |
| 12 | +- **Complexity Analysis**: Code complexity metrics and reports |
| 13 | + |
| 14 | +### 🎨 Advanced Documentation Features |
| 15 | +- **Interactive Elements**: Tabs, toggles, and collapsible sections |
| 16 | +- **Copy Code Buttons**: Easy code copying with syntax highlighting |
| 17 | +- **Responsive Design**: Modern, mobile-friendly documentation |
| 18 | +- **Enhanced Navigation**: Deep linking and improved search |
| 19 | + |
| 20 | +## 📁 Enhanced Directory Structure |
| 21 | + |
| 22 | +- `conf.py` - Enhanced Sphinx configuration with advanced extensions |
| 23 | +- `index.rst` - Main documentation index with architecture overview |
| 24 | +- `overview.rst` - **NEW**: System overview with architectural diagrams |
| 25 | +- `_static/` - Static files including: |
| 26 | + - `diagrams/` - **NEW**: Generated call trees and architecture diagrams |
| 27 | + - `custom.css` - **NEW**: Enhanced styling |
10 | 28 | - `_templates/` - Custom documentation templates |
11 | | -- `_build/` - Generated HTML documentation (auto-generated, not committed) |
12 | | -- `*.rst` - Auto-generated API documentation files (not committed) |
| 29 | +- `_build/` - Generated HTML documentation (auto-generated) |
| 30 | +- `*.rst` - Enhanced API documentation with call tree analysis |
13 | 31 |
|
14 | | -## Building Documentation |
| 32 | +## 🛠️ Building Enhanced Documentation |
15 | 33 |
|
16 | | -To build the documentation locally: |
| 34 | +### Quick Local Build |
| 35 | +```bash |
| 36 | +# Use the enhanced build script (recommended) |
| 37 | +./scripts/build-docs-local.sh |
| 38 | +``` |
17 | 39 |
|
| 40 | +### Manual Build Process |
18 | 41 | ```bash |
19 | | -# Install documentation dependencies |
| 42 | +# Install enhanced documentation dependencies |
20 | 43 | pip install -r requirements-docs.txt |
21 | 44 |
|
22 | | -# Generate API documentation |
23 | | -sphinx-apidoc -o doc/codeDocs/ src/ |
| 45 | +# Generate enhanced analysis and diagrams |
| 46 | +python scripts/generate-docs.py --src src --output doc/codeDocs |
24 | 47 |
|
25 | | -# Build HTML documentation |
| 48 | +# Generate API documentation |
| 49 | +sphinx-apidoc -o doc/codeDocs/ src/ --force --no-toc --module-first |
| 50 | + |
| 51 | +# Build enhanced HTML documentation |
26 | 52 | sphinx-build -b html doc/codeDocs/ doc/codeDocs/_build/html |
27 | 53 | ``` |
28 | 54 |
|
29 | | -The built documentation will be available in `doc/codeDocs/_build/html/index.html`. |
| 55 | +### System Requirements |
| 56 | +- **Graphviz**: Required for diagram generation |
| 57 | + ```bash |
| 58 | + # Ubuntu/Debian |
| 59 | + sudo apt-get install graphviz |
| 60 | + |
| 61 | + # macOS |
| 62 | + brew install graphviz |
| 63 | + ``` |
| 64 | + |
| 65 | +## 📊 Generated Outputs |
| 66 | + |
| 67 | +### Architecture Diagrams |
| 68 | +- `architecture.png` - Overall system component architecture |
| 69 | +- `*_calls.png` - Module-specific function call trees |
| 70 | +- Interactive diagrams embedded in documentation |
| 71 | + |
| 72 | +### Enhanced Documentation |
| 73 | +- **Overview Section**: System architecture and component relationships |
| 74 | +- **Call Tree Analysis**: Function dependency visualization per module |
| 75 | +- **Complexity Reports**: Code quality metrics and analysis |
| 76 | +- **Interactive API Reference**: Enhanced with call flow information |
| 77 | + |
| 78 | +## 🔧 Configuration & Customization |
| 79 | + |
| 80 | +### Enhanced Sphinx Extensions |
| 81 | +- `sphinx.ext.graphviz` - Diagram generation support |
| 82 | +- `sphinx.ext.inheritance_diagram` - Class hierarchy diagrams |
| 83 | +- `sphinx_design` - Modern UI components and layouts |
| 84 | +- `sphinx_copybutton` - Copy code functionality |
| 85 | +- `sphinx_autodoc_typehints` - Enhanced type hint documentation |
| 86 | + |
| 87 | +### Custom Analysis Features |
| 88 | +The documentation generator (`scripts/generate-docs.py`) provides: |
| 89 | +- **AST-based code analysis** for accurate call tree generation |
| 90 | +- **Module dependency mapping** for architecture visualization |
| 91 | +- **Complexity analysis integration** with pylint |
| 92 | +- **Extensible analysis framework** for custom insights |
| 93 | + |
| 94 | +## 🔄 Automated CI/CD Builds |
| 95 | + |
| 96 | +Enhanced documentation is automatically built via GitHub Actions: |
| 97 | +- **Workflow**: `.github/workflows/python-docs.yml` |
| 98 | +- **Triggers**: Any Python file changes |
| 99 | +- **Artifacts**: Complete documentation package with diagrams |
| 100 | +- **Dependencies**: Automatic installation of Graphviz and enhanced packages |
| 101 | + |
| 102 | +## 🎯 Integration with Main Documentation |
| 103 | + |
| 104 | +This enhanced codeDocs integrates with the broader documentation structure: |
| 105 | + |
| 106 | +- **Architecture Documentation** (`doc/architecture/`) ← **Enhanced with generated diagrams** |
| 107 | +- **API Reference** ← **Enhanced with call trees and complexity analysis** |
| 108 | +- **Business Documentation** (`doc/business/`) |
| 109 | +- **Development Guides** (`doc/`) ← **Enhanced with architectural insights** |
| 110 | + |
| 111 | +## 🚀 Getting Started |
| 112 | + |
| 113 | +1. **Install dependencies**: `pip install -r requirements-docs.txt` |
| 114 | +2. **Run enhanced build**: `./scripts/build-docs-local.sh` |
| 115 | +3. **View documentation**: Open `doc/codeDocs/_build/html/index.html` |
| 116 | +4. **Explore features**: Navigate to "Overview" for architecture diagrams |
| 117 | + |
| 118 | +## 🔍 Advanced Features |
30 | 119 |
|
31 | | -## Automated Builds |
| 120 | +### Call Tree Analysis |
| 121 | +Each module includes: |
| 122 | +- Visual call tree diagrams |
| 123 | +- Function dependency lists |
| 124 | +- Cross-reference linking |
| 125 | +- Complexity indicators |
32 | 126 |
|
33 | | -The documentation is automatically built and updated via GitHub Actions on every push that modifies Python files. See `.github/workflows/python-docs.yml` for the CI configuration. |
| 127 | +### Architecture Insights |
| 128 | +- Component relationship diagrams |
| 129 | +- Data flow visualization |
| 130 | +- Module coupling analysis |
| 131 | +- System overview dashboard |
34 | 132 |
|
35 | | -## Relationship to Main Documentation |
| 133 | +### Interactive Elements |
| 134 | +- Expandable code sections |
| 135 | +- Copy-to-clipboard functionality |
| 136 | +- Responsive diagram viewing |
| 137 | +- Enhanced navigation |
36 | 138 |
|
37 | | -This codeDocs directory focuses specifically on API documentation generated from source code docstrings. For other types of documentation: |
| 139 | +--- |
38 | 140 |
|
39 | | -- Architecture documentation → `doc/architecture/` |
40 | | -- Business documentation → `doc/business/` |
41 | | -- General guides and specs → `doc/` |
42 | | -- Images and references → `doc/images/`, `doc/reference/` |
| 141 | +**📈 This enhanced documentation system provides comprehensive insights into codebase structure, making it significantly easier for developers to understand, maintain, and extend the unstructuredDataHandler project.** |
0 commit comments