MCPcopy Index your code
hub / github.com/ChinaGodMan/UserScripts / get_top_path

Function get_top_path

utils/fix_toc.py:44–58  ·  view source on GitHub ↗
(paths)

Source from the content-addressed store, hash-verified

42
43
44def get_top_path(paths):
45 paths = sorted(set(paths), key=len)
46 top_level_paths = []
47 for path in paths:
48 """
49 ../chatgpt-code-styling/#readme
50 ../chatgpt-code-styling/chatgpt-code-styling.user.js
51 ../chatgpt-code-styling
52 只保留,防止多次替换../chatgpt-code-styling
53 """
54 if '/' not in path.strip('./').strip('../'):
55 top_level_paths.append(path)
56 elif "README.md" in path:
57 top_level_paths.append(path)
58 return top_level_paths
59
60
61for item in docs['files']:

Callers 1

fix_toc.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected