Jerry有一个github仓库,专门用来存放自己的知识管理,通过一条条的issue来记录具体的知识点:
https://github.com/i042416/KnowlegeRepository/issues
目前已经积累了超过2000条记录了。

clipboard1,1
我工作中有这样一个需求,需要给定一个关键字,快速找到标题包含该关键字的所有issue。Github的搜索框能实现这个功能,只不过是高射炮打蚊子,大材小用,因为Github这个搜索框不仅支持按标题搜索,还支持全文搜索,所以速度有点慢。

clipboard2,2
既然github不提供只按照标题进行快速搜索的功能,我就自己写了一个工具,其所有代码位于我的github上:https://github.com/i042416/wechat/tree/master/unittest/github
- 执行这个工具,node launcher, 会调用Github Restful API,获取指定的仓库里所有的issue的明细。当然明细我只对issue的id和title感兴趣,其他属性我都丢弃掉了。Github的读取API支持分页,因此我需要重复调用多次read API,每次调用时传入当前页的索引:

clipboard3,3
然后在外层用一个循环依次请求每页的数据:

clipboard4,4
- 然后再执行node merge.js, 把每页导出的issue明细合并成一个整体,形成最后如下图所示的html文件: https://jerrywang-sap.cn/study/2019/08/22/Jerry-github-issue-list.html

clipboard5,5

clipboard6,6