Skip to content

shiquda/open-pptd-skill / skills/open-pptd

open-pptd

Flagged

Create, edit, reverse-decompile, and export presentations using the open PPTD format and native pptd compiler. For every PPT task, default deliverables are BOTH (1) a self-contained PPTD project folder (deck.pptd manifest + pages/*.page) and (2) a locally compiled native .pptx with vector shapes, connector arrows, LaTeX math formulas, speaker notes, and native tables. Completely offline — zero dependency on browser automation or cloud logins.

FileKindSize
SKILL.mdskill md16.0 KB
reference/cli.mdmarkdown9.0 KB
reference/design_system/academic/blue-line-courseware/design.mdmarkdown13.9 KB
reference/design_system/academic/deep-blue-atlas/design.mdmarkdown13.5 KB
reference/design_system/academic/paper-white-courseware/design.mdmarkdown14.0 KB
reference/design_system/academic/pastel-derivation/design.mdmarkdown14.6 KB
reference/design_system/academic/teal-green-academic-defense/design.mdmarkdown14.1 KB
reference/design_system/academic/wine-red-data/design.mdmarkdown14.2 KB
reference/design_system/consulting/apricot-white-brief/design.mdmarkdown17.4 KB
reference/design_system/consulting/indigo-due-diligence/design.mdmarkdown11.8 KB
reference/design_system/consulting/marine-blue-research/design.mdmarkdown11.8 KB
reference/design_system/consulting/moss-green-transformation/design.mdmarkdown13.2 KB
reference/design_system/consulting/pine-green-strategy/design.mdmarkdown15.1 KB
reference/design_system/consulting/red-black-growth/design.mdmarkdown12.7 KB
reference/design_system/finance/black-gold-ledger/design.mdmarkdown15.2 KB
reference/design_system/finance/ebony-ledger/design.mdmarkdown14.6 KB
reference/design_system/finance/honey-orange-memo/design.mdmarkdown12.8 KB
reference/design_system/finance/lake-blue-memo/design.mdmarkdown16.0 KB
reference/design_system/finance/prospect-annual/design.mdmarkdown14.6 KB
reference/design_system/finance/rice-paper-annual/design.mdmarkdown11.1 KB
reference/design_system/promotion/aqua-charity-report/design.mdmarkdown15.1 KB
reference/design_system/promotion/cream-collage/design.mdmarkdown12.6 KB
reference/design_system/promotion/pine-soot-pictorial/design.mdmarkdown14.0 KB
reference/design_system/promotion/silk-yellow-magazine/design.mdmarkdown13.3 KB
reference/design_system/promotion/silver-gray-luxury-magazine/design.mdmarkdown13.8 KB
reference/design_system/promotion/travel-green-handbook/design.mdmarkdown15.4 KB
reference/design_system/work/blue-flame-brand/design.mdmarkdown14.6 KB
reference/design_system/work/electric-violet-business/design.mdmarkdown13.0 KB
reference/design_system/work/moon-white-imagery/design.mdmarkdown13.5 KB
reference/design_system/work/sky-blue-wayfinding/design.mdmarkdown15.4 KB
reference/design_system/work/warm-clay-works/design.mdmarkdown13.5 KB
reference/design_system/work/warm-jade-annual-report/design.mdmarkdown15.7 KB
reference/fonts.mdmarkdown6.6 KB
reference/general-poster.mdmarkdown26.8 KB
reference/math.mdmarkdown10.6 KB
reference/pptd.mdmarkdown95.0 KB
reference/shapes.mdmarkdown15.0 KB
reference/slides_categories.mdmarkdown4.6 KB
reference/slides_categories/academic-research.mdmarkdown15.2 KB
reference/slides_categories/analysis-decision.mdmarkdown5.9 KB
reference/slides_categories/brand-creative.mdmarkdown14.7 KB
reference/slides_categories/business-plan.mdmarkdown6.4 KB
reference/slides_categories/education-training.mdmarkdown24.2 KB
reference/slides_categories/management-report.mdmarkdown5.6 KB
reference/slides_categories/tech-engineering.mdmarkdown18.5 KB
reference/tables.mdmarkdown2.2 KB
scripts/convert_pptx.pyexecutablescript2.7 KB
scripts/export_images.pyexecutablescript6.7 KB
scripts/export_pptx.pyexecutablescript4.7 KB
scripts/install_binary.pyexecutablescript17.5 KB
scripts/requirements.txtmanifest228 B
scripts/validate_pptx.pyexecutablescript27.9 KB
tests/fixtures/minimal/minimal.pptdother93 B
tests/fixtures/minimal/pages/01.pageother330 B
tests/test_export_images.pyexecutablescript1.5 KB
tests/test_export_pptx.pyexecutablescript4.2 KB
tests/test_validate_pptx.pyexecutablescript2.8 KB
theme.mdmarkdown16.6 KB
theme_EN.mdmarkdown16.9 KB
theme_previews/academic/blue-line-courseware.jpgbinary51.1 KB
theme_previews/academic/deep-blue-atlas.jpgbinary41.4 KB
theme_previews/academic/paper-white-courseware.jpgbinary52.2 KB
theme_previews/academic/pastel-derivation.jpgbinary50.4 KB
theme_previews/academic/teal-green-academic-defense.jpgbinary55.4 KB
theme_previews/academic/wine-red-data.jpgbinary52.4 KB
theme_previews/consulting/apricot-white-brief.jpgbinary61.1 KB
theme_previews/consulting/indigo-due-diligence.jpgbinary75.5 KB
theme_previews/consulting/marine-blue-research.jpgbinary72.1 KB
theme_previews/consulting/moss-green-transformation.jpgbinary55.9 KB
theme_previews/consulting/pine-green-strategy.jpgbinary74.4 KB
theme_previews/consulting/red-black-growth.jpgbinary63.0 KB
theme_previews/extra/color-stripes-documentary.jpgbinary39.8 KB
theme_previews/extra/dark-themed-data.jpgbinary45.5 KB
theme_previews/extra/dusk-violet-consulting.jpgbinary44.8 KB
theme_previews/extra/fresh-brand.jpgbinary44.7 KB
theme_previews/extra/gold-orange-type-journal.jpgbinary40.5 KB
theme_previews/extra/ink-green-market-trends.jpgbinary47.0 KB
theme_previews/extra/lead-gray-quarterly.jpgbinary43.3 KB
theme_previews/extra/map-strategy.jpgbinary47.0 KB
theme_previews/extra/mist-blue-travelogue.jpgbinary46.3 KB
theme_previews/extra/orange-tech.jpgbinary34.8 KB
theme_previews/extra/pink-purple-diagnosis.jpgbinary30.4 KB
theme_previews/extra/red-black-business.jpgbinary42.6 KB
theme_previews/extra/red-white-business.jpgbinary67.9 KB
theme_previews/extra/xuan-paper-annual.jpgbinary53.3 KB
theme_previews/finance/black-gold-ledger.jpgbinary60.5 KB
theme_previews/finance/ebony-ledger.jpgbinary59.8 KB
theme_previews/finance/honey-orange-memo.jpgbinary69.0 KB
theme_previews/finance/lake-blue-memo.jpgbinary66.7 KB
theme_previews/finance/prospect-annual.jpgbinary64.8 KB
theme_previews/finance/rice-paper-annual.jpgbinary67.5 KB
theme_previews/promotion/aqua-charity-report.jpgbinary60.9 KB
theme_previews/promotion/cream-collage.jpgbinary62.8 KB
theme_previews/promotion/pine-soot-pictorial.jpgbinary82.1 KB
theme_previews/promotion/silk-yellow-magazine.jpgbinary83.0 KB
theme_previews/promotion/silver-gray-luxury-magazine.jpgbinary66.3 KB
theme_previews/promotion/travel-green-handbook.jpgbinary57.1 KB
theme_previews/work/blue-flame-brand.jpgbinary61.9 KB
theme_previews/work/electric-violet-business.jpgbinary54.2 KB
theme_previews/work/moon-white-imagery.jpgbinary52.5 KB
theme_previews/work/sky-blue-wayfinding.jpgbinary57.6 KB
theme_previews/work/warm-clay-works.jpgbinary49.0 KB
theme_previews/work/warm-jade-annual-report.jpgbinary58.5 KB

scripts/export_pptx.py

View on GitHub
#!/usr/bin/env python3
"""Native PPTX export for PPTD projects via pptd compiler.

Replaces the legacy browser-based export pipeline with a 100% offline, native
Rust compiler that generates native OpenXML PPTX with full DrawingML, native tables,
LaTeX math formulas, vector shapes, and safe cross-platform font fallbacks.
"""

from __future__ import annotations

import argparse
import os
import shutil
import subprocess
import sys
import time
from pathlib import Path
from typing import Optional, Sequence

# Import binary installer
try:
    from .install_binary import ensure_pptd
except ImportError:
    # Standalone execution
    from install_binary import ensure_pptd


def find_manifest(source: Path) -> Path:
    source = source.expanduser().resolve()
    if source.is_file():
        if source.suffix.lower() == ".pptd":
            return source
        raise ValueError(f"Expected a .pptd file, got {source.name}")

    if not source.is_dir():
        raise FileNotFoundError(f"Source directory does not exist: {source}")

    manifests = sorted(source.glob("*.pptd"))
    if not manifests:
        raise FileNotFoundError(f"No .pptd manifest found in {source}")
    if len(manifests) > 1:
        exact = source / "deck.pptd"
        if exact.is_file():
            return exact
        raise ValueError(f"Multiple .pptd manifests found: {[m.name for m in manifests]}; please specify one explicitly.")
    return manifests[0]


def export_pptx(
    source: Path,
    output: Optional[Path] = None,
    pdf: bool = False,
    pptd_bin: Optional[Path] = None,
    force: bool = False,
) -> Path:
    manifest = find_manifest(source)
    if output is None:
        output = manifest.with_suffix(".pptx")
    else:
        output = output.expanduser().resolve()
        if output.is_dir():
            output = output / f"{manifest.stem}.pptx"

    output.parent.mkdir(parents=True, exist_ok=True)

    # 1. Resolve compiler
    if pptd_bin is None:
        compiler = ensure_pptd()
    else:
        compiler = pptd_bin

    if not compiler or not compiler.is_file():
        raise RuntimeError("pptd compiler binary could not be located or installed.")

    # 2. Build PPTX
    t0 = time.monotonic()
    print(f"[open-pptd] Compiling {manifest.name} -> {output.name} via pptd...")
    cmd = [str(compiler), "build", str(manifest), "-o", str(output)]
    if force:
        cmd.append("--force")
    proc = subprocess.run(
        cmd,
        capture_output=True,
        text=True,
    )
    if proc.returncode != 0:
        print(f"[open-pptd] Compilation failed:\n{proc.stderr}", file=sys.stderr)
        raise RuntimeError(f"pptd exited with code {proc.returncode}")

    elapsed = time.monotonic() - t0
    size_kb = output.stat().st_size / 1024 if output.exists() else 0.0
    print(f"[open-pptd] Successfully built native PPTX in {elapsed:.2f}s ({size_kb:.1f} KB)")
    print(f"[open-pptd] Output: {output}")

    # 3. Optional PDF conversion via soffice
    if pdf:
        soffice = shutil.which("soffice") or shutil.which("libreoffice")
        if soffice:
            print("[open-pptd] Converting PPTX to PDF via LibreOffice...")
            pdf_proc = subprocess.run(
                [soffice, "--headless", "--convert-to", "pdf", str(output), "--outdir", str(output.parent)],
                capture_output=True,
                text=True,
            )
            if pdf_proc.returncode == 0:
                pdf_path = output.with_suffix(".pdf")
                if pdf_path.is_file():
                    print(f"[open-pptd] Generated PDF: {pdf_path}")
        else:
            print("[open-pptd] Notice: LibreOffice not installed; skipping PDF export.", file=sys.stderr)

    return output


def main(argv: Optional[Sequence[str]] = None) -> int:
    parser = argparse.ArgumentParser(description="Export a PPTD project to native editable PPTX via pptd")
    parser.add_argument("source", type=Path, help="Path to deck.pptd manifest or project directory")
    parser.add_argument("-o", "--output", type=Path, default=None, help="Output .pptx path (default: <manifest>.pptx)")
    parser.add_argument("--pdf", action="store_true", help="Also convert to PDF via headless LibreOffice if available")
    parser.add_argument("-f", "--force", action="store_true", help="Force overwrite output even if modified externally")
    parser.add_argument("--compiler", type=Path, default=None, help="Explicit path to pptd binary")
    args = parser.parse_args(argv)

    try:
        export_pptx(args.source, output=args.output, pdf=args.pdf, pptd_bin=args.compiler, force=args.force)
        return 0
    except Exception as err:
        print(f"[open-pptd] Error: {err}", file=sys.stderr)
        return 1


if __name__ == "__main__":
    sys.exit(main())
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall