Skip to content

Commit 90a310e

Browse files
author
Vic-Nas
committed
Refactored vicutils
1 parent 2e3dcc4 commit 90a310e

5 files changed

Lines changed: 22 additions & 17 deletions

File tree

.github/workflows/generate-vicutils-docs.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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"

script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function renderFolder() {
208208

209209
const items = getFolderFromTree(state.currentPath);
210210

211-
if (!items) {
211+
if (!items || items.length === 0) {
212212
view.innerHTML = '<p>Error loading folder</p>';
213213
return;
214214
}

0 commit comments

Comments
 (0)