Skip to content

Commit 4f359fa

Browse files
author
GitHub Actions
committed
ci: Integrate hardware docs processing into build_pdf workflow
- Add hardware/** paths to workflow triggers - Install Jinja2 for hardware HTML generation - Add hardware documentation cleaning and processing steps - Use rsync to preserve hardware docs when copying Sphinx output - Consolidate all documentation build steps into single workflow
1 parent 9d51032 commit 4f359fa

2 files changed

Lines changed: 30 additions & 5 deletions

File tree

.github/workflows/build_pdf.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'software/documentation/**'
88
- 'software/sphinx/**'
99
- 'README.md'
10+
- 'hardware/**'
1011
- '.github/workflows/build_pdf.yml'
1112
pull_request:
1213
branches: [main]
1314
paths:
1415
- 'software/documentation/**'
1516
- 'software/sphinx/**'
1617
- 'README.md'
18+
- 'hardware/**'
1719
workflow_dispatch:
1820

1921
permissions:
@@ -38,6 +40,7 @@ jobs:
3840
sudo apt-get install -y texlive-latex-extra texlive-fonts-recommended texlive-lang-english ghostscript latexmk
3941
pip install -r software/documentation/requirements.txt
4042
pip install -r software/sphinx/requirements.txt
43+
pip install Jinja2
4144
4245
#################################################
4346
# Generar PDF del Product Brief con nombre del repo
@@ -53,6 +56,19 @@ jobs:
5356
-dNOPAUSE -dQUIET -dBATCH \
5457
-sOutputFile=build/${REPO_NAME}_product_brief.pdf build/*.pdf
5558
59+
#################################################
60+
# Procesar Documentación de Hardware
61+
#################################################
62+
- name: Clean previous hardware documentation
63+
run: |
64+
chmod +x .github/workflows/scripts/clean_docs.sh
65+
.github/workflows/scripts/clean_docs.sh
66+
67+
- name: Copy hardware files and generate HTML
68+
run: |
69+
chmod +x .github/workflows/scripts/build_docs.sh
70+
.github/workflows/scripts/build_docs.sh
71+
5672
#################################################
5773
# Generar Documentación Sphinx (HTML + PDF)
5874
#################################################
@@ -62,14 +78,19 @@ jobs:
6278
make clean
6379
make pdfx
6480
81+
- name: Add hardware link to Sphinx docs
82+
run: |
83+
chmod +x .github/workflows/scripts/add_hardware_link.sh
84+
.github/workflows/scripts/add_hardware_link.sh
85+
6586
#################################################
6687
# Preparar contenido para docs/
6788
#################################################
6889
- name: Prepare docs/ directory
6990
env:
7091
REPO_NAME: ${{ github.event.repository.name }}
7192
run: |
72-
rm -rf docs
93+
# Crear directorio docs si no existe (pero no eliminar hardware/)
7394
mkdir -p docs
7495
7596
# PDF generado desde LaTeX
@@ -78,8 +99,8 @@ jobs:
7899
# PDF generado por Sphinx
79100
cp software/sphinx/pdf/programmer.pdf docs/${REPO_NAME}_sphinx.pdf
80101
81-
# HTML generado por Sphinx
82-
cp -r software/sphinx/docs/* docs/
102+
# HTML generado por Sphinx (copiar archivos, no sobrescribir hardware/)
103+
rsync -av --exclude='hardware' --exclude='hardware.html' software/sphinx/docs/ docs/
83104
84105
# Permitir archivos especiales en GitHub Pages
85106
touch docs/.nojekyll

hardware/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div align="center">
44

55
<a href="/hardware/unit_sch_V_0_0_1_ue0090_CH552_USB_Multi-Protocol-Programmer.pdf">
6-
<img src="resources/Schematics_icon.jpg?raw=false" width="500px">
6+
<img src="resources/Schematics_icon.jpg?raw=false" width="300px">
77
<br/>
88
Schematics
99
</a>
@@ -119,6 +119,9 @@
119119

120120
### IDC-10 JST Header Pinout
121121

122+
<div align="center">
123+
124+
122125
| PIN | GPIO | Signal | Description |
123126
|:---:|:----:|:------:|:-----------|
124127
| 1 | 1.7 | SWCLK | SWD Clock / MOSI |
@@ -131,13 +134,14 @@
131134
| 8 | 3.0 | RXD | RXD (Optional) |
132135
| 9 | 1.5 | MOSI | MOSI (Optional) |
133136

137+
</div >
134138

135139
# Board Topology
136140

137141
<div align="center">
138142

139143
<a href="#">
140-
<img src="./resources/unit_topology_V_0_0_1_ue0090_CH552_USB_Multi-Protocol-Programmer.png" width="500px">
144+
<img src="./resources/unit_topology_V_0_0_1_ue0090_CH552_USB_Multi-Protocol-Programmer.png" width="900px">
141145
<br/>
142146
Topology
143147
</a>

0 commit comments

Comments
 (0)