Marp workflow

Export Marp as one HTML file, then prove the live reader

Use Marp when Markdown is your source and a self-contained HTML presentation fits your delivery needs. Pin Marp CLI, export one browser file, add the Slidesfly reader-navigation bridge, inspect size and external resources, publish through the single-file path, and verify navigation inside the opaque-origin reader before sharing the URL.

Author
Slidesfly
Reviewed by
Slidesfly maintainers
Published
Updated
Tested with
Marp CLI 4.5.0, a 110,832-byte byte-matched single-file artifact, external-resource inspection, and live reader navigation

9 minute workflow

When this Marp publishing path fits

Use this path when your Marp source is finished and one generated HTML file is the desired handoff. It avoids the Pro zip requirement used by normal Slidev and Reveal.js builds. Use a PDF host for static documents, a general site host for arbitrary application behavior, or another presentation editor when you need visual collaboration or PowerPoint round-tripping. Slidesfly does not edit Marp Markdown.

Pin Marp CLI and build the HTML artifact

  1. Pin the renderer

    Commit @marp-team/marp-cli 4.5.0 and its lockfile so later rebuilds can be compared.
  2. Export one HTML file

    Marp embeds its presentation runtime in the generated document.
  3. Inject the reader bridge

    Copy the verified helper beside the example workspace and run it after Marp finishes.
npm install --save-dev --save-exact @marp-team/marp-cli@4.5.0
npx marp slides.md --output build/index.html
node ./inject-slidesfly-reader-bridge.mjs build/index.html marp
test -f build/index.html

The exact helper is available in the verified source fixture. Run it after every export; publishing raw Marp output does not install the Slidesfly navigation bridge.

Inspect size and external resources before publishing

wc -c build/index.html
grep -Eo '(src|href)="https?://[^"]+"' build/index.html

# Serve locally, then inspect the browser Network and Console panels
npx serve build

The verified file is 110,832 bytes. Its runtime and fixture content are embedded, but Marp does not automatically guarantee that every image, font, custom theme, or user-authored URL is local. A zero-result grep only catches simple absolute attributes; browser network inspection is the authoritative check.

Publish or update the Marp deck

slidesfly publish ./build/index.html   --title "Marp presentation"   --json

# After claiming or publishing from an account, update the same reader URL:
slidesfly publish ./build/index.html --id YOUR_DECK_ID --json

A successful publish returns the generated deck ID and reader URL:

{
  "ok": true,
  "data": {
    "deck_id": "YOUR_GENERATED_DECK_ID",
    "url": "https://slidesfly.xyz/d/YOUR_GENERATED_DECK_ID",
    "visibility": "unlisted",
    "anonymous": true
  }
}

Public indexing, private access after claim, expiry, deletion, and quarantine remain separate policies enforced around the sandboxed reader.

Marp reader compatibility checks

AreaVerified resultBoundary to recheck
ArtifactOne HTML file with four slides and an embedded runtime.Actual byte size after adding real media and themes.
NavigationThe production reader advanced from slide 1 to slide 2.Fragments, custom shortcuts, touch, and presenter behavior.
External resourcesNo fixture-authored remote runtime request was observed.Remote images, fonts, CSS imports, and user-authored links.
SandboxNo same-origin or top-navigation permission is granted.Code that expects cookies or persistent browser storage.
sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox allow-forms"

Marp publishing failures and recovery

FailureRecovery
FILE_NOT_FOUNDRun the build and verify build/index.html before publishing.
INVALID_FILEPublish the generated .html file, not the Markdown source.
INVALID_HTMLRebuild the document and confirm the file contains a complete HTML presentation.
MALICIOUS_CONTENTRemove remote script dependencies or use Report for a reproducible false positive.
QUOTA_EXCEEDEDCompress or remove large media, then rebuild and retry within the active plan limit.

Marp CLI 4.5.0 live proof

The repository build and current reader asset are both 110,832 bytes with SHA-256 bf620fb90c599ae6ca1188425e1d84033b1b8dcba2dffedfc5443a41a73f8521. A real browser rendered all four slide nodes, moved from slide 1 to slide 2 after focus entered the deck, and loaded no fixture-authored remote runtime dependency.