MCPcopy Create free account
hub / github.com/observablehq/framework / findPagePaths

Method findPagePaths

src/loader.ts:99–107  ·  view source on GitHub ↗

* Finds the paths of all non-parameterized pages within the source root.

()

Source from the content-addressed store, hash-verified

97 * Finds the paths of all non-parameterized pages within the source root.
98 */
99 *findPagePaths(): Generator<string> {
100 const ext = new RegExp(`\\.md(${["", ...this.interpreters.keys()].map(requote).join("|")})$`);
101 for (const file of visitFiles(this.root, (name) => !isParameterized(name))) {
102 if (!ext.test(file)) continue;
103 const path = `/${file.slice(0, file.lastIndexOf(".md"))}`;
104 if (extname(path) === ".js" && findModule(this.root, path)) continue;
105 yield path;
106 }
107 }
108
109 /**
110 * Finds the page loader for the specified target path, relative to the source

Callers 2

loader-test.tsFile · 0.80
pathsFunction · 0.80

Calls 3

visitFilesFunction · 0.85
isParameterizedFunction · 0.85
findModuleFunction · 0.85

Tested by

no test coverage detected