MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / load_module_tree

Method load_module_tree

codewiki/cli/html_generator.py:35–60  ·  view source on GitHub ↗

Load module tree from documentation directory. Args: docs_dir: Documentation directory path Returns: Module tree structure

(self, docs_dir: Path)

Source from the content-addressed store, hash-verified

33
34 self.template_dir = Path(template_dir)
35
36 def load_module_tree(self, docs_dir: Path) -> Dict[str, Any]:
37 """
38 Load module tree from documentation directory.
39
40 Args:
41 docs_dir: Documentation directory path
42
43 Returns:
44 Module tree structure
45 """
46 module_tree_path = docs_dir / "module_tree.json"
47 if not module_tree_path.exists():
48 # Fallback to a simple structure
49 return {
50 "Overview": {"description": "Repository overview", "components": [], "children": {}}
51 }
52
53 try:
54 content = safe_read(module_tree_path)
55 return json.loads(content)
56 except Exception as e:
57 raise FileSystemError(f"Failed to load module tree: {e}")
58
59 def load_metadata(self, docs_dir: Path) -> Optional[Dict[str, Any]]:
60 """
61 Load metadata from documentation directory.
62
63 Args:

Callers 1

generateMethod · 0.95

Calls 2

safe_readFunction · 0.90
FileSystemErrorClass · 0.90

Tested by

no test coverage detected