This system generates AI-powered presentation slides from lesson content for classroom teaching.
The presentation generation system follows the same pattern as the podcast generation:
- Parse lesson MDX content and extract clean text
- Generate condensed presentation slides using Claude Code CLI (Haiku 4.5)
- Output structured JSON with slides, speaker notes, and metadata
- Deploy presentations alongside the Docusaurus site
MDX Lesson → AI Processing → JSON Presentation → Reveal.js → Classroom Display
- generate-presentation.js - AI-powered script generator
- RevealSlideshow.tsx - Reveal.js wrapper component
- PresentationToggle.tsx - Toggle button for docs pages
- DocItem/Layout - Swizzled Docusaurus component that injects the toggle
# Interactive mode (select file)
node scripts/generate-presentation.js
# Generate for specific file
node scripts/generate-presentation.js --file intro.md
# Generate for all files in a module
node scripts/generate-presentation.js --module fundamentals
# Generate for all lessons
node scripts/generate-presentation.js --all
# Debug mode (saves AI prompt for inspection)
node scripts/generate-presentation.js --file intro.md --debug- In Development: Navigate to any lesson page and click the "Present" button (🎭)
- Keyboard Shortcut: Press
Pon any lesson page to toggle presentation mode - Exit: Press
ESCor click the close button (✕)
Press S while in presentation mode to open the speaker notes view, which shows:
- Talking points for current slide
- Timing guidance
- Discussion prompts
- Real-world context
- Transition notes for next slide
The AI generates different slide types based on content:
- Lesson title and subtitle
- Learning objectives
- Estimated duration
- Key idea with 3-5 bullet points
- Progressive reveal (fragment animation)
- Used for main teaching points
- Syntax-highlighted code block
- Caption explaining purpose
- Up to 15 lines for readability
- Side-by-side ineffective vs effective patterns
- Color-coded (red for bad, green for good)
- Shows contrast between approaches
- Custom React components (CapabilityMatrix, UShapeAttentionCurve, etc.)
- Interactive visualizations
- Caption explaining the visual
- Summary of section or lesson
- 3-5 main points
- Reinforces learning objectives
Add to frontmatter:
---
title: "Lesson Title"
presentation: false # Hides presentation button
---Edit RevealSlideshow.tsx to customize:
const deck = new Reveal(deckRef.current, {
width: 1280, // Presentation width
height: 720, // Presentation height
transition: 'slide', // Transition effect
slideNumber: 'c/t', // Current/total slide numbers
// ... more options
});The presentation prompt focuses on:
- Condensation: 8-15 slides per lesson (vs 50+ paragraphs in docs)
- Visual Focus: Bullet points, not paragraphs
- Speaker Notes: Detailed talking points for instructor
- Code Selection: Only most illustrative examples
- Logical Flow: Clear transitions between concepts
TASK: Convert technical course material into presentation format
TARGET AUDIENCE: Senior software engineers (3+ years)
PRESENTATION STRUCTURE:
✓ Create 8-15 slides total
✓ Each slide covers ONE key concept
✓ Use bullet points (3-5 per slide)
✓ Include speaker notes with timing, discussion prompts
✓ Preserve important code examples
✓ Identify visual components to use
OUTPUT FORMAT: Valid JSON with metadata and slides array
Located at:
scripts/output/presentations/manifest.json(build-time)website/static/presentations/manifest.json(deployed)
{
"intro.md": {
"presentationUrl": "/presentations/intro.json",
"slideCount": 12,
"estimatedDuration": "30-45 minutes",
"title": "AI Coding for Senior Engineers",
"generatedAt": "2025-01-09T12:00:00.000Z"
}
}Example: website/static/presentations/intro.json
{
"metadata": {
"title": "AI Coding for Senior Engineers",
"lessonId": "intro",
"estimatedDuration": "30-45 minutes",
"learningObjectives": [
"Understand the operator mindset for AI coding",
"Identify when to use agents vs write code manually",
"Apply Plan-Execute-Validate methodology"
]
},
"slides": [
{
"type": "title",
"title": "AI Coding for Senior Engineers",
"subtitle": "Master AI-assisted software engineering",
"content": [],
"speakerNotes": {
"talkingPoints": "Welcome students...",
"timing": "2 minutes",
"discussion": "Ask about their experience...",
"context": "This course was built using the same techniques...",
"transition": "Let's start by understanding the problem..."
}
},
{
"type": "concept",
"title": "The Operating Model Problem",
"content": [
"AI coding assistants are production-standard in 2025",
"Most developers hit frustration wall within weeks",
"Wrong mental model: treating AI as junior developer",
"Correct model: AI agents are power tools for code"
],
"speakerNotes": { ... }
}
]
}- P - Toggle presentation mode
- Arrow Keys - Navigate slides (Reveal.js)
- S - Open speaker notes view
- ESC - Exit presentation mode
- F - Fullscreen (browser)
- O - Overview mode (see all slides)
- Write detailed lesson content - AI will condense it
- Use clear headings (H2) to structure sections
- Include code examples with context
- Add admonitions (:::tip, :::warning) for important points
- Use visual components where appropriate
- Review speaker notes before class
- Practice timing on key concepts
- Use discussion prompts to engage students
- Reference real-world examples from speaker notes
- Adjust pace based on student questions
- Regenerate presentations after lesson updates
- Test presentation display on classroom projector
- Verify code examples are readable from distance
- Check that visual components render correctly
- Review speaker notes for accuracy
- Check manifest exists:
website/static/presentations/manifest.json - Verify lesson path matches manifest key
- Ensure
presentation: falseis not in frontmatter - Check browser console for errors
- Verify JSON structure is valid
- Check that visual component names match imports
- Test with simpler slide type first
- Review Reveal.js console errors
- Ensure speakerNotes field exists in JSON
- Check that all required fields are present
- Press
Sto toggle speaker view - Verify browser allows popups (for separate speaker window)
- Edit JSON to shorten code
- Regenerate with updated lesson content
- Split into multiple code slides
- Use caption to reference full code in docs
- Add type to TypeScript interface in
RevealSlideshow.tsx - Implement render case in
renderSlide()function - Add CSS styling in
RevealSlideshow.module.css - Update AI prompt to generate new type
- Test with sample lesson
Edit buildPresentationPrompt() in generate-presentation.js:
function buildPresentationPrompt(content, fileName, outputPath) {
return `You are a presentation script writer...
TASK: Convert technical course material...
PRESENTATION STRUCTURE REQUIREMENTS:
✓ DO: Create 8-15 slides total
✓ DO: Each slide should cover ONE key concept
// ... add your requirements
OUTPUT FORMAT: Valid JSON...`;
}- Generation Time: 30-60 seconds per lesson (depends on length)
- Bundle Size: Reveal.js adds ~60KB gzipped
- Slide Load Time: <100ms for typical presentation
- Speaker Notes: Minimal performance impact
Potential improvements:
- PDF export for offline use
- Custom themes per module
- Animation library for visual elements
- Live polling/quizzes embedded in slides
- Screen recording mode
- Accessibility improvements (ARIA labels, high contrast)
- Mobile presenter remote control
- Auto-advance with timings
- Slide annotations/drawing tools