Skip to content

Commit 5ade063

Browse files
committed
remove trash and update workflows
1 parent 1cf6723 commit 5ade063

17 files changed

+480
-817
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: 'Build Documentation'
2+
description: 'Build all documentation (main + examples) for jsoncrack-for-sphinx'
3+
outputs:
4+
site-path:
5+
description: 'Path to the built site'
6+
value: ${{ steps.build.outputs.site-path }}
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- name: Build main documentation
11+
shell: bash
12+
run: |
13+
cd docs
14+
sphinx-build -b html . _build/html
15+
16+
- name: Build examples documentation
17+
shell: bash
18+
run: |
19+
cd examples/docs
20+
sphinx-build -b html . _build/html
21+
22+
- name: Generate coverage badge
23+
shell: bash
24+
run: |
25+
pip install coverage-badge
26+
coverage-badge -o coverage.svg
27+
28+
- name: Run tests for badge generation
29+
shell: bash
30+
run: |
31+
pytest --tb=short -v --json-report --json-report-file=test_report.json > test_results.txt 2>&1 || true
32+
33+
- name: Generate test badges
34+
shell: bash
35+
run: |
36+
if [ -f ".github/scripts/generate_badges.py" ]; then
37+
python .github/scripts/generate_badges.py
38+
fi
39+
40+
- name: Prepare site structure
41+
id: build
42+
shell: bash
43+
run: |
44+
# Create main site structure
45+
mkdir -p _site
46+
cp -r docs/_build/html/* _site/
47+
48+
# Add coverage report
49+
mkdir -p _site/coverage
50+
cp -r htmlcov/* _site/coverage/
51+
52+
# Add examples
53+
mkdir -p _site/examples
54+
cp -r examples/docs/_build/html/* _site/examples/
55+
56+
# Add coverage badge
57+
cp coverage.svg _site/
58+
59+
# Create reports page
60+
if [ -f ".github/scripts/create-reports-page.sh" ]; then
61+
bash .github/scripts/create-reports-page.sh
62+
fi
63+
64+
echo "site-path=_site" >> $GITHUB_OUTPUT
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Setup Python Environment'
2+
description: 'Setup Python with dependencies for jsoncrack-for-sphinx'
3+
inputs:
4+
python-version:
5+
description: 'Python version to use'
6+
required: true
7+
install-dev:
8+
description: 'Install development dependencies'
9+
required: false
10+
default: 'true'
11+
runs:
12+
using: 'composite'
13+
steps:
14+
- name: Set up Python ${{ inputs.python-version }}
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: ${{ inputs.python-version }}
18+
19+
- name: Install dependencies
20+
shell: bash
21+
run: |
22+
python -m pip install --upgrade pip
23+
if [ "${{ inputs.install-dev }}" == "true" ]; then
24+
pip install -r requirements-dev.txt
25+
else
26+
pip install -e .
27+
fi
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
#!/bin/bash
2+
# Create beautiful reports index page
3+
4+
cat > _site/reports.html << 'EOF'
5+
<!DOCTYPE html>
6+
<html>
7+
<head>
8+
<title>JSONCrack Sphinx Extension - Reports</title>
9+
<meta charset="utf-8">
10+
<meta name="viewport" content="width=device-width, initial-scale=1">
11+
<style>
12+
body {
13+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
14+
margin: 0;
15+
padding: 40px;
16+
background: #f8f9fa;
17+
}
18+
.container {
19+
max-width: 1200px;
20+
margin: 0 auto;
21+
background: white;
22+
padding: 40px;
23+
border-radius: 12px;
24+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
25+
}
26+
h1 {
27+
color: #2563eb;
28+
text-align: center;
29+
margin-bottom: 40px;
30+
font-size: 2.5em;
31+
}
32+
.grid {
33+
display: grid;
34+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
35+
gap: 30px;
36+
margin-top: 40px;
37+
}
38+
.card {
39+
border: 1px solid #e5e7eb;
40+
border-radius: 12px;
41+
padding: 30px;
42+
background: white;
43+
transition: all 0.3s ease;
44+
border-left: 4px solid #2563eb;
45+
}
46+
.card:hover {
47+
transform: translateY(-2px);
48+
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
49+
}
50+
.card h2 {
51+
margin-top: 0;
52+
color: #1f2937;
53+
font-size: 1.5em;
54+
}
55+
.card p {
56+
color: #6b7280;
57+
line-height: 1.6;
58+
margin-bottom: 20px;
59+
}
60+
.badge {
61+
display: inline-block;
62+
padding: 8px 16px;
63+
border-radius: 6px;
64+
color: white;
65+
text-decoration: none;
66+
font-weight: 500;
67+
transition: all 0.2s ease;
68+
}
69+
.badge:hover {
70+
transform: translateY(-1px);
71+
text-decoration: none;
72+
}
73+
.badge.primary { background: #2563eb; }
74+
.badge.success { background: #10b981; }
75+
.badge.info { background: #06b6d4; }
76+
.meta {
77+
text-align: center;
78+
margin-top: 40px;
79+
padding-top: 30px;
80+
border-top: 1px solid #e5e7eb;
81+
color: #6b7280;
82+
}
83+
.badges {
84+
display: flex;
85+
justify-content: center;
86+
gap: 10px;
87+
flex-wrap: wrap;
88+
margin-top: 20px;
89+
}
90+
.badges img {
91+
height: 20px;
92+
}
93+
</style>
94+
</head>
95+
<body>
96+
<div class="container">
97+
<h1>📊 JSONCrack Sphinx Extension</h1>
98+
<p style="text-align: center; font-size: 1.1em; color: #6b7280;">
99+
Comprehensive reports and documentation for the JSONCrack Sphinx Extension
100+
</p>
101+
102+
<div class="grid">
103+
<div class="card">
104+
<h2>📚 Main Documentation</h2>
105+
<p>Complete documentation including installation, configuration, and usage guides.</p>
106+
<a href="index.html" class="badge primary">View Documentation</a>
107+
</div>
108+
109+
<div class="card">
110+
<h2>📊 Coverage Report</h2>
111+
<p>Detailed code coverage analysis from automated tests.</p>
112+
<a href="coverage/index.html" class="badge success">View Coverage</a>
113+
</div>
114+
115+
<div class="card">
116+
<h2>🔬 Live Examples</h2>
117+
<p>Interactive examples and usage demonstrations.</p>
118+
<a href="examples/index.html" class="badge info">View Examples</a>
119+
</div>
120+
</div>
121+
122+
<div class="meta">
123+
<p>Generated on: $(date)</p>
124+
<div class="badges">
125+
<img src="https://github.com/miskler/jsoncrack-for-sphinx/actions/workflows/test.yml/badge.svg" alt="Tests">
126+
<img src="coverage.svg" alt="Coverage">
127+
<img src="https://img.shields.io/pypi/v/jsoncrack-for-sphinx.svg" alt="PyPI">
128+
<img src="https://img.shields.io/pypi/pyversions/jsoncrack-for-sphinx.svg" alt="Python">
129+
</div>
130+
</div>
131+
</div>
132+
</body>
133+
</html>
134+
EOF
135+
136+
echo "✅ Reports page created at _site/reports.html"

.github/workflows/docs.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)