MCPcopy Index your code
hub / github.com/modelcontextprotocol/modelcontextprotocol / load

Function load

typedoc.plugin.mjs:6–32  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

4
5/** @param {typedoc.Application} app */
6export function load(app) {
7 app.options.addDeclaration({
8 name: "schemaPageTemplate",
9 help: "Template file for schema reference page.",
10 type: typedoc.ParameterType.String,
11 });
12
13 app.outputs.addOutput("schema-page", async (outputDir, project) => {
14 const templatePath = /** @type {string} */ (app.options.getValue("schemaPageTemplate"));
15 const template = await readFile(templatePath, { encoding: "utf-8" });
16
17 app.renderer.router = new SchemaPageRouter(app);
18 app.renderer.theme = new typedoc.DefaultTheme(app.renderer);
19 app.renderer.trigger(typedoc.RendererEvent.BEGIN, new typedoc.RendererEvent(outputDir, project, []));
20
21 const pageEvents = buildPageEvents(project, app.renderer.router);
22
23 process.stdout.write(
24 renderTemplate(template, pageEvents, /** @type {typedoc.DefaultTheme} */ (app.renderer.theme))
25 );
26
27 // Wait for all output to be written before allowing the process to exit.
28 await new Promise((resolve) => process.stdout.write("", () => resolve(undefined)));
29 })
30
31 app.outputs.setDefaultOutputName("schema-page")
32}
33
34class SchemaPageRouter extends typedoc.StructureRouter {
35 /**

Callers

nothing calls this directly

Calls 2

buildPageEventsFunction · 0.85
renderTemplateFunction · 0.85

Tested by

no test coverage detected