MCPcopy Create free account
hub / github.com/OpenDCAI/Paper2Any / buildMindMapMarkdown

Function buildMindMapMarkdown

frontend-workflow/src/utils/mindmapTree.ts:314–324  ·  view source on GitHub ↗
(root: MindMapTreeNode)

Source from the content-addressed store, hash-verified

312};
313
314export const buildMindMapMarkdown = (root: MindMapTreeNode): string => {
315 const lines: string[] = [`# ${root.label}`];
316 if (root.summary) {
317 lines.push('', root.summary);
318 }
319 if (root.children.length > 0) {
320 lines.push('', '## Branches');
321 root.children.forEach((child) => markdownLines(child, 0, lines));
322 }
323 return lines.join('\n');
324};
325
326export const countTreeNodes = (node: MindMapTreeNode): number =>
327 1 + node.children.reduce((sum, child) => sum + countTreeNodes(child), 0);

Callers 1

MindMapPageFunction · 0.90

Calls 1

markdownLinesFunction · 0.85

Tested by

no test coverage detected