Files
nodeMap/convert-md-to-confluence.ps1
2025-09-19 11:48:59 +02:00

20 lines
961 B
PowerShell

# PowerShell-Skript: Markdown zu Confluence-Wiki konvertieren
# Rekursiv alle .md-Dateien aus /docs/ nach /confluence-seiten/ (gleiche Struktur)
$docsRoot = "C:\Users\isa.LTW\Desktop\17.09.2025\NodeMap\17.09.2025 NodeMap V1.1.350\docs"
$outRoot = "C:\Users\isa.LTW\Desktop\17.09.2025\NodeMap\17.09.2025 NodeMap V1.1.350\confluence-seiten"
# Alle .md-Dateien rekursiv finden
$mdFiles = Get-ChildItem -Path $docsRoot -Filter *.md -Recurse
foreach ($md in $mdFiles) {
$relPath = $md.FullName.Substring($docsRoot.Length).TrimStart('\','/')
$outPath = Join-Path $outRoot ($relPath -replace ".md$", ".confluence.txt")
$outDir = Split-Path $outPath -Parent
if (-not (Test-Path $outDir)) { New-Item -ItemType Directory -Path $outDir | Out-Null }
Write-Host "Konvertiere: $($md.FullName) -> $outPath"
pandoc "$($md.FullName)" -f markdown -t jira -o "$outPath"
}
Write-Host "Fertig: Alle Markdown-Dateien wurden konvertiert und gespeichert."