MCPcopy Index your code
hub / github.com/observablehq/framework / loadPage

Method loadPage

src/loader.ts:80–85  ·  view source on GitHub ↗

* Loads the page at the specified path, returning a promise to the parsed * page object.

(path: string, options: LoadOptions & ParseOptions, effects?: LoadEffects)

Source from the content-addressed store, hash-verified

78 * page object.
79 */
80 async loadPage(path: string, options: LoadOptions & ParseOptions, effects?: LoadEffects): Promise<MarkdownPage> {
81 const loader = this.findPage(path);
82 if (!loader) throw enoent(path);
83 const input = await readFile(join(this.root, await loader.load(options, effects)), "utf8");
84 return parseMarkdown(input, {source: loader.path, params: loader.params, ...options});
85 }
86
87 /**
88 * Returns a watcher for the page at the specified path.

Callers 5

indexPagesFunction · 0.80
PreviewServerClass · 0.80
watcherFunction · 0.80
helloFunction · 0.80
buildFunction · 0.80

Calls 4

findPageMethod · 0.95
enoentFunction · 0.85
parseMarkdownFunction · 0.85
loadMethod · 0.65

Tested by

no test coverage detected