Skip to content

wapdat/powerpoint-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PowerPoint Creator 🎯

npm version License: MIT Node.js Version TypeScript

Transform structured JSON data into professional PowerPoint presentations with a single command. Perfect for automation, reporting, and bulk presentation generation.

🌟 Key Features

  • πŸ“ Markdown to PowerPoint - Convert markdown documents directly to presentations
  • πŸ“Š 7 Slide Layouts - Title, text, charts, tables, images, notes, and custom layouts
  • 🎨 Professional Themes - Business-ready color schemes and formatting
  • πŸ“ˆ Rich Charts - Bar, line, pie, area, scatter, doughnut, and radar charts
  • 🏒 Template Support - Apply corporate templates to maintain brand consistency
  • 🎯 Smart Content Detection - Automatically detects charts from CSV/table data
  • πŸ“ Perfect Spacing - Automatically positions content with professional margins
  • πŸ”„ Batch Processing - Generate multiple presentations programmatically
  • πŸ“„ PDF Export - Optional PDF generation via LibreOffice
  • βœ… No Repair Needed - Generates clean PPTX files that open without errors

πŸ“₯ Installation

Global Installation (Recommended)

npm install -g powerpoint-creator

Local Installation

npm install powerpoint-creator

Development

git clone https://github.com/wapdat/powerpoint-creator.git
cd powerpoint-creator
npm install
npm run build

πŸš€ Quick Start

Basic Usage

powerpoint-creator -i presentation.json -o output.pptx

Markdown to PowerPoint

powerpoint-creator -m document.md -o presentation.pptx

With Corporate Template

powerpoint-creator -i data.json -t company-template.pptx -o report.pptx

From STDIN

cat data.json | powerpoint-creator -o presentation.pptx

Generate PDF

powerpoint-creator -i slides.json -o deck.pptx --pdf

πŸ“ Markdown Support

Overview

PowerPoint Creator can convert markdown documents directly to presentations. It automatically:

  • Converts headings to slide titles and sections
  • Detects and creates charts from CSV data and tables
  • Formats lists, emphasis, and code blocks
  • Splits long content across multiple slides
  • Processes YAML frontmatter for metadata

Markdown Structure

---
title: Presentation Title
author: Your Name
company: Company Name
date: 2025-01-15
theme: professional
---

# Main Title Slide

## Section Divider

### Content Slide Title

- Bullet point 1
- Bullet point 2
- **Bold text**
- *Italic text*

### Data Table

| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Data 1   | Data 2   | Data 3   |

### Chart from CSV

