memorax-ai/dsh-render-engine--packages-shiki ↗★ 1

@ch4acko3/dsh-shiki

为Web插件提供共享的Shiki代码高亮引擎 适合需要对多种编程语言进行词法分析和高亮标记的插件开发者。

包名
@ch4acko3/dsh-shiki
兼容性
待验证
Cordis 依赖范围
^4.0.1
版本
0.1.3
许可证
MIT
最近更新
2026年9月24日

同名包的其他仓库

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:memorax-ai/dsh-render-engine#9582bf138d3a6d7381a84359a4a0b878a1ea8952&path:packages/shiki

@ch4acko3/dsh-shiki

A browser-side Cordis service that owns one lazily created Shiki engine for DeepSeek Harness Web plugins.

export const inject = ['shiki']

export function apply(ctx) {
  const result = ctx.shiki.tokenize({
    code: 'const answer = 42',
    language: 'ts',
  })
  console.log(result.lines)
}

resolveLanguage() accepts common aliases, including patch for the bundled diff grammar. tokenize() requires a supported language and returns Shiki tokens using DSH's --shiki-* CSS variables. Its lineEndings field preserves the source's original LF, CRLF, or CR separators.