MCPcopy
hub / github.com/pingcap/docs-cn / getAllMdList

Function getAllMdList

scripts/utils.js:61–72  ·  view source on GitHub ↗
(tocFiles)

Source from the content-addressed store, hash-verified

59};
60
61export const getAllMdList = (tocFiles) => {
62 const tocFileList = Array.isArray(tocFiles) ? tocFiles : [tocFiles];
63
64 const allLinks = tocFileList.flatMap((tocFile) => {
65 const tocFileContent = fs.readFileSync(tocFile);
66 const mdAst = generateMdAstFromFile(tocFileContent);
67 const linkList = extractLinkNodeFromAst(mdAst);
68 return filterLink(linkList);
69 });
70
71 return [...new Set(allLinks)];
72};
73
74export const CLOUD_TOC_LIST = [
75 "TOC-tidb-cloud.md",

Callers 1

getAllCloudMdListFunction · 0.85

Calls 3

generateMdAstFromFileFunction · 0.85
extractLinkNodeFromAstFunction · 0.85
filterLinkFunction · 0.85

Tested by

no test coverage detected