MCPcopy
hub / github.com/d3/d3 / readMarkdownFiles

Function readMarkdownFiles

test/docs-test.js:67–73  ·  view source on GitHub ↗
(root, subpath = "/")

Source from the content-addressed store, hash-verified

65
66// Recursively find all md files in the directory.
67async function* readMarkdownFiles(root, subpath = "/") {
68 for (const fname of await readdir(root + subpath)) {
69 if (fname.startsWith(".")) continue; // ignore .vitepress etc.
70 if ((await stat(root + subpath + fname)).isDirectory()) yield* readMarkdownFiles(root, subpath + fname + "/");
71 else if (fname.endsWith(".md")) yield subpath + fname;
72 }
73}

Callers 1

docs-test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected