MCPcopy
hub / github.com/npmx-dev/npmx.dev / generateDocsWithDeno

Function generateDocsWithDeno

server/utils/docs/index.ts:34–55  ·  view source on GitHub ↗
(
  packageName: string,
  version: string,
)

Source from the content-addressed store, hash-verified

32 * ```
33 */
34export async function generateDocsWithDeno(
35 packageName: string,
36 version: string,
37): Promise<DocsGenerationResult | null> {
38 // Get doc nodes using @deno/doc WASM
39 const result = await getDocNodes(packageName, version)
40
41 if (!result.nodes || result.nodes.length === 0) {
42 return null
43 }
44
45 // Process nodes: flatten namespaces, merge overloads, and build lookup
46 const flattenedNodes = flattenNamespaces(result.nodes)
47 const mergedSymbols = mergeOverloads(flattenedNodes)
48 const symbolLookup = buildSymbolLookup(flattenedNodes)
49
50 // Render HTML and TOC from pre-computed merged symbols
51 const html = await renderDocNodes(mergedSymbols, symbolLookup)
52 const toc = renderToc(mergedSymbols)
53
54 return { html, toc, nodes: flattenedNodes }
55}

Callers 1

[...pkg].get.tsFile · 0.85

Calls 6

getDocNodesFunction · 0.90
flattenNamespacesFunction · 0.90
mergeOverloadsFunction · 0.90
buildSymbolLookupFunction · 0.90
renderDocNodesFunction · 0.90
renderTocFunction · 0.90

Tested by

no test coverage detected