#!/usr/bin/env node // Build the pitch slideshow from its slide sources: web_docs/deck/slides/NN-.html, one
per slide with // the speaker notes in its
', `\n`) + '\n').join('\n') const tail = ` ` const md = ['---', 'title: The pitch, full text and notes', 'sidebar_label: Pitch (full text)', 'format: md', '---', '', '# CommunityOne · Open Navigator: the pitch, full text and notes', '', `${NOTE} [Open the slideshow](${DOCS}/deck/). Built from \`web_docs/deck/slides/\` by ` + '`web_docs/scripts/build-deck.mjs`; edit the slides, then rebuild.', ''] all.forEach((s, i) => { md.push(`## Slide ${i + 1}: ${mdSafe(heading(s))}`, '', ...visibleText(s.section).map(mdSafe).map((l) => `${l} `), '') if (s.notes) md.push(`**Speaker notes:** ${mdSafe(unesc(s.notes.replace(/<[^>]+>/g, '')))}`, '') }) return { html: head + body + tail, md: md.join('\n') } } const { html, md } = render() if (process.argv.includes('--check')) { const stale = [[OUT_HTML, html], [OUT_MD, md]].filter(([p, want]) => !existsSync(p) || readFileSync(p, 'utf8') !== want) if (stale.length) { console.error(`deck out of date: ${stale.map(([p]) => p.slice(WEB_DOCS.length + 1)).join(', ')}. ` + 'Run: node web_docs/scripts/build-deck.mjs') process.exit(1) } console.log('deck up to date') } else { for (const [p, text] of [[OUT_HTML, html], [OUT_MD, md]]) { mkdirSync(dirname(p), { recursive: true }) writeFileSync(p, text) } console.log(`built ${slides().length} slides: static/deck/index.html, docs/pitch/full-text-and-notes.md`) }