外观
render_diff
约 130 字小于 1 分钟
2025-08-01
@candriajs/git-neko-kit / render_diff
函数: render_diff()
render_diff(
diff
,options?
):string
定义于: common/diff.ts:24
渲染差异文本为HTML格式的可视化对比视图
参数
diff
string
需要渲染的Git差异文本(diff格式字符串)
options?
Diff2HtmlConfig
(可选) Diff2Html配置选项,用于自定义渲染行为
返回
string
渲染后的HTML字符串
Examples
// 基本用法
const html = render_diff(diffText);
// 自定义配置
const html = render_diff(diffText, {
outputFormat: 'line-by-line',
colorScheme: ColorSchemeType.DARK
});