Sign in

    pptx

    Pure-MoonBit library for reading, building, and writing PPTX (OOXML) presentations with a type-safe builder API.

    pptx
    powerpoint
    ooxml
    office
    presentation
    Download zip
    Version
    0.1.1
    License
    Apache-2.0
    Last updated
    yesterday
    Downloads
    76

    #PPTX for MoonBit Office

    moonbitlang/pptx reads, builds, and writes PowerPoint (.pptx) presentations. It is a module of the Office workspace, managed by the root moon.work and the repository's shared CI, tooling, and release workflow.

    Derived from t-ujiie-g/moon-pptx. Thank you to t-ujiie-g and the original contributors for the architecture, implementation, documentation, and extensive tests. See UPSTREAM.md for the pinned revision and attribution; the Apache-2.0 LICENSE is retained. The MoonBit team maintains the official module's API and releases. Contributions from the original author are welcome, and the original project can continue independently.

    #Packages

    PackageResponsibility
    presentationPresentation model, building, editing, loading, and saving
    slide, slide_master, themeSlides, layouts, masters, and themes
    chart, chart_ex, smartartCharts and diagrams
    notes, commentsSpeaker notes and comments
    oxml, unitsOOXML models and typed units
    demosShared sample-deck builders with public-API tests
    cmd/demos, cmd/benchDemo generation and benchmark executables
    integrationCross-package tests, embedded fixtures, and benchmarks
    sdk_validityNative tests against the shared OpenXML SDK validator

    Shared XML and ZIP support comes from the separate moonbitlang/ooxml module through moonbitlang/ooxml/xml and moonbitlang/ooxml/opc.

    PPTX source packages live directly under this module, matching the other Office modules. Examples and benchmarks are packages of moonbitlang/pptx, not separate modules or workspaces. Import paths such as moonbitlang/pptx/presentation are unchanged by the directory organization.

    #API boundaries

    Parser and writer state, package storage and indexes, presentation caches, and staged construction handles have private fields. Construct and edit them through their methods. OOXML value models retain the fields needed to inspect, construct, and preserve document content, including unknown XML extensions.

    Use Presentation::opc_package() for low-level edits that the typed APIs do not cover. Package::parts(), Part::bytes(), ContentTypes::defaults() and overrides(), and Relationships::items() return independent buffers or arrays. Editing these snapshots does not edit the document: replace a part with Package::replace_part, or build and install an updated catalog. Part::new also copies its input buffer. Slide-order caches refresh when the presentation or relationship part is replaced.

    #Develop

    Run all commands from the repository root:

    moon check --deny-warn moon test --target native moon info moon fmt

    For focused work, select the relevant package:

    moon test --deny-warn --target native pptx/presentation pptx/demos pptx/integration moon run --target native pptx/cmd/bench -- 10 bash scripts/generate_pptx_demos.sh bash scripts/validate_pptx.sh demos_out_pptx/sample.pptx python3 scripts/embed_pptx_corpus.py moon fmt pptx/integration

    See the cookbook, demo guide, validation guide, and benchmark guide. The shared validator needs .NET 8; the wrapper uses Office's existing .NET setup and build cache.

    Publishing follows the common release process. The local module version is not evidence of a registry release. The unified office CLI integrates PPTX identification, outline, slide/notes text extraction, and fresh one-slide creation through office-lib/pptx. See Office PPTX integration for scope and limitations. The library and dedicated development commands expose additional functionality.

    #Limits

    Unknown XML element preservation is supported, but arbitrary PPTX input is not guaranteed to round-trip without loss. Attribute/namespace preservation, ZIP resource limits, and PowerPoint display/edit compatibility remain tracked in #549. SDK schema validation and parsed-model equality do not establish visual fidelity.

    #Shared OPC and XML

    Import moonbitlang/ooxml/opc and moonbitlang/ooxml/xml for the shared low-level types previously owned by PPTX. See the shared module for implementation boundaries. Presentation::save() now raises PptxError when ZIP writing fails.