import { resolve } from 'node:path'
import { parser } from '@slidev/cli'

const data = await parser.load(resolve('.'), resolve('slides.md'))
console.log('slides:', data.slides.length)
for (let i = 0; i < data.slides.length; i++) {
  const s = data.slides[i]
  const first = (s.content || '').split(/\r?\n/).find(l => l.trim() && !l.trim().startsWith('<!--')) || '[no text]'
  const name = s.frontmatter?.name ? ` name=${s.frontmatter.name}` : ''
  console.log(`${String(i + 1).padStart(2, '0')}\t${first.slice(0, 80)}${name}`)
}
