@@ -213,7 +213,7 @@ document.addEventListener('DOMContentLoaded', () => {
213
213
-console.log("Hello World!")
214
214
+console.log("Hello from Diff2Html!")` ;
215
215
const targetElement = document .getElementById (' myDiffElement' );
216
- const configuration = { inputFormat : ' json ' , drawFileList: true , matching: ' lines' , highlight: true };
216
+ const configuration = { drawFileList: true , matching: ' lines' , highlight: true };
217
217
const diff2htmlUi = new Diff2HtmlUI (targetElement, diffString, configuration);
218
218
diff2htmlUi .draw ();
219
219
diff2htmlUi .highlightCode ();
@@ -271,7 +271,6 @@ document.addEventListener('DOMContentLoaded', () => {
271
271
document .addEventListener (' DOMContentLoaded' , function () {
272
272
var targetElement = document .getElementById (' myDiffElement' );
273
273
var configuration = {
274
- inputFormat: ' json' ,
275
274
drawFileList: true ,
276
275
fileListToggle: false ,
277
276
fileListStartVisible: false ,
@@ -315,25 +314,29 @@ The HTML output accepts a Javascript object with configuration. Possible options
315
314
316
315
- ` outputFormat ` : the format of the output data: ` 'line-by-line' ` or ` 'side-by-side' ` , default is ` 'line-by-line' `
317
316
- ` drawFileList ` : show a file list before the diff: ` true ` or ` false ` , default is ` true `
318
- - ` diffStyle ` : show differences level in each line: ` word ` or ` char ` , default is ` word `
317
+ - ` srcPrefix ` : add a prefix to all source (before changes) filepaths, default is ` '' `
318
+ - ` dstPrefix ` : add a prefix to all destination (after changes) filepaths, default is ` '' `
319
319
- ` diffMaxChanges ` : number of changed lines after which a file diff is deemed as too big and not displayed, default is
320
320
` undefined `
321
321
- ` diffMaxLineLength ` : number of characters in a diff line after which a file diff is deemed as too big and not
322
322
displayed, default is ` undefined `
323
323
- ` diffTooBigMessage ` : function allowing to customize the message in case of file diff too big (if ` diffMaxChanges ` or
324
- ` diffMaxLineLength ` is set)
324
+ ` diffMaxLineLength ` is set). Will be given a file index as a number and should return a string.
325
325
- ` matching ` : matching level: ` 'lines' ` for matching lines, ` 'words' ` for matching lines and words or ` 'none' ` , default
326
326
is ` none `
327
327
- ` matchWordsThreshold ` : similarity threshold for word matching, default is ` 0.25 `
328
+ - ` maxLineLengthHighlight ` : only perform diff changes highlight if lines are smaller than this, default is ` 10000 `
329
+ - ` diffStyle ` : show differences level in each line: ` 'word' ` or ` 'char' ` , default is ` 'word' `
330
+ - ` renderNothingWhenEmpty ` : render nothing if the diff shows no change in its comparison: ` true ` or ` false ` , default is
331
+ ` false `
328
332
- ` matchingMaxComparisons ` : perform at most this much comparisons for line matching a block of changes, default is
329
333
` 2500 `
330
334
- ` maxLineSizeInBlockForComparison ` : maximum number os characters of the bigger line in a block to apply comparison,
331
335
default is ` 200 `
332
- - ` maxLineLengthHighlight ` : only perform diff changes highlight if lines are smaller than this, default is ` 10000 `
333
- - ` renderNothingWhenEmpty ` : render nothing if the diff shows no change in its comparison: ` true ` or ` false ` , default is
334
- ` false `
335
- - ` compiledTemplates ` : object with previously compiled templates to replace parts of the html
336
- - ` rawTemplates ` : object with raw not compiled templates to replace parts of the html
336
+ - ` compiledTemplates ` : object (Hogan template values) with previously compiled templates to replace parts of the html,
337
+ default is ` {} `
338
+ - ` rawTemplates ` : object (string values) with raw not compiled templates to replace parts of the html, default is ` {} ` .
339
+ For example: ` { "tag-file-changed": "<span class="d2h-tag d2h-changed d2h-changed-tag">MODIFIED</span>" } `
337
340
> For more information regarding the possible templates look into
338
341
> [ src/templates] ( https://github.com/rtfpessoa/diff2html/tree/master/src/templates )
339
342
0 commit comments