模糊搜索文献
doc-fzf的Python项目详细描述
doc fzf:modular cli文档fuzzy finder
从cli中模糊搜索文档并在浏览器中打开它们。
请在此处查看它的实际操作https://terminalizer.com/view/2c3935cf1418
disclaimer此工具是为学习FZF
功能而构建的。请随意使用或扩展它。
用法
doc-fzf ansible
doc-fzf ansible -q yum
安装
pip3 install doc-fzf
验证您的安装:
doc-fzf -h
usage: doc-fzf.py [-h][-q QUERY] module_name doc-fzf. positional arguments: module_name Name of the module to search optional arguments: -h, --help show this help message and exit -q QUERY Query the docs
扩展文档fzf
doc-fzf
是一个模块化应用程序。它可以在运行时加载任何你喜欢的废弃网站的模块。
任何模块都应始终包含:
- 类名必须始终是
Scrapper(FZFDoc)
self.documentation_url
属性def get_documentation(self):
函数,必须始终返回元组(“url”,“description”)
fromdoc_fzf.pyfzfimportFZFDocclassScrapper(FZFDoc):def__init__(self):self.base_url="https://docs.python.org/3"self.documentation_url="{0}/py-modindex.html".format(self.base_url)FZFDoc.__init__(self,self.documentation_url)defget_documentation(self):""" Return a tuple of (url, description) """docs=get_online_documentation()fordocindocs:yield(doc.url,doc.description)
这是ansible documentation example
路线图
- [X]模块定义
- [X]FZFDOC基类
- [X]文件系统缓存层
- []在运行时加载模块
参考文献
- Doc-FZF: Modular CLI Documentation Fuzzy Finder
- fzf, A command-line fuzzy finder
- iterfzf, Pythonic interface to fzf, a CLI fuzzy finder