ClaudeMods
☰
EN
● 0 online · Views 0 times
SponsorsSubmit a project
GitHub repositories · by nogu66

marp-preview

A live Marp slide preview in a Claude Code pane: every slide rendered in one scrolling column, re-rendered on save and scrolled to the slide Claude or your editor just changed.

nogu66@nogu66

nogu66/marp-preview/tree/main/plugins/marp-preview

Translated

About this mod

A Claude Code plugin that renders a live Marp slide preview in a pane. Implemented as a single hooks module (hooks/register.tsx) covering session.start, command.run (/marp), ui.render, ui.close and session.end. It finds the deck (optionally via grep for marp: true), starts a long-running marp process with --watch --images png --allow-local-files writing PNGs under /tmp/marp-preview/, and scrolls the pane to the slide just changed. It reads the deck and its mtime but writes nothing to the project and does not touch the network (beyond npx fetching marp-cli).

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

claude plugin marketplace add nogu66/marp-preview
claude plugin install marp-preview
Original text / README

marp-preview

A live Marp slide preview in a Claude Code pane: every slide rendered in one scrolling column, re-rendered on save and scrolled to the slide Claude or your editor just changed.

Usage, requirements and troubleshooting: github.com/nogu66/marp-preview.

What the hooks do

The plugin is one hooks module, hooks/register.tsx:

| Hook | What it does | | --- | --- | | session.start | Registers the /marp command, and resumes following the deck if the pane is still open after a reload | | command.run (/marp) | Finds or takes the deck, opens the pane and starts marp watching it | | ui.render (the pane) | Draws every slide's image in one column, which the pane scrolls | | ui.close | Stops marp when the pane closes | | session.end | Stops marp when the session ends (not on a /clear, which keeps the pane) |

What it touches

  • Files it reads: the deck you open, and its modification time once a second while the pane is open, to see that marp is keeping up. To find a deck when /marp has no argument it runs grep for marp: true over the .md files under the folder the session is in, then over the project.
  • Files it writes: none in the project. It never changes the deck.
  • Processes it runs: marp (from a node_modules at or above the deck, else npx --yes @marp-team/marp-cli) with --watch --images png --allow-local-files, writing PNGs under /tmp/marp-preview/. It is one long-running process, with the browser marp starts, for as long as the pane is open: started by /marp, restarted if it dies or hangs, and ended when the pane closes, the session ends or the plugin reloads. Also the grep above.
  • Not touched: the network (beyond what npx does to fetch marp-cli), the model, tool calls, the prompt, and settings.
  • Environment variables: none.

Similar projects