diff2html-cli
Advanced tools
Comparing version 1.4.3 to 1.4.4
{ | ||
"name": "diff2html-cli", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"homepage": "https://www.github.com/rtfpessoa/diff2html-cli", | ||
@@ -5,0 +5,0 @@ "description": "Fast Diff to colorized HTML", |
@@ -78,8 +78,11 @@ /* | ||
if (baseConfig.summary) { | ||
if (baseConfig.summary == 'hidden') { | ||
config.showFiles = false; | ||
} else { | ||
config.showFiles = true; | ||
config.showFilesOpen = baseConfig.summary == 'open'; | ||
} | ||
var htmlContent = Diff2Html.getPrettyHtml(jsonContent, config); | ||
return callback(null, that._prepareHTML(htmlContent)); | ||
return callback(null, that._prepareHTML(htmlContent, config.showFilesOpen)); | ||
} else if (baseConfig.format === 'json') { | ||
@@ -92,3 +95,3 @@ return callback(null, JSON.stringify(jsonContent)); | ||
Diff2HtmlInterface.prototype._prepareHTML = function(content) { | ||
Diff2HtmlInterface.prototype._prepareHTML = function(content, showFilesOpen) { | ||
var templatePath = path.resolve(__dirname, '..', 'dist', 'template.html'); | ||
@@ -106,2 +109,3 @@ var template = utils.readFileSync(templatePath); | ||
.replace('<!--diff2html-js-ui-->', '<script>\n' + jsUiContent + '\n</script>') | ||
.replace('//diff2html-fileListCloseable', 'diff2htmlUi.fileListCloseable("#diff", ' + showFilesOpen + ');') | ||
.replace('<!--diff2html-diff-->', content); | ||
@@ -108,0 +112,0 @@ }; |
@@ -31,4 +31,5 @@ #!/usr/bin/env node | ||
describe: 'Show files summary', | ||
type: 'boolean', | ||
default: 'true' | ||
type: 'string', | ||
choices: ['closed', 'open', 'hidden'], | ||
default: 'closed' | ||
} | ||
@@ -35,0 +36,0 @@ }) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23268
622