docs: md 2 html for confluence

This commit is contained in:
ISA
2025-09-19 11:48:59 +02:00
parent 76280b365b
commit 3d0ce4a2b4
238 changed files with 8790 additions and 5 deletions

View File

@@ -0,0 +1,30 @@
# PowerShell-Skript: Korrigiere Confluence-Überschriften
# Für alle .confluence.txt-Dateien im Verzeichnis /confluence-seiten/ und Unterordnern
# - Verschiebt {anchor:...} in eine eigene Zeile vor die Überschrift
# - Überschriften wie h1., h2., ... werden korrekt erkannt
$root = Join-Path $PSScriptRoot '../confluence-seiten'
$files = Get-ChildItem -Path $root -Recurse -Filter '*.confluence.txt'
foreach ($file in $files) {
$lines = Get-Content $file.FullName
$newLines = @()
foreach ($line in $lines) {
# Nur Zeilen mit hX. {anchor:...}...
if ($line -match '^(h[1-6]\. )\{anchor:([^}]+)\}(.*)$') {
$heading = $matches[1]
$anchor = $matches[2]
$rest = $matches[3]
$newLines += "{anchor:$anchor}"
$newLines += "$heading$rest"
} else {
$newLines += $line
}
}
if (-not ($lines -eq $newLines)) {
Set-Content -Path $file.FullName -Value $newLines -Encoding UTF8
Write-Host "Korrigiert: $($file.FullName)"
}
}
Write-Host "Fertig. Alle Überschriften im Confluence-Wiki-Format korrigiert."