Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 2.48 KB

powerpoint.md

File metadata and controls

58 lines (42 loc) · 2.48 KB
title description slug tags image hide_table_of_contents
Text to PowerPoint
Creating PowerPoint presentations from text with diagrams
powerpoint
powerpoint
show-and-tell
false

import CodeBlock from '@theme/CodeBlock'; import Cult from '@site/static/bespoke-d2/cult.d2';

D2 is a diagramming language, and it's versatile unlike any other. For example, you can create full PowerPoint presentations with just text.

It's not D2's primary function, but rather a natural byproduct of a powerful language. D2 built features for grid diagrams and animations, and users built pixel art. And now, with Markdown and Powerpoint, D2 is the easiest way to programmatically create PowerPoint presentations.

Let's look at a simple example first, and then a complex one at the end.

Simple example

<img src={require('@site/static/img/screenshots/cult_pptx.png').default} alt="powerpoint screenshot" style={{width:'100%'}}/>

To produce this:

  • install D2
  • make a .d2 file named input.d2
  • copy the below
  • run d2 input.d2 cult.pptx.
{Cult}

Complex example

The above is pure text. Let's look at an example with diagrams and images.

Be sure to go into Present mode to click on objects and navigate around.

<img src={require('@site/static/img/screenshots/wcc_pptx.png').default} alt="powerpoint screenshot" style={{width:'100%'}}/>

The source code for this is a bit longer, and can be found here.

Limitations

Note that the boxes aren't native PowerPoint boxes that you can resize, and the text isn't text you can edit. It's very much a "view-only" output. This is a v1 that's just been released. Perhaps this will change in the future and we can map things to its PowerPoint equivalent, especially if there's enough demand and usage.