99from graph_sitter .core .class_definition import Class
1010from graph_sitter .core .codebase import Codebase
1111
12- ATTRIBUTES_TO_IGNORE = ["G" , "node_id" ]
12+ ATTRIBUTES_TO_IGNORE = ["G" , "node_id" , "angular" ]
1313
1414
1515def generate_docs_json (codebase : Codebase , head_commit : str ) -> dict [str , dict [str , Any ]]:
@@ -25,12 +25,21 @@ def generate_docs_json(codebase: Codebase, head_commit: str) -> dict[str, dict[s
2525 types_cache = {}
2626 attr_cache = {}
2727
28- def update_class_doc (cls ):
28+ def process_class_doc (cls ):
2929 """Update or create documentation for a class."""
3030 description = cls .docstring .source .strip ('"""' ) if cls .docstring else None
3131 parent_classes = [f"<{ create_path (parent )} >" for parent in cls .superclasses if isinstance (parent , Class ) and has_documentation (parent )]
3232
33- cls_doc = ClassDoc (title = cls .name , description = description , content = " " , path = create_path (cls ), inherits_from = parent_classes , language = get_langauge (cls ), version = str (head_commit ))
33+ cls_doc = ClassDoc (
34+ title = cls .name ,
35+ description = description ,
36+ content = " " ,
37+ path = create_path (cls ),
38+ inherits_from = parent_classes ,
39+ language = get_langauge (cls ),
40+ version = str (head_commit ),
41+ github_url = cls .github_url ,
42+ )
3443
3544 return cls_doc
3645
@@ -47,7 +56,6 @@ def process_method(method, cls, cls_doc, seen_methods):
4756 return
4857
4958 method_path = create_path (method , cls )
50- original_method_path = create_path (method )
5159 parameters = []
5260
5361 parsed = parse_docstring (method .docstring .source )
@@ -88,6 +96,7 @@ def process_method(method, cls, cls_doc, seen_methods):
8896 raises = parsed ["raises" ],
8997 metainfo = meta_data ,
9098 version = str (head_commit ),
99+ github_url = method .github_url ,
91100 )
92101
93102 def process_attribute (attr , cls , cls_doc , seen_methods ):
@@ -122,14 +131,15 @@ def process_attribute(attr, cls, cls_doc, seen_methods):
122131 raises = [],
123132 metainfo = meta_data ,
124133 version = str (head_commit ),
134+ github_url = attr .github_url ,
125135 )
126136
127137 # Process all documented classes
128138 documented_classes = [cls for cls in codebase .classes if has_documentation (cls )]
129139
130140 for cls in tqdm (documented_classes ):
131141 try :
132- cls_doc = update_class_doc (cls )
142+ cls_doc = process_class_doc (cls )
133143 graph_sitter_docs .classes .append (cls_doc )
134144 seen_methods = set ()
135145
0 commit comments