\`\`\`csv
Month,Sales,Profit
Jan,100,20
Feb,120,25
Mar,150,35
\`\`\`

![Image Caption](image.png)

<!-- notes: Speaker notes go here -->

Conversion Rules

  • H1 (#) β†’ Title slides
  • H2 (##) β†’ Section dividers with colored background
  • H3 (###) β†’ New content slide or emphasized bullet
  • Lists β†’ Bullet points with proper indentation
  • Tables β†’ Table slides or charts (if numeric)
  • Code blocks β†’ Notes slides or charts (if CSV/JSON)
  • Images β†’ Image slides with captions
  • Blockquotes β†’ Notes slides
  • Horizontal rules (---) β†’ Slide breaks
  • HTML comments β†’ Speaker notes or directives

πŸ“‹ JSON Structure

Complete Presentation Example

{
  "title": "Q4 2024 Business Review",
  "author": "John Smith",
  "company": "Acme Corp",
  "slides": [
    {
      "layout": "title",
      "title": "Q4 2024 Results",
      "subtitle": "Record Breaking Quarter",
      "author": "Leadership Team",
      "date": "January 2025"
    },
    {
      "layout": "text",
      "title": "Key Achievements",
      "bullets": [
        "Revenue exceeded targets by 15%",
        "Launched 3 new products successfully",
        "Customer satisfaction increased to 92%"
      ]
    },
    {
      "layout": "chart",
      "title": "Revenue Growth",
      "chartType": "bar",
      "data": {
        "labels": ["Q1", "Q2", "Q3", "Q4"],
        "datasets": [{
          "label": "Revenue ($M)",
          "data": [45, 52, 58, 67]
        }]
      }
    },
    {
      "layout": "table",
      "title": "Regional Performance",
      "headers": ["Region", "Revenue", "Growth"],
      "tableData": [
        ["North America", "$30M", "+20%"],
        ["Europe", "$22M", "+15%"],
        ["Asia Pacific", "$15M", "+35%"]
      ]
    }
  ]
}

🎨 Slide Types

1. Title Slide

Creates opening or section divider slides with customizable backgrounds.

{
  "layout": "title",
  "title": "Main Title",
  "subtitle": "Subtitle Text",
  "author": "Presenter Name",
  "date": "January 2025",
  "backgroundColor": "#2C3E50",
  "notes": "Speaker notes here"
}

2. Text/Bullet Slide

Perfect for agendas, lists, and text-heavy content.

{
  "layout": "text",
  "title": "Agenda",
  "bullets": [
    "Introduction and Overview",
    "Q4 Performance Metrics",
    "Strategic Initiatives",
    "2025 Roadmap"
  ],
  "level": [0, 0, 1, 1],
  "notes": "Cover each point for 5 minutes"
}

3. Chart Slide

Visualize data with professional charts.

{
  "layout": "chart",
  "title": "Sales Performance",
  "chartType": "line",
  "data": {
    "labels": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
    "datasets": [
      {
        "label": "2024 Sales",
        "data": [30, 45, 60, 70, 85, 95]
      },
      {
        "label": "2023 Sales",
        "data": [25, 35, 45, 55, 65, 75]
      }
    ]
  },
  "options": {
    "showLegend": true,
    "legendPosition": "bottom"
  }
}

Supported Chart Types:

  • bar - Vertical bar charts
  • line - Line graphs
  • pie - Pie charts
  • area - Area charts
  • scatter - Scatter plots
  • doughnut - Doughnut charts
  • radar - Radar/spider charts

4. Table Slide

Display structured data in professional tables.

{
  "layout": "table",
  "title": "Project Status",
  "headers": ["Project", "Status", "Completion", "Owner"],
  "tableData": [
    ["Website Redesign", "On Track", "75%", "Sarah"],
    ["Mobile App", "At Risk", "45%", "John"],
    ["API Development", "Complete", "100%", "Mike"]
  ],
  "styling": {
    "headerBackground": "#2C3E50",
    "headerTextColor": "#FFFFFF",
    "alternateRows": true
  }
}

5. Image Slide

Include images with optional captions.

{
  "layout": "image",
  "title": "Product Screenshot",
  "imagePath": "./screenshots/dashboard.png",
  "caption": "New dashboard interface",
  "sizing": "contain",
  "notes": "Highlight the improved UX"
}

6. Notes Slide

Text-only slides for detailed notes.

{
  "layout": "notes",
  "title": "Implementation Notes",
  "content": "Detailed implementation plan:\n1. Phase 1: Planning\n2. Phase 2: Development\n3. Phase 3: Testing\n4. Phase 4: Deployment"
}

7. Custom Slide

Advanced layouts with positioned elements.

{
  "layout": "custom",
  "title": "Custom Layout",
  "elements": [
    {
      "type": "text",
      "content": "Custom positioned text",
      "x": 1,
      "y": 2,
      "width": 4,
      "height": 1
    },
    {
      "type": "shape",
      "content": {
        "type": "rect",
        "fill": "#3498DB"
      },
      "x": 6,
      "y": 2,
      "width": 3,
      "height": 3
    }
  ]
}

🎨 Professional Styling

Default Color Palette

The package applies a professional business color scheme automatically:

  • Primary: Dark blue-gray (#2C3E50)
  • Charts: Professional grayscale palette
  • Tables: Navy headers with clean alternating rows
  • Backgrounds: Sophisticated solid colors

Text Formatting

Use HTML tags in any text field:

  • <strong>Bold text</strong>
  • <em>Italic text</em>
  • <u>Underlined text</u>

Slide Dimensions

  • Format: 16:9 widescreen (10" Γ— 7.5")
  • Safe margins: 0.75" on all sides
  • Title area: 0.4" - 1.2" from top
  • Content area: 1.3" - 5.8" from top

πŸ“‚ Example Presentations

We've included two complete example presentations:

  1. Business Report Example - Quarterly business review with charts and tables

  2. Product Launch Example - Product announcement with mixed content types

Generate Examples

# Generate business report
powerpoint-creator -i examples/business-report.json -o my-report.pptx

# Generate product launch deck
powerpoint-creator -i examples/product-launch.json -o my-launch.pptx

πŸ”§ Advanced Usage

Batch Processing

# Process multiple JSON files
for file in data/*.json; do
  powerpoint-creator -i "$file" -o "output/$(basename $file .json).pptx"
done

API Integration

# Generate from API response
curl https://api.example.com/report | powerpoint-creator -o report.pptx

Template Application

# Apply branding template
powerpoint-creator -i content.json -t templates/corporate.pptx -o branded.pptx

With Data Processing

# Process with jq first
cat raw-data.json | jq '.presentations[0]' | powerpoint-creator -o filtered.pptx

πŸ› οΈ CLI Options

Option Alias Description Default
--input -i Input JSON file path stdin
--output -o Output PPTX file path output.pptx
--template -t Template PPTX file path none
--pdf -p Also generate PDF false
--verbose -v Show detailed progress false
--help -h Show help message -
--version -V Show version number -

πŸ“¦ Programmatic Usage

const { PresentationGenerator } = require('powerpoint-creator');

const presentation = {
  title: "My Presentation",
  slides: [
    {
      layout: "title",
      title: "Welcome",
      subtitle: "Let's get started"
    }
  ]
};

const generator = new PresentationGenerator();
const buffer = await generator.generate(presentation);
fs.writeFileSync('output.pptx', buffer);

πŸ” Troubleshooting

Common Issues

Issue: "Command not found" after installation

# Ensure npm global bin is in PATH
export PATH=$PATH:$(npm prefix -g)/bin

Issue: PDF generation not working

# Install LibreOffice
# macOS:
brew install libreoffice
# Ubuntu:
sudo apt-get install libreoffice

Issue: Images not loading

  • Use absolute paths for local images
  • Ensure image files exist and are accessible
  • For URLs, ensure they're publicly accessible

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Made with ❀️ for automating presentations

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •