油猴脚本:GitHub 代码搜索支持按 repo 分组展示
这是一个油猴脚本,用于改进GitHub代码搜索功能,支持按仓库分组展示搜索结果,提供更好的代码浏览体验。
• Copy the embed code to showcase this product on your website
• Share on X to spread the word about this amazing tool
GitHub 地址: https://github.com/foamzou/group-by-repo-on-github## 起因公司的代码仓库是托管在 GitHub 上的,需要搜索特定代码时,在 github 搜索特别方便。但比较烦恼的是,GitHub 不支持按 repo 分组展示,这样就导致同一个 repo 的不同代码文件可能穿插在搜索结果的不同位置。因此我写了这个油猴脚本。## 特性- 创建了一个 Start Group By Repo 的按钮,点击按钮后会展示新的页面- 当搜索结果分页时,会自动 fetch 页面,并实时更新到当前页面。若不希望继续加载新的内容,随时可以点击 abort 按钮,终止 fetch- 右侧会展示 匹配到的所有 repo 的目录页,点击某个 repo 时,会跳转到对应的锚点位置- 目录页的 repo 包含 stars、language信息## 效果截图<img src="https://raw.githubusercontent.com/foamzou/group-by-repo-on-github/main/snapshot/1-2-1.png" />