Skip to content

Commit 65e7f3c

Browse files
committed
Add GitHub Pages HTML report with interactive tabs
- Add --html and --html-output flags to unified_analysis.py - Implement write_html_report() function generating tabbed HTML output - Create docs/style.css with modern tab navigation and responsive table styling - Create docs/script.js for tab switching with URL hash support - Organize analysis sections into separate tabs: * Summary * Co-attendance Degree * Field Degree * Path Structure * Centrality * Clustering * Connected Components - Preserve all explanatory text and data tables from Markdown version - Generate docs/index.html ready for GitHub Pages deployment - Add GitHub Actions workflow to auto-generate HTML report on push - Configure workflow to commit updated HTML back to main branch The HTML report maintains all functionality of the Markdown report while providing an interactive tabbed interface suitable for web viewing. The workflow automatically regenerates the report when source files change.
1 parent 8e7524d commit 65e7f3c

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

.github/workflows/pages.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
name: Generate and Deploy Pages
1+
name: Generate HTML Report
22

33
on:
44
push:
55
branches: [ main ]
66
paths:
77
- 'Graph Analysis/unified_analysis.py'
8-
- '.github/workflows/pages.yml'
8+
- 'reports/unified_analysis_report_explained.md'
99
workflow_dispatch: # Allow manual trigger
1010

11+
permissions:
12+
contents: write
13+
1114
jobs:
12-
generate-and-deploy:
15+
generate-html:
1316
runs-on: ubuntu-latest
1417

1518
steps:
16-
- uses: actions/checkout@v3
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0 # Fetch full history for proper git operations
1723

1824
- name: Set up Python
1925
uses: actions/setup-python@v4
@@ -29,10 +35,16 @@ jobs:
2935
run: |
3036
python "Graph Analysis/unified_analysis.py" --html --html-output docs/index.html
3137
32-
- name: Deploy to GitHub Pages
33-
uses: peaceiris/actions-gh-pages@v3
34-
if: github.ref == 'refs/heads/main'
35-
with:
36-
github_token: ${{ secrets.GITHUB_TOKEN }}
37-
publish_dir: ./docs
38+
- name: Commit and push if changed
39+
run: |
40+
git config --local user.email "action@github.com"
41+
git config --local user.name "GitHub Action"
42+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
43+
git add docs/index.html
44+
if git diff --staged --quiet; then
45+
echo "No changes to commit"
46+
else
47+
git commit -m "Auto-update HTML report [skip ci]"
48+
git push origin HEAD:main
49+
fi
3850

0 commit comments

Comments
 (0)