popingalex/dsh-reference-render ↗★ 0

dsh-reference-render

提供领域无关的结构化引用渲染与交互 适合需要将文本链接转化为可交互、可悬停预览的引用卡片的开发者。

包名
dsh-reference-render
兼容性
待验证
Harness 依赖范围
0.2.1-alpha.1
Cordis 依赖范围
>=4.0.0
版本
0.1.0
许可证
MIT
最近更新
2026年10月6日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:popingalex/dsh-reference-render

Usage

Emit — a plain GFM link becomes a chip; without the plugin it degrades to an ordinary link:

Build completed. See [RP-42](https://github.com/popingalex/dsh-reference-render/blob/dd2b5d7c52b7399e022795ea5d3e32dbd8b46080/report:RP-42) for details.

Decorate — a content plugin claims a reference and supplies dot/bar/icon decorations for either side, up to 3 per side. An icon without a color follows the text color; mode: 'image' renders an original-color ``. Unclaimed references stay plain chips — hover and click are no-ops.

Contribute — two chain slots and one serial event:

ctx.effect(() => ctx.slots.inject('reference.hover.content', () =>
  ctx.slots.register({ name: 'reference.hover.content',
    select: (owner) => isOurs(owner.descriptor) ? {} : null }, MyHoverCard)))

ctx.on('reference/open', ({ descriptor }) =>
  isOurs(descriptor) ? (ctx.sidebarRight.openResource(descriptor.uri), { handled: true }) : undefined)