What is md2pptx?
main.pptx files and .pptm files (which can invoke VBA macros). It is designed to automate the creation of presentations from structured text.repository·main·Indexed 19 days ago
https://github.com/martinpacker/md2pptxA Markdown to PowerPoint converter that generates .pptx and .pptm slide decks from structured Markdown files. It supports various slide types including title, section, bullet, table, and media slides, as well as two-column layouts via contentsplit. Requires Python 3.10 or later (as of April 1, 2025) and the python-pptx dependency.
.pptx files and .pptm files (which can invoke VBA macros). It is designed to automate the creation of presentations from structured text.Understanding the project layout for locating assets:
root/: Contains Python code and Martin Template.pptx (the default starter template).applescript/: Contains shipped AppleScript scripts (e.g., copyPresentation.applescript).media/: Contains icons and other media assets.docs/: Contains documentation files.examples/: Contains usage examples.Drafts Actions/: Contains Drafts actions.You can generate a Table of Contents (TOC) slide by creating a bulleted list slide where each top-level bullet is an internal link to a section.
Requirements:
tocTitle).tocStyle)chevron: Creates a chevron-style TOC. Section slides will highlight the current section by removing its background.circle: Creates a circle-style TOC. Section slides will highlight the current section by removing the background and emphasizing the circle.plain: Creates a list of live links. Unlike the other styles, plain does not affect the appearance of Section slides.tocTitle: Set this if your TOC slide title is something other than "Topics" (e.g., tocTitle: Agenda).tocLinks: Set to yes to enable live links in the PowerPoint slideshow for chevron and circle styles.tocItemHeight: Sets the height of TOC items in inches (Default: 1.0 for chevron, 1.25 for circle).tocRowGap: Sets the vertical gap between rows in inches (Default: 0.75).tocFontSize: Sets the font size of TOC entries in points.tocItemColour: Sets the background color of TOC items using a hexadecimal RGB value (e.g., E0E0FF). This is useful when tocLinks: yes makes text hard to read.### Topics
* [A Section](#a-section)
* [Another Section](#another-section)tocStyle: chevron
tocTitle: Agenda
tocLinks: yes
tocItemColour: E0E0FFSince version 2.0, slides can contain multiple content blocks (up to 10).
Supported Blocks:
Layout Logic:
### Here Is A title
* Here is a bullet
* Here is a sub-bullet
Use the annotation helper routines to add visual elements to a slide. Supported types include:
Key Configuration Rules:
"-" for a single line and "=" for a double line.RunPython.doAnnotations or as lines in a CSV for RunPython.annotationsFromCSV.When defining colors in metadata, you can use either PowerPoint Theme Colors or hexadecimal RGB values.
Use standard PowerPoint theme names. These are case-insensitive. Available names:
NONE, ACCENT 1 through ACCENT 6BACKGROUND 1 through BACKGROUND 2DARK 1 through DARK 2LIGHT 1 through LIGHT 2TEXT 1 through TEXT 2HYPERLINK, FOLLOWED HYPERLINKMIXEDUse 6-digit hexadecimal values. You must include the octothorpe (#) prefix.
Example: ItalicColour: #FF0000
BoldColour: ACCENT 1
ItalicColour: #FF0000You can associate CSS-like classes with specific text effects using HTML <span> elements. These classes are defined in your metadata using the style. prefix.
style.bgcolor.[classname]: [color]: Sets the background color of the text span. Use RGB (e.g., FFFF00) or Theme Colors.style.fgcolor.[classname]: [color]: Sets the foreground (text) color.style.emphasis.[classname]: [effects]: Applies emphasis. Effects are space-separated: bold, italic, underline.style.fontsize.[classname]: [size]: Sets font size in pixels (e.g., 40px).style.cellcolor.[classname]: [color]: Sets the background color of a table cell. The first matching span class in the cell is used.style.cellbox.[classname]: (Referenced for table cell border color).<!-- Metadata Definition -->
style.bgcolor.yellow: FFFF00
style.emphasis.important: bold underline
style.fontsize.large: 40px
<!-- Markdown Usage -->
This is <span class="yellow">highlighted</span>.
This is <span class="important">very important</span>.
This is <span class="large">big text</span>.md2pptx requires Python 3. The minimum version requirement changes periodically to leverage new language features and maintain support for official Python releases:
python-pptx specifically requires Python 3.8 or later due to the use of the Walrus Operator.
You can change settings (like visibility, table styles, or card layouts) for a specific slide and all subsequent slides by using HTML comments immediately following a heading.
Syntax: <!-- md2pptx: <key>: <value> -->
Special Values:
pres: Revert to the presentation's global value.default: Revert to the md2pptx default.prev or pop: Revert to the previous value (destructive/pops the stack).While you cannot embed images inside cells for standard tables, md2pptx provides 'special case' layouts where using a table structure triggers a specific graphic grid layout instead of a standard table.
| are optional in these cases as regular Markdown processors might render them literally.||| aligns the image to the left).|||
|||When running Python code via run-python, md2pptx provides several pre-defined variables that you can use to interact with the presentation and the current slide:
prs: The python-pptx Presentation object being created.slide: The current python-pptx Slide object you are manipulating.renderingRectangle: An object defining the dimensions and position of the area allocated for your Python drawing/rendering.When using md2pptx, slide notes follow specific parsing rules that differ from standard Markdown processors:
md2pptx does not maintain the interleaved order. Instead, it gathers all note content found on a slide and aggregates them into a single block in the slide notes section. This means the notes will not intersperse with the slide content in the final PowerPoint output as they appear in your Markdown source.