marp2pptx 0.1.5
Convert Marp Markdown files to polished PPTX presentations
Requires Python: >=3.10

# Marp2PPTX: Enhanced Marp to PowerPoint Conversion

## What is Marp2PPTX?

Marp2PPTX is a Python package designed to convert Marp Markdown files into polished, editable PowerPoint presentations. While Marp's own PowerPoint export tool is functional, it has several limitations and issues, such as improper font handling, unnecessary background objects, and fragmented text boxes. Marp2PPTX addresses these issues, ensuring that the exported presentations are clean, professional, and ready for further editing.

## Why Use Marp2PPTX?

Marp2PPTX improves upon Marp's default PowerPoint export by:
- Fixing font rendering issues (e.g., ensuring proper handling of `Segoe UI` font).
- Removing unnecessary background objects that bloat the file size.
- Combining fragmented text boxes into cohesive units.
- Respecting slide margins to prevent text overflow.
- Accurately replicating Marp's advanced background image syntax.

This tool is ideal for users who rely on Marp for Markdown-based slide creation but need high-quality, editable PowerPoint files for professional use.

## How to Use Marp2PPTX

### Prerequisites

Before using Marp2PPTX, ensure you have the following installed:

1. **Python 3.10 or higher** or **uv**: Required to run the Marp2PPTX package.
2. [**Marp CLI**](https://github.com/marp-team/marp-cli): The Marp command-line tool is used to generate intermediate HTML files from Markdown. Install it via npm:
   ```bash
   npm install -g @marp-team/marp-cli
   ```
3. [**LibreOffice**](https://www.libreoffice.org/download/download-libreoffice/): Mandatory for the Marp CLI to create editable PowerPoint files. Ensure LibreOffice is installed and accessible from the command line.

## Getting Started<a id="getting-started"></a>

### Installation

Marp2PPTX is available as [`marp2pptx`](https://pypi.org/project/marp2pptx/) on PyPI. 

Invoke Marp2PPTX directly with [`uvx`](https://docs.astral.sh/uv/):

```shell
uvx marp2pptx --help
uvx marp2pptx .\example.marp.md --open-pptx
```

Or install Marp2PPTX with `uv` (recommended), `pip`, or `pipx`:

```shell
# with uv
uv tool install marp2pptx # Install Marp2PPTX globally.
uv add marp2pptx # Add Marp2PPTX to the current project.

# with pip
pip install marp2pptx

# with pipx
pipx install marp2pptx
```

### Usage

1. Prepare your Marp Markdown file (e.g., `example.marp.md`).
2. Run the Marp2PPTX pipeline:
   ```shell
   marp2pptx example.marp.md --open-pptx
   ```
3. The tool will generate the following file:
   - `example-m2p.pptx`: Final, post-processed PowerPoint file.

### Debugging

To keep intermediate files for debugging, use the `--debug` flag:
```shell
marp2pptx example.marp.md --debug
```
The tool will generate additional files:
- `example-m2p.html`: The HTML file generated by Marp CLI.
- `example-m2p-raw.pptx`: The raw PowerPoint file generated by Marp CLI before post-processing.


## Contributing

Contributions are welcome! If you encounter issues or have suggestions for improvement, please open an issue or submit a pull request.



```shell
# Clone the repository 
git clone https://github.com/Fjeldmann/marp2pptx.git

# installing Marp2PPTX locally for development:
cd marp2pptx
uv sync --dev
uv pip install -e .

# run Marp2PPTX with the example file:
marp2pptx --help
marp2pptx .\example.marp.md --open-pptx

# run tests:
pytest 

# uninstall Marp2PPTX after development:
uv pip uninstall marp2pptx
```

## License<a id="license"></a>

This repository is licensed under the [MIT License](LICENSE). See the LICENSE file for more details.