YizhouLouisLu/dsh-math-copy ↗★ 0

dsh-math-copy

Copy rendered math in the DSH Web UI as its LaTeX source instead of KaTeX's glyph text. 适合需要频繁提取对话中数学公式进行学术写作或编辑的用户。

パッケージ
dsh-math-copy
互換性
未検証
バージョン
0.1.0
ライセンス
MIT
最終更新
2026/10/03

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YizhouLouisLu/dsh-math-copy

ドキュメント

README 全文を読む ↗

Configuration

Three fields, editable in the Plugins page:

fielddefaultmeaning
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 flavortruesubstitute math in the text/html flavor too; off keeps the untouched selection markup for rich paste targets

How the form is wired

  • index.js declares the fields on export const Config and 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.js subscribes to that form through ctx.configForms.get("math-copy") (the same way the shipped ui-chat reads 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.config slot 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.