mtmtian/cc-mods/tree/main/mods/md-prompt/plugins/md-prompt
md-prompt
在 Claude Code 提示框中输入时绘制 Markdown:围栏代码会变成语法高亮卡片(甚至在关闭围栏前),行内代码、粗体、斜体、列表、任务列表、引用、表格、链接和标题也会套用样式。只绘制,不改变文字。
关于这个 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 | togglewrites this one setting with$.config.set, as a change in/configwould. 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.
