ClaudeMods
☰
JA
● 0 人がオンライン ・閲覧 0 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 nogu66

marp-preview

Claude Code のペインで Marp スライドをライブプレビューします。すべてのスライドを 1 列にスクロール表示し、保存時に再レンダリングして、Claude またはエディターが変更したスライドへスクロールします。

nogu66@nogu66

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

翻訳済み

この mod について

Claude Code のペインでライブの Marp スライドプレビューを描画するプラグインです。単一のフックモジュール(hooks/register.tsx)で実装され、session.start、command.run(/marp)、ui.render、ui.close、session.end を扱います。デッキを探し(grep で marp: true を探すこともできます)、--watch --images png --allow-local-files を付けた長時間実行の marp プロセスを起動し、PNG を /tmp/marp-preview/ に書き込み、変更されたスライドまでペインをスクロールします。デッキとその mtime は読み取りますが、プロジェクトには何も書かず、ネットワークにも触れません(npx が marp-cli を取得する場合を除く)。

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add nogu66/marp-preview
claude plugin install marp-preview
原文 / 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.

関連作品