Last updated: Aug 12, 2025, 01:18 PM UTC

PowerPoint Creator - Markdown to PowerPoint Conversion Enhancement

Project Context

You are working on the powerpoint-creator npm package (https://github.com/wapdat/powerpoint-creator), which is a Node.js CLI tool and library for generating professional PowerPoint presentations programmatically from JSON data. The package currently supports 7 slide types (title, text, chart, table, image, notes, custom) and uses PptxGenJS under the hood.

Primary Objective

Add comprehensive markdown to PowerPoint conversion functionality to the powerpoint-creator package, allowing users to convert markdown documents directly into professional PowerPoint presentations.

Requirements

1. Core Functionality

  • Add a new module src/markdown-converter.ts that parses markdown and converts it to the existing JSON structure
  • Support both CLI and programmatic API usage
  • Maintain backward compatibility with existing JSON-based functionality

2. Markdown Parsing Features

Implement intelligent parsing that recognizes and converts:

Document Structure

  • # H1 headers β†’ Title slides
  • ## H2 headers β†’ Section divider slides
  • ### H3 headers β†’ Content slide titles
  • Regular paragraphs β†’ Bullet points or text slides
  • Lists (ordered/unordered) β†’ Bullet slides with proper nesting

Data Elements

  • Markdown tables β†’ Table slides with professional formatting
  • Code blocks with data β†’ Chart slides (detect CSV/JSON data in code blocks)
  • Images ![alt](url) β†’ Image slides with captions
  • Blockquotes > β†’ Notes slides or emphasized text boxes

Advanced Features

  • YAML frontmatter for presentation metadata (title, author, theme, date)
  • Custom slide directives using HTML comments: <!-- slide: type="custom" layout="two-column" -->
  • Speaker notes using <!-- notes: ... --> or :::notes blocks
  • Page breaks --- or *** to force new slides

3. Smart Content Analysis

Implement intelligent content grouping:

  • Auto-split long content into multiple slides
  • Group related bullet points
  • Detect and preserve heading hierarchy
  • Smart truncation with continuation indicators
  • Maintain context across slide breaks

4. Chart Detection

Recognize and convert data patterns:

<!-- chart: type="bar" -->
| Month | Sales | Target |
|-------|-------|--------|
| Jan   | 1500  | 1200   |
| Feb   | 1800  | 1700   |

Or from code blocks:

Month,Sales,Target
Jan,1500,1200
Feb,1800,1700

5. CLI Enhancement

Add new CLI commands:

# Direct markdown conversion
powerpoint-creator --markdown input.md --output presentation.pptx

# With custom template
powerpoint-creator --markdown report.md --template corporate.pptx --output report.pptx

# Specify theme
powerpoint-creator --markdown content.md --theme dark --output slides.pptx

6. Programmatic API

import { PresentationGenerator, MarkdownConverter } from 'powerpoint-creator';

// Direct conversion
const converter = new MarkdownConverter();
const jsonData = await converter.convert(markdownContent, options);
const generator = new PresentationGenerator();
const pptx = await generator.generate(jsonData);

// Or simplified
import { markdownToPowerPoint } from 'powerpoint-creator';
const pptx = await markdownToPowerPoint(markdownContent, options);

7. Configuration Options

Support options for:

  • slidesPerPage: Max bullet points per slide
  • autoSplit: Enable/disable automatic content splitting
  • theme: Predefined themes (professional, dark, light, academic)
  • includeTableOfContents: Auto-generate TOC slide
  • slideNumbers: Add slide numbers
  • companyLogo: Add logo to all slides
  • footerText: Add footer text

8. Default Styling Rules

When converting markdown:

  • H1 β†’ Title slide with gradient background
  • H2 β†’ Section divider with accent color
  • Lists β†’ Professional bullet points with proper indentation
  • Tables β†’ Alternating row colors with header emphasis
  • Code blocks β†’ Monospace font with syntax highlighting background
  • Images β†’ Centered with professional borders

9. Example Conversions

Input Markdown:

# Q4 2024 Sales Report
**Author:** John Doe  
**Date:** January 2025

## Executive Summary

- Revenue exceeded targets by 15%
- New customer acquisition up 25%
- Market expansion successful in 3 regions

## Sales Performance

### Monthly Breakdown

| Month | Revenue | Target | Achievement |
|-------|---------|--------|-------------|
| Oct   | $1.5M   | $1.3M  | 115%        |
| Nov   | $1.8M   | $1.5M  | 120%        |
| Dec   | $2.1M   | $2.0M  | 105%        |

## Next Steps

1. Expand team by 20%
2. Launch new product line
3. Enter European market

Should Generate:

  • Slide 1: Title slide with "Q4 2024 Sales Report"
  • Slide 2: Section divider "Executive Summary"
  • Slide 3: Bullet points with the three summary items
  • Slide 4: Section divider "Sales Performance"
  • Slide 5: Table slide with monthly breakdown
  • Slide 6: Section divider "Next Steps"
  • Slide 7: Numbered list with three action items

10. Testing Requirements

  • Create comprehensive test suite for markdown parsing
  • Test various markdown flavors (CommonMark, GFM)
  • Ensure all existing JSON functionality still works
  • Add example markdown files in examples/markdown/
  • Create visual regression tests for generated presentations

11. Documentation Updates

  • Update README.md with markdown conversion examples
  • Add API documentation for new methods
  • Create a markdown conversion guide
  • Include best practices for markdown structure
  • Add troubleshooting section

12. Dependencies to Add

{
  "dependencies": {
    "marked": "^11.0.0",  // or remark for more advanced parsing
    "gray-matter": "^4.0.3",  // for frontmatter parsing
    "js-yaml": "^4.1.0"  // for YAML parsing
  }
}

Implementation Steps

  1. First, create the markdown parser module that converts markdown to an AST
  2. Then, create converters for each markdown element to slide JSON
  3. Next, implement smart content splitting and grouping logic
  4. After that, add CLI command support with proper error handling
  5. Then, create the simplified API methods
  6. Finally, write comprehensive tests and documentation

Success Criteria

  • Markdown files can be converted to presentations with a single command
  • The generated presentations look professional without manual editing
  • All markdown elements are properly converted to appropriate slide types
  • Long documents are intelligently split into digestible slides
  • The feature integrates seamlessly with existing JSON functionality
  • Performance is good (convert 100-page markdown in < 5 seconds)

Additional Considerations

  • Ensure the package remains lightweight and fast
  • Maintain backward compatibility with version 1.1.0
  • Follow TypeScript best practices and maintain type safety
  • Add proper error messages for unsupported markdown features
  • Consider adding a preview mode that shows JSON output before generation

Code Quality Requirements

  • Add JSDoc comments for all public methods
  • Maintain 80%+ test coverage
  • Follow existing code style and linting rules
  • Update version to 1.2.0 after implementation
  • Add examples showing markdown to PowerPoint conversion

This enhancement will make the powerpoint-creator package much more versatile, allowing users to quickly convert their markdown documentation, reports, and notes into professional presentations without manually creating JSON structures.