[ADF-2135] Updated tables of contents and tools (#2820)

This commit is contained in:
Andy Stark
2018-01-11 10:15:00 +00:00
committed by Eugenio Romano
parent 9e706d68e4
commit 994041fb23
23 changed files with 353 additions and 464 deletions

View File

@@ -17,6 +17,7 @@ var aggData = {};
var toolsFolderName = "tools";
var configFileName = "doctool.config.json";
var defaultFolder = path.resolve("..", "docs");
function initPhase(aggData) {
@@ -78,9 +79,8 @@ function updatePhase(srcFolder, destFolder, filenames, aggData) {
});
if (modified)
fs.writeFileSync(path.resolve(destFolder, filenames[i]), remark().stringify(tree));
//console.log(JSON.stringify(tree));
fs.writeFileSync(path.resolve(destFolder, filenames[i]), remark().data("settings", {paddedTable: false}).stringify(tree));
//console.log(JSON.stringify(tree));
}
}
@@ -119,7 +119,15 @@ if (program.args.length === 0) {
return 0;
}
/*
var sourcePath;
if (program.args.length > 0)
sourcePath = path.resolve(program.args[0]);
else
sourcePath = defaultFolder;
*/
var sourcePath = path.resolve(program.args[0]);
var sourceInfo = fs.statSync(sourcePath);
@@ -150,6 +158,7 @@ if (sourceInfo.isDirectory()) {
} else if (sourceInfo.isFile()) {
files = [ path.basename(sourcePath) ];
sourcePath = path.dirname(sourcePath);
destPath = path.dirname(destPath);
}
files = files.filter(filename =>