[ADF-4252] Added doc link fixing tool (#4461)

* [ADF-4252] Added basic fixer for link and image URLs

* [ADF-4252] Added full check to link fixing tool

* [ADF-4252] Manually replaced http Github doc URLs

* [ADF-4252] Fixed rel note doc links with tool
This commit is contained in:
Andy Stark
2019-03-19 22:17:30 +00:00
committed by Eugenio Romano
parent 5dd1d25371
commit 5c63b7c0f8
20 changed files with 527 additions and 306 deletions

View File

@@ -246,4 +246,41 @@ export class Text {
value(): String {
return this.orig.value;
}
}
let libNamesRegex = /content-services|core|extensions|insights|process-services|process-services-cloud/;
export class Docset {
public docs: Root[];
constructor(mdCache) {
this.docs = [];
let pathnames = Object.keys(mdCache);
pathnames.forEach(pathname => {
if (!pathname.match(/README/) &&
pathname.match(libNamesRegex)
) {
let doc = new Root(mdCache[pathname].mdInTree);
doc.id = pathname.replace(/\\/g, '/');
this.docs.push(doc);
}
});
}
documents(args): Root[] {
if (args['idFilter'] === '') {
return this.docs;
} else {
return this.docs.filter(doc => doc.id.indexOf(args['idFilter'] + '/') !== -1);
}
}
size(): number {
return this.docs.length;
}
}