MDToPPTX

The beta version of MDToPPTX, a tool I’ve been creating to convert Markdown files to PowerPoint files (*.pptx), is now ready.

It’s written in C#, and the library part is built with .NET Standard 2.0.
So, although I haven’t tested it, it should also work with .NET Core and Xamarin.

Using this, you can create PowerPoint files from Markdown.

markdig

For Markdown parsing, I used markdig. Thanks to this, writing the code was very easy.

openxml

PowerPoint file creation uses openxml.
This allows creating pptx files even on machines without PowerPoint installed.
However, even using the SDK, the difficulty level was high.

Executable exe

The MarkPP.exe file within the project on GitHub can be used with the following command:

MarkPP.exe "markdownfile path" "title" "subtitle"

The file will be output by converting the markdown file path (.md) to (.pptx).

The following is also described in the GitHub README:

Supported Syntax

The following syntax is supported.
HTML notation within Markdown is not supported.

  • HEADERS (Supports Level 1 or Level 2; Level 3 and beyond are probably unnecessary for PowerPoint)
  • BLOCKQUOTES
  • LISTS
  • CODE BLOCKS (Inline code is also OK)
  • LINKS
  • EMPHASIS (Bold, Italic, Strike)
  • Images (Placed at 1 pixel -> 1mm)
  • Table

Use — to denote slide breaks.

Example Usage

Input Markdown Example

  • Since three backticks cannot be written inside a code block, they are replaced with ```
# Test Slide 1

This is a test slide.  
**Bold** text.  
*Italic* is also supported.  
~~Strikethrough is possible too~~

[Hyperlink Example](http://ayumax.hatenablog.com/)

↓ Code block

```csharp
class ClassA  
{  
    public ClassA()  
    { 

    }

    public void Func()
    {

    }
}  

Test Slide 2

This is the second test slide.

Bullet points are also supported.

  • This is a bullet point.
  • Inline code is also supported.

Image insertion is also possible. image1

Blockquote is here:

Quote sample text


Test Slide 3

Subtitle

This is the third test slide.

  1. Numbered list item
  2. Second item in numbered list
  3. Third item in numbered list

Tables can also be written.

Left alignRight alignCenter align
Row 1 LeftRow 1Row 1 Right
Row 2 LeftRow 2Row 2 Right
Row 3 LeftRow 3Row 3 Right


## Output PPTX

It will be output like this.

# Future Plans Since the source is Markdown, the layout is only a straight vertical line, which feels a bit... hmm.<br/> I'm debating whether to utilize PowerPoint's slide layouts or extend the Markdown syntax to include position information, but I'm hesitant to add strange original notation. Also, for each Markdown block type, font size and area margins can be set from the code, so I need to externalize those settings in the future. Furthermore, since this library is written in .NET Standard 2.0, I'm thinking of writing a Xamarin app that directly takes Markdown input and outputs pptx. If my motivation continues, I want to release it for both iOS and Android!