S05: build.ps1 erweitert um sichtbaren Fortschritt im PowerShell-Fenster (farbige Statuszeilen für Build-Phasen, Pandoc-Detail-Output bleibt nur im Log). Notes-Block aktualisiert (System-Fonts statt plex-otf-Paket). Teilgebiet 25 ergänzt um Doku der system-weiten Installation IBM Plex Sans v1.1.0, IBM Plex Mono v1.1.0 und IBM Plex Serif v1.1.0 (Release 2024-11-13, OTF, alle Benutzer) mit Quelle und Anlass; Offene-Punkte-Abschnitt entsprechend nachgezogen. Erster vollständiger Build des CV (PDF und DOCX) auf Thomas' MiKTeX-System lief erfolgreich durch.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
- PDF via Pandoc + LuaLaTeX, nutzt templates/template.tex
|
||||
- DOCX via Pandoc, nutzt templates/reference.docx
|
||||
- Log in output/build.log (überschrieben pro Build)
|
||||
- Fortschrittsausgaben werden zusätzlich in der Konsole angezeigt
|
||||
- Exit-Code 0 = beide Ausgaben erfolgreich, 1 = ein oder beide Schritte fehlgeschlagen
|
||||
|
||||
.NOTES
|
||||
@@ -15,9 +16,10 @@
|
||||
- Pandoc (im PATH)
|
||||
- MiKTeX mit LuaLaTeX und den Paketen fontspec, microtype, polyglossia,
|
||||
geometry, xcolor, hyperref, graphicx, enumitem, titlesec, fancyhdr,
|
||||
lastpage, xurl, plex-otf (für IBM Plex Sans).
|
||||
MiKTeX mit "Install missing packages on the fly: Yes" zieht Fehlende
|
||||
beim ersten Lauf automatisch.
|
||||
lastpage, xurl.
|
||||
- System-Fonts: IBM Plex Sans, IBM Plex Mono (für Windows installiert).
|
||||
MiKTeX mit "Install missing packages on the fly: Yes" zieht fehlende
|
||||
LaTeX-Pakete beim ersten Lauf automatisch.
|
||||
#>
|
||||
|
||||
$ErrorActionPreference = 'Continue'
|
||||
@@ -42,35 +44,48 @@ if (-not (Test-Path $outputDir)) {
|
||||
|
||||
# --- Log initialisieren (UTF-8 ohne BOM) --------------------------------------
|
||||
$utf8NoBom = New-Object System.Text.UTF8Encoding $false
|
||||
[System.IO.File]::WriteAllText($logFile, '', $utf8NoBom)
|
||||
|
||||
# Schreibt nur in die Log-Datei (für Pandoc-Ausgaben und Detail-Zeilen)
|
||||
function Write-Log {
|
||||
param([string]$Line)
|
||||
[System.IO.File]::AppendAllText($logFile, $Line + [Environment]::NewLine, $utf8NoBom)
|
||||
}
|
||||
[System.IO.File]::WriteAllText($logFile, '', $utf8NoBom)
|
||||
|
||||
Write-Log "===== Build gestartet: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') ====="
|
||||
Write-Log "Source: $sourceFile"
|
||||
Write-Log "Template-TEX: $templateTex"
|
||||
Write-Log "Reference: $referenceDoc"
|
||||
Write-Log "Output-Dir: $outputDir"
|
||||
Write-Log ''
|
||||
# Schreibt auf Konsole UND in die Log-Datei (für Fortschritts-Meilensteine)
|
||||
function Write-Both {
|
||||
param(
|
||||
[string]$Line,
|
||||
[string]$Color = 'Gray'
|
||||
)
|
||||
Write-Host $Line -ForegroundColor $Color
|
||||
Write-Log $Line
|
||||
}
|
||||
|
||||
Write-Both ("===== Build gestartet: {0} =====" -f (Get-Date -Format 'yyyy-MM-dd HH:mm:ss')) 'Cyan'
|
||||
Write-Log "Source: $sourceFile"
|
||||
Write-Log "Template-TEX: $templateTex"
|
||||
Write-Log "Reference: $referenceDoc"
|
||||
Write-Log "Output-Dir: $outputDir"
|
||||
Write-Log ''
|
||||
|
||||
$overallExit = 0
|
||||
|
||||
# --- Pflichtdateien prüfen ----------------------------------------------------
|
||||
foreach ($f in @($sourceFile, $templateTex, $referenceDoc)) {
|
||||
if (-not (Test-Path $f)) {
|
||||
Write-Log "FEHLER: Pflichtdatei fehlt: $f"
|
||||
Write-Both "FEHLER: Pflichtdatei fehlt: $f" 'Red'
|
||||
$overallExit = 1
|
||||
}
|
||||
}
|
||||
if ($overallExit -ne 0) {
|
||||
Write-Log "===== Abbruch: Pflichtdateien fehlen ====="
|
||||
Write-Both '===== Abbruch: Pflichtdateien fehlen =====' 'Red'
|
||||
exit $overallExit
|
||||
}
|
||||
|
||||
# --- PDF-Build ----------------------------------------------------------------
|
||||
Write-Log '--- Pandoc -> PDF (LuaLaTeX) ---'
|
||||
Write-Both '' 'Gray'
|
||||
Write-Both '[1/2] PDF wird erzeugt (Pandoc + LuaLaTeX) ...' 'Yellow'
|
||||
$pdfArgs = @(
|
||||
'--from=markdown+smart',
|
||||
'--pdf-engine=lualatex',
|
||||
@@ -85,15 +100,15 @@ $pdfExit = $LASTEXITCODE
|
||||
$pdfOutput | ForEach-Object { Write-Log ([string]$_) }
|
||||
if ($pdfExit -eq 0 -and (Test-Path $outputPdf)) {
|
||||
$sizeKB = [math]::Round((Get-Item $outputPdf).Length / 1KB, 1)
|
||||
Write-Log "PDF OK: $outputPdf ($sizeKB KB)"
|
||||
Write-Both " PDF OK ($sizeKB KB): $outputPdf" 'Green'
|
||||
} else {
|
||||
Write-Log "PDF FEHLER (Exit $pdfExit)"
|
||||
Write-Both " PDF FEHLER (Exit $pdfExit) — Details siehe build.log" 'Red'
|
||||
$overallExit = 1
|
||||
}
|
||||
Write-Log ''
|
||||
|
||||
# --- DOCX-Build ---------------------------------------------------------------
|
||||
Write-Log '--- Pandoc -> DOCX ---'
|
||||
Write-Both '' 'Gray'
|
||||
Write-Both '[2/2] DOCX wird erzeugt (Pandoc) ...' 'Yellow'
|
||||
$docxArgs = @(
|
||||
'--from=markdown+smart',
|
||||
"--reference-doc=$referenceDoc",
|
||||
@@ -107,13 +122,18 @@ $docxExit = $LASTEXITCODE
|
||||
$docxOutput | ForEach-Object { Write-Log ([string]$_) }
|
||||
if ($docxExit -eq 0 -and (Test-Path $outputDocx)) {
|
||||
$sizeKB = [math]::Round((Get-Item $outputDocx).Length / 1KB, 1)
|
||||
Write-Log "DOCX OK: $outputDocx ($sizeKB KB)"
|
||||
Write-Both " DOCX OK ($sizeKB KB): $outputDocx" 'Green'
|
||||
} else {
|
||||
Write-Log "DOCX FEHLER (Exit $docxExit)"
|
||||
Write-Both " DOCX FEHLER (Exit $docxExit) — Details siehe build.log" 'Red'
|
||||
$overallExit = 1
|
||||
}
|
||||
Write-Log ''
|
||||
|
||||
Write-Log "===== Build beendet: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss'), Exit-Code $overallExit ====="
|
||||
Write-Both '' 'Gray'
|
||||
$endTs = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
|
||||
if ($overallExit -eq 0) {
|
||||
Write-Both "===== Build beendet: $endTs, Exit-Code $overallExit (OK) =====" 'Cyan'
|
||||
} else {
|
||||
Write-Both "===== Build beendet: $endTs, Exit-Code $overallExit (FEHLER) =====" 'Red'
|
||||
}
|
||||
|
||||
exit $overallExit
|
||||
|
||||
Reference in New Issue
Block a user