Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: coverage

on:
push:
branches:
- main
pull_request:

jobs:
coverage:
name: Generate coverage
runs-on: ubuntu-latest

env:
CARGO_TERM_COLOR: always

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Install Rust
run: rustup update stable

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate coverage report
run: cargo llvm-cov --workspace --all-features --lcov --output-path lcov.info

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,4 @@ rust-project.json

# Android studio 3.1+ serialized cache file
/.idea/inspectionProfiles/Project_Default.xml
/lcov.info
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# pptx-to-md

[![Crates.io](https://img.shields.io/crates/v/pptx-to-md.svg)](https://crates.io/crates/pptx-to-md)
[![Crates.io](https://img.shields.io/crates/v/pptx-to-md.svg)](https://crates.io/crates/pptx-to-md)
[![tests](https://github.com/nilskruthoff/pptx-parser/actions/workflows/rust.yml/badge.svg)](https://github.com/nilskruthoff/pptx-parser/actions/workflows/rust.yml)
[![Documentation](https://docs.rs/pptx-to-md/badge.svg)](https://docs.rs/pptx-to-md)
[![codecov](https://codecov.io/gh/nilskruthoff/pptx-parser/branch/main/graph/badge.svg)](https://codecov.io/gh/nilskruthoff/pptx-parser)
![License](https://img.shields.io/crates/l/pptx-to-md.svg)
[![dependency status](https://deps.rs/repo/github/nilskruthoff/pptx-parser/status.svg)](https://deps.rs/repo/github/nilskruthoff/pptx-parser)
[![Documentation](https://docs.rs/pptx-to-md/badge.svg)](https://docs.rs/pptx-to-md)

# pptx-to-md

`pptx-to-md` is a library to parse Microsoft PowerPoint (`.pptx`) slides and convert them into structured Markdown content and data, making it easy to process, use, or integrate slide data programmatically.
It also supports OpenDocument Presentation (`.odp`).
Expand All @@ -20,7 +22,7 @@ It also supports OpenDocument Presentation (`.odp`).
- ⏱️ **Multithreading**: Optional support for multithreaded parsing of PowerPoint slides, with a significant performance increase for larger presentations.
- ⚙️ **Robust & Safe APIs:** Designed according to Rust best practices with explicit error handling.
- 🏷️ **Presentation Metadata:** Extracts common document properties from PPTX and ODP.
- 🪄 **Embedding:** Used to provide pptx content and meta information in a form that is useful for embeddings
- 🪄 **Embedding:** Used to provide pptx content and meta-information in a form that is useful for embeddings
---

## 👨‍💻 Example Usage
Expand Down Expand Up @@ -73,14 +75,16 @@ Use `PresentationContainer` when the input may be either `.pptx` or `.odp`:
use pptx_to_md::{ParserConfig, PresentationContainer, PresentationFormat};
use std::path::Path;

let mut presentation = PresentationContainer::open(
Path::new("path/to/presentation.odp"),
ParserConfig::default(),
)?;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut presentation = PresentationContainer::open(
Path::new("path/to/presentation.odp"),
ParserConfig::default(),
)?;

assert_eq!(presentation.format(), PresentationFormat::Odp);
let slides = presentation.parse_all()?;
# Ok::<(), pptx_to_md::Error>(())
assert_eq!(presentation.format(), PresentationFormat::Odp);
let slides = presentation.parse_all()?;
Ok(())
}
```

If the format is already known, use `open_as` to skip auto-detection:
Expand All @@ -89,14 +93,16 @@ If the format is already known, use `open_as` to skip auto-detection:
use pptx_to_md::{ParserConfig, PresentationContainer, PresentationFormat};
use std::path::Path;

let mut presentation = PresentationContainer::open_as(
Path::new("path/to/presentation.pptx"),
ParserConfig::default(),
PresentationFormat::Pptx,
)?;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut presentation = PresentationContainer::open_as(
Path::new("path/to/presentation.pptx"),
ParserConfig::default(),
PresentationFormat::Pptx,
)?;

let slides = presentation.parse_all()?;
# Ok::<(), pptx_to_md::Error>(())
let slides = presentation.parse_all()?;
Ok(())
}
```

---
Expand Down
Loading