[ADF-2670] Updated doc indexes for 2.3 (#3183)

* [ADF-2670] Updated doc indexes for 2.3

* [ADF-2670] Clarified explanation of sharedLinkId property in Viewer

* [ADF-2670] Updated review checker for new doc folder structure
This commit is contained in:
Andy Stark
2018-04-12 16:46:36 +01:00
committed by Eugenio Romano
parent 014f2ab26c
commit 0d2f0b7b84
7 changed files with 64 additions and 39 deletions

View File

@@ -29,6 +29,8 @@ let stoplist = new Stoplist(stoplistFilePath);
let docsFolderPath = path.resolve("..", "docs");
let libFolders = ["core", "content-services", "process-services", "insights"];
libsearch(srcData, path.resolve(rootFolder));
/*
@@ -64,7 +66,7 @@ const query = `query commitHistory($path: String) {
}
}`;
let docFiles = getDocFileNames(docsFolderPath);
let docFiles = getDocFilePaths(docsFolderPath);
let docNames = Observable.from(docFiles);
@@ -83,7 +85,7 @@ docNames.subscribe(x => {
client.request(query, vars).then(data => {
let nodes = data["repository"].ref.target.history.nodes;
let lastReviewDate = getDocReviewDate(key + ".md");
let lastReviewDate = getDocReviewDate(x);//(key + ".md");
let numUsefulCommits = extractCommitInfo(nodes, lastReviewDate, stoplist);
let dateString = lastReviewDate.format("YYYY-MM-DD");
@@ -139,14 +141,24 @@ function extractCommitInfo(commitNodes, cutOffDate, stoplist) {
}
function getDocFileNames(folderPath) {
let files = fs.readdirSync(folderPath);
function getDocFilePaths(folderPath) {
let result = [];
files = files.filter(filename =>
(path.extname(filename) === ".md") &&
(filename !== "README.md") &&
(filename.match(angFilePattern))
);
libFolders.forEach(element => {
let libPath = path.resolve(folderPath, element);
let files = fs.readdirSync(libPath);
return files;
files = files.filter(filename =>
(path.extname(filename) === ".md") &&
(filename !== "README.md") &&
(filename.match(angFilePattern))
);
files.forEach(element => {
result.push(path.join(libPath, element));
});
});
return result;
}