Skip to content

Commit 85298cc

Browse files
Copilotvgoehler
andauthored
feat: add PDF generation workflow, liaex docs config, inject script, and Pages deployment
Agent-Logs-Url: https://github.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/sessions/f1a3a3a7-20c9-4dc2-a15f-1c8a7e793add Co-authored-by: vgoehler <1705385+vgoehler@users.noreply.github.com>
1 parent befcb89 commit 85298cc

6 files changed

Lines changed: 603 additions & 0 deletions

File tree

.github/workflows/deploy_pages.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'docs/**'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
deploy:
22+
name: Deploy to GitHub Pages
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Pages
32+
uses: actions/configure-pages@v5
33+
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: './docs'
38+
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: Generate PDFs and Deploy Docs
2+
3+
# Triggered by:
4+
# - push to master that changes lecture markdown files
5+
# - manual dispatch (regenerates PDFs for ALL lecture files)
6+
on:
7+
push:
8+
branches:
9+
- master
10+
paths:
11+
- '[0-9][0-9]_*.md'
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: pdf-generation
16+
cancel-in-progress: false
17+
18+
permissions:
19+
contents: write
20+
21+
jobs:
22+
# -------------------------------------------------------------------------
23+
# Job 1 – build PDFs and publish GitHub Releases
24+
# -------------------------------------------------------------------------
25+
generate_pdfs:
26+
name: Generate PDFs and create releases
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 2
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Detect changed lecture files (push) or select all (dispatch)
36+
id: changes
37+
run: |
38+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
39+
# Regenerate PDFs for every numbered lecture file
40+
files=$(ls [0-9][0-9]_*.md 2>/dev/null | tr '\n' ' ')
41+
else
42+
files=$(git diff --name-only HEAD^ HEAD \
43+
| grep -E '^[0-9]{2}_.*\.md$' || true)
44+
files="${files//$'\n'/ }"
45+
fi
46+
echo "changed_files=${files}" >> "$GITHUB_OUTPUT"
47+
echo "Files to process: ${files}"
48+
49+
- name: Set up Node.js
50+
if: steps.changes.outputs.changed_files != ''
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: '22'
54+
55+
- name: Install LiaScript exporter
56+
if: steps.changes.outputs.changed_files != ''
57+
run: npm install -g @liascript/exporter
58+
59+
- name: Generate PDFs and publish GitHub Releases
60+
if: steps.changes.outputs.changed_files != ''
61+
run: |
62+
set -euo pipefail
63+
mkdir -p /tmp/pdf_build
64+
65+
for file in ${{ steps.changes.outputs.changed_files }}; do
66+
[ -f "$file" ] || continue
67+
68+
filename=$(basename "$file" .md)
69+
70+
# Safe tag: lowercase, transliterate umlauts, remove non-ASCII
71+
safe_tag=$(echo "$filename" \
72+
| tr '[:upper:]' '[:lower:]' \
73+
| sed -e 's/ä/ae/g' -e 's/ö/oe/g' -e 's/ü/ue/g' -e 's/ß/ss/g' \
74+
-e 's/Ä/ae/g' -e 's/Ö/oe/g' -e 's/Ü/ue/g' \
75+
-e 's/[^a-z0-9_-]//g')
76+
77+
# Extract version from frontmatter (e.g. "version: 1.0.10")
78+
version=$(grep -oP 'version:\s*\K[\d.]+' "$file" | head -1 || echo "unknown")
79+
80+
asset_name="${filename}_v${version}_Documentation"
81+
release_tag="${safe_tag}_v${version}"
82+
83+
echo "==> $file (tag: $release_tag)"
84+
85+
# Generate PDF
86+
liaex \
87+
--input "$file" \
88+
--format pdf \
89+
--output "/tmp/pdf_build/${asset_name}" \
90+
--pdf-timeout 60000
91+
92+
pdf_path="/tmp/pdf_build/${asset_name}.pdf"
93+
94+
if [ ! -f "$pdf_path" ]; then
95+
echo "WARNING: PDF not created for $file – skipping release."
96+
continue
97+
fi
98+
99+
# Create or update the GitHub Release
100+
if gh release view "$release_tag" > /dev/null 2>&1; then
101+
echo "Release $release_tag already exists – uploading updated asset."
102+
gh release upload "$release_tag" "$pdf_path" --clobber
103+
else
104+
gh release create "$release_tag" \
105+
--title "PDF – ${filename} (v${version})" \
106+
--notes "Automated PDF export for \`${file}\` – version ${version}" \
107+
"$pdf_path"
108+
fi
109+
done
110+
env:
111+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113+
114+
# -------------------------------------------------------------------------
115+
# Job 2 – regenerate docs/index.html and inject PDF links
116+
# -------------------------------------------------------------------------
117+
deploy_docs:
118+
name: Build and deploy docs
119+
runs-on: ubuntu-latest
120+
needs: generate_pdfs
121+
steps:
122+
- name: Checkout repository
123+
uses: actions/checkout@v4
124+
with:
125+
token: ${{ secrets.GITHUB_TOKEN }}
126+
127+
- name: Set up Node.js
128+
uses: actions/setup-node@v4
129+
with:
130+
node-version: '22'
131+
132+
- name: Install LiaScript exporter
133+
run: npm install -g @liascript/exporter
134+
135+
- name: Set up Python
136+
uses: actions/setup-python@v5
137+
with:
138+
python-version: '3.x'
139+
140+
- name: Install Python dependencies
141+
run: pip install beautifulsoup4 requests
142+
143+
- name: Generate docs/index.html from course.yml
144+
run: |
145+
mkdir -p docs
146+
liaex \
147+
--input course.yml \
148+
--format project \
149+
--output docs/index \
150+
--project-category-blur
151+
152+
- name: Copy CSS into docs/
153+
run: cp linklayout.css docs/linklayout.css
154+
155+
- name: Inject PDF download links
156+
run: python inject_pdf_links.py docs/index.html docs/index.html
157+
158+
- name: Commit docs/ to repository
159+
run: |
160+
git config user.name "github-actions[bot]"
161+
git config user.email "github-actions[bot]@users.noreply.github.com"
162+
git add docs/
163+
if git diff --staged --quiet; then
164+
echo "No changes in docs/ – nothing to commit."
165+
else
166+
if ! git pull --rebase origin master; then
167+
echo "WARNING: git pull --rebase failed; attempting to push without rebase."
168+
fi
169+
git commit -m "ci: update docs/index.html with PDF links [skip ci]"
170+
git push
171+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ output/
99
bin/
1010
obj/
1111
.vscode/
12+
__pycache__/
13+
docs/index*.js

