File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 33from pathlib import Path
44
55import mkdocs_gen_files
6+ from griffe .collections import ModulesCollection
7+ from griffe .loader import GriffeLoader
68
79TOP_LEVEL_NAME = "pytorch_adapt"
810FOLDER = "code"
@@ -13,12 +15,17 @@ def remove_pytorch_adapt(x):
1315
1416
1517def main ():
18+ collection = ModulesCollection ()
19+ loader = GriffeLoader (modules_collection = collection )
20+ loader .load_module (Path ("src" , TOP_LEVEL_NAME ))
1621 nav = mkdocs_gen_files .Nav ()
1722
1823 for path in sorted (Path ("src" ).rglob ("*.py" )):
1924 module_path = path .relative_to ("src" ).with_suffix ("" )
2025 parts = list (module_path .parts )
21- if parts [- 1 ] in ["__init__" , "__main__" ]:
26+ if (parts [- 1 ] in ["__init__" , "__main__" ]) or (
27+ not collection [module_path .parts ].has_docstrings
28+ ):
2229 continue
2330
2431 doc_path = path .relative_to ("src" ).with_suffix (".md" )
You can’t perform that action at this time.
0 commit comments