YizhouLouisLu/dsh-math-copy ↗★ 0
dsh-math-copy
将Web端渲染的数学公式直接复制为LaTeX源码。 适合需要频繁提取对话中数学公式进行学术写作或编辑的用户。
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YizhouLouisLu/dsh-math-copy說明文件
閱讀完整 README ↗Configuration
Three fields, editable in the Plugins page:
| field | default | meaning |
|---|---|---|
| Inline formula delimiter | "$" | wrapped around inline math (empty → bare TeX) |
| Display formula delimiter | "$$" | wrapped around display math (empty → bare TeX) |
| Also replace the rich-text flavor | true | substitute math in the text/html flavor too; off keeps the untouched selection markup for rich paste targets |
How the form is wired
index.jsdeclares the fields onexport const Configand marks each one.volatile(). Only volatile fields are projected into a form: the settings service serves them under this entry's profile row id,math-copy.client.jssubscribes to that form throughctx.configForms.get("math-copy")(the same way the shippedui-chatreads its preferences) and folds it over its own defaults, so the copy handler always reads the current values.- The panel is registered into the
plugins.row.configslot with the key#(dsh-math-copy#math-copy). No shipped client renders settings forms automatically, so the plugin renders its own.
Find it at 插件 (Plugins) → dsh-math-copy → the math-copy row → its
configuration block. Writes go through the settings transport and are
persisted into the active profile's Cordis patch, so they survive restarts.
Changing the host half (index.js) needs a DSH restart: the host module
generation is cached for the process lifetime, and the profile's HMR entry runs
with root: [] (no source watching). Client-only edits (client.js) reach the
page on a reload.