@@ -75,25 +75,30 @@ jobs:
7575
7676 - name : Generate documentation
7777 run : |
78- cd vicutils
7978 echo "=== Generating documentation ==="
80- for file in *.py; do
81- if [ "$file" != "__init__.py" ] && [ -f "$file" ]; then
82- echo "Processing: $file"
83- python -m pdoc --html --force --output-dir . "${file%.py}"
84- echo "Contents after pdoc:"
85- ls -la
86- # Move generated HTML
87- if [ -d "${file%.py}" ]; then
88- echo "Moving ${file%.py}/index.html to ${file%.py}.html"
89- mv "${file%.py}"/index.html "${file%.py}.html"
90- rm -rf "${file%.py}"
91- fi
79+ # Find all Python files in vicutils subdirectories (not root)
80+ find vicutils/ -mindepth 2 -name "*.py" -not -name "__init__.py" | while read file; do
81+ echo "Processing: $file"
82+ dir=$(dirname "$file")
83+ basename=$(basename "$file" .py)
84+
85+ cd "$dir"
86+ python -m pdoc --html --force --output-dir . "$basename"
87+ echo "Contents after pdoc:"
88+ ls -la
89+
90+ # Move generated HTML
91+ if [ -d "$basename" ]; then
92+ echo "Moving $basename/index.html to $basename.html"
93+ mv "$basename"/index.html "$basename.html"
94+ rm -rf "$basename"
9295 fi
96+
97+ cd - > /dev/null
9398 done
94- cd ..
99+
95100 echo "=== Final vicutils contents ==="
96- ls -la vicutils/
101+ find vicutils/ -type f
97102
98103 - name : Build package
99104 run : |
@@ -116,7 +121,7 @@ jobs:
116121
117122 # Add all changes
118123 git add .version setup.py
119- git add vicutils/*.html || echo "No HTML files to add"
124+ git add vicutils/**/* .html || echo "No HTML files to add"
120125
121126 if git diff --staged --quiet; then
122127 echo "No changes to commit"
0 commit comments