MCPcopy Index your code
hub / github.com/rtfpessoa/diff2html / html

Function html

src/diff2html.ts:28–46  ·  view source on GitHub ↗
(diffInput: string | DiffFile[], configuration: Diff2HtmlConfig = {})

Source from the content-addressed store, hash-verified

26}
27
28export function html(diffInput: string | DiffFile[], configuration: Diff2HtmlConfig = {}): string {
29 const config = { ...defaultDiff2HtmlConfig, ...configuration };
30
31 const diffJson = typeof diffInput === 'string' ? DiffParser.parse(diffInput, config) : diffInput;
32
33 const hoganUtils = new HoganJsUtils(config);
34
35 const { colorScheme } = config;
36 const fileListRendererConfig = { colorScheme };
37
38 const fileList = config.drawFileList ? new FileListRenderer(hoganUtils, fileListRendererConfig).render(diffJson) : '';
39
40 const diffOutput =
41 config.outputFormat === 'side-by-side'
42 ? new SideBySideRenderer(hoganUtils, config).render(diffJson)
43 : new LineByLineRenderer(hoganUtils, config).render(diffJson);
44
45 return fileList + diffOutput;
46}

Callers 2

constructorMethod · 0.90
diff2html-tests.tsFile · 0.90

Calls 1

renderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…