import fs from 'fs'; import path from 'path'; const base = 'C:/Users/lk-lo/youtube/drehbuecher/lieder'; const dirs = fs.readdirSync(base).filter(d => d.startsWith('lied')).sort(); const songs = dirs.map(d => ({id: d, md: fs.readFileSync(path.join(base, d, 'de.md'), 'utf8')})); const plan = fs.readFileSync(path.join(base, 'plan.md'), 'utf8'); songs.push({id: 'plan', md: plan}); const titles = songs.map(s => (s.md.match(/^#\s+(.+)$/m) || [, s.id])[1].replace(/^Lied \d+:\s*/, '')); const html = `