course.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
title: >
2+
<span style="background-color: rgba(0,106,179,0.75); padding: 5px; color: white">
3+
Vorlesung Softwareentwicklung
4+
</span>
5+
6+
comment: >
7+
<span style="color: rgb(0,106,179); background-color: rgba(255,255,255,0.85)">
8+
Arbeitsgruppe Softwareentwicklung und Robotik (TU Bergakademie Freiberg)
9+
</span>
10+
11+
logo: https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/Universitaetsbibliothek_Freiberg_Fassade.jpg/1024px-Universitaetsbibliothek_Freiberg_Fassade.jpg
12+
13+
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Logo_TU_Bergakademie_Freiberg.svg/242px-Logo_TU_Bergakademie_Freiberg.svg.png
14+
15+
footer: >
16+
Kontakt - Prof. Dr.-Ing. Sebastian Zug -
17+
<a href="https://tu-freiberg.de/fakult1/inf/professuren/softwaretechnologie-und-robotik" target="_blank">Lehrstuhl für Softwaretechnologie und Robotik</a>
18+
-
19+
<a href="mailto:Sebastian.Zug@informatik.tu-freiberg.de">Sebastian.Zug@informatik.tu-freiberg.de</a>
20+
21+
meta:
22+
title: VL Softwareentwicklung
23+
description: Vorlesungsmaterialien zur Lehrveranstaltung Softwareentwicklung (TU Bergakademie Freiberg)
24+
25+
collection:
26+
- title: Softwareentwicklung / Einführung in die Softwareentwicklung (SoSe 2026)
27+
comment: >
28+
<p>Die Lehrveranstaltung vermittelt Konzepte objektorientierter und interaktiver Programmierung,
29+
Syntax und Semantik der Programmiersprache C# sowie die Fähigkeiten, Probleme kollaborativ
30+
bei verteilter Verantwortlichkeit von Klassen zu lösen.</p>
31+
<p>Die „Quellcodes" aller Vorlesungsmaterialien finden Sie im zugehörigen
32+
<a href="https://github.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung">GitHub-Repository</a>.</p>
33+
grid: true
34+
tags:
35+
- C# / dotnet
36+
- Programmierparadigmen
37+
- Objektorientierung
38+
- Versionsverwaltung
39+
- GitHub
40+
- UML-Modellierung
41+
- Softwaretest
42+
- Entwurfsmuster
43+
collection:
44+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/00_Einfuehrung.md
45+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/01_Software.md
46+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/02_DotNet.md
47+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/03_CsharpGrundlagenI.md
48+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/04_CsharpGrundlagenII.md
49+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/05_CsharpGrundlagenIII.md
50+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/06_ProgrammflussUndFunktionen.md
51+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/07_OOPGrundlagenI.md
52+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/08_OOPGrundlagenII.md
53+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/09_Vererbung.md
54+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/10_AbstrakteKlassenUndInterfaces.md
55+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/11_Generics.md
56+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/12_Container.md
57+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/13_VersionsverwaltungI.md
58+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/14_VersionsverwaltungII.md
59+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/15_UML_Modellierung.md
60+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/16_UML_ModellierungII.md
61+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/17_UML_ModellierungIII.md
62+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/18_Dokumentation_BuildTools.md
63+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/19_Testen.md
64+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/20_ContinuousIntegration.md
65+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/21_Delegaten.md
66+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/22_Events.md
67+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/23_Threads.md
68+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/24_Tasks.md
69+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/25_DesignPattern.md
70+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/26_LINQ.md
71+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/27_MAUI.md
72+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/28_MAUI_II.md
73+
- url: https://raw.githubusercontent.com/TUBAF-IfI-LiaScript/VL_Softwareentwicklung/master/29_Anwendungen.md

0 commit comments

Comments
 (0)