Skip to content

Commit bad9403

Browse files
committed
🔧 Fix documentation generation and deployment issues
- Fix Doxygen nested directory structure issue - Update OUTPUT_DIRECTORY to 'html' to avoid nested structure - Add automatic file copying from html/html to docs/html for GitHub Pages - Update CI workflow to handle the new directory structure - Fix test script to properly detect and copy documentation files - Ensure index.html and all HTML files are generated correctly
1 parent 96bfaa1 commit bad9403

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,12 @@ jobs:
242242
243243
- name: Check documentation output
244244
run: |
245-
if [ -d "docs/html" ]; then
245+
if [ -d "html" ]; then
246246
echo "Documentation generated successfully"
247-
ls -la docs/html/
247+
ls -la html/
248+
# Move to docs/html for GitHub Pages
249+
mkdir -p docs/html
250+
cp -r html/* docs/html/
248251
else
249252
echo "Documentation directory not found, creating placeholder"
250253
mkdir -p docs/html

Doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ PROJECT_NAME = "ZLayout EDA Library"
1212
PROJECT_NUMBER = "v1.0.0"
1313
PROJECT_BRIEF = "Advanced Electronic Design Automation Layout Library with Bilingual Documentation"
1414
PROJECT_LOGO =
15-
OUTPUT_DIRECTORY = docs/html
16-
CREATE_SUBDIRS = YES
15+
OUTPUT_DIRECTORY = html
16+
CREATE_SUBDIRS = NO
1717
ALLOW_UNICODE_NAMES = YES
1818
OUTPUT_LANGUAGE = English
1919
BRIEF_MEMBER_DESC = YES

scripts/test_docs.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ def test_doxygen_generation():
3434
try:
3535
print("Generating documentation...")
3636
result = subprocess.run(['doxygen', 'Doxyfile'],
37-
capture_output=True, text=True, check=True)
37+
capture_output=True, text=True, check=True, encoding='utf-8')
3838
print("✅ Documentation generation completed successfully")
3939

4040
# Check if output directory was created
41-
output_dir = Path("docs/html")
41+
output_dir = Path("html")
4242
if output_dir.exists():
4343
print(f"✅ Output directory created: {output_dir}")
4444

@@ -53,6 +53,27 @@ def test_doxygen_generation():
5353
files = list(output_dir.glob("*.html"))
5454
print(f"✅ Generated {len(files)} HTML files")
5555

56+
# Also check docs/html if it exists (for CI compatibility)
57+
docs_html = Path("docs/html")
58+
if docs_html.exists():
59+
docs_files = list(docs_html.glob("*.html"))
60+
print(f"✅ Found {len(docs_files)} HTML files in docs/html")
61+
62+
# Copy files to docs/html for GitHub Pages deployment
63+
if not docs_html.exists():
64+
docs_html.mkdir(parents=True, exist_ok=True)
65+
66+
# Copy all files from html/html to docs/html
67+
import shutil
68+
nested_html = output_dir / "html"
69+
if nested_html.exists():
70+
for file_path in nested_html.rglob("*"):
71+
if file_path.is_file():
72+
relative_path = file_path.relative_to(nested_html)
73+
dest_path = docs_html / relative_path
74+
dest_path.parent.mkdir(parents=True, exist_ok=True)
75+
shutil.copy2(file_path, dest_path)
76+
print("✅ Copied documentation files to docs/html for GitHub Pages")
5677
else:
5778
print("❌ Output directory not created")
5879
return False

0 commit comments

Comments
 (0)