ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 mtmtian

md-prompt

在 Claude Code 提示框中輸入時繪製 Markdown:圍欄程式碼會變成語法醒目提示卡片(甚至在關閉圍欄前),行內程式碼、粗體、斜體、清單、任務清單、引用、表格、連結與標題也會套用樣式。只繪製,不改變文字。

mtmtian@mtmtian

mtmtian/cc-mods/tree/main/mods/md-prompt/plugins/md-prompt

已翻譯

關於這個 mod

md-prompt

在 Claude Code 提示框中輸入時繪製 Markdown。圍欄程式碼會在關閉圍欄前就變成語法醒目提示卡片;行內程式碼、粗體、斜體、刪除線、清單、任務清單、引用、標題、表格與連結也會套用樣式。

只繪製。 外掛只替草稿字元上色,從不改變字元,因此你輸入的內容以及送給模型的內容都與原文完全相同。

螢幕截圖、完整的繪製項目清單與疑難排解:github.com/nogu66/md-prompt。

Hooks 的作用

外掛只有一個 hooks 模組:hooks/register.tsx。

| Hook | 作用 | | --- | --- | | prompt.edit | 每次編輯或貼上後,在提示框草稿上加入樣式區段 decorations;文字、游標與其他外掛的 decorations 原樣通過 | | prompt.fill | 整個草稿被替換(由外掛或引擎填入)時,為新草稿加入相同樣式區段 | | session.start | 註冊 /md-prompt 命令 | | command.run(/md-prompt) | 顯示或切換繪製開關,並將其儲存為外掛的 enabled 設定 |

它不讀取檔案、不執行程序、不進行網路或模型呼叫,也不接觸工具呼叫或你送出的內容。

會修改的設定

  • md-prompt.enabled 是外掛自己的 Markdown painting 設定(/config 中的切換項目):開啟時繪製,關閉時提示框維持純文字,預設開啟。/md-prompt on | off | toggle 使用 $.config.set 寫入這一項設定,就像在 /config 中修改一樣,不會改動其他設定。
  • 環境變數:無。在 Claude Code 2.1.285 與 2.1.286 上,你需要自行設定 CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 來開啟 function hooks;外掛不會設定它。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add mtmtian/cc-mods
claude plugin install md-prompt
原文 / README

md-prompt

Markdown, painted onto Claude Code's prompt box as you type. Fenced code becomes a syntax-highlighted card before you even close the fence; inline code, bold, italic, strikethrough, lists, task lists, quotes, headings, tables and links are styled too.

Paint only. The plugin colours the characters of the draft but never changes them, so what you type, and what is sent to the model, is exactly what you typed.

Screenshots, the full list of what is painted, and troubleshooting: github.com/nogu66/md-prompt.

What the hooks do

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

| Hook | What it does | | --- | --- | | prompt.edit | After each edit or paste, adds style runs (decorations) over the draft in the prompt box. The text, the cursor and other plugins' decorations pass through unchanged | | prompt.fill | When the whole draft is replaced (a plugin or the engine filling the box), adds the same style runs to the new draft | | session.start | Registers the /md-prompt command | | command.run (/md-prompt) | Shows or switches painting on or off, and saves it as the plugin's enabled setting |

It reads no files, runs no processes, makes no network or model calls, and does not touch tool calls or what you submit.

Settings it changes

  • md-prompt.enabled, the plugin's own Markdown painting setting (a toggle in /config): on paints, off leaves the prompt box as plain text. The default is on. /md-prompt on | off | toggle writes this one setting with $.config.set, as a change in /config would. It changes no other setting.
  • Environment variables: none. On Claude Code 2.1.285 and 2.1.286 you turn on function hooks yourself with CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1; the plugin does not set it.

更多類似作品