一个用于TLDR的Python客户端:简化的和社区驱动的人页。
tldr.p的Python项目详细描述
另一个python客户端 tldr。
简介
py是 tldr:简化和 社区驱动的手册页。而不是冗长的手册页:
tldr将为您提供几个简单而强大的示例:
命令示例不好?别担心,你可以自己动手 “TLDR”!它们只是标记文件,您可以在 安逸。别忘了和社区分享!
还有一件事,tldr只是手册页的一个简单版本,它是 不是替代品。有时候,你应该看看手册 耐心地;)
功能突出显示
- 使用本地文件,快。
- 支持自定义输出颜色。
- 支持获取最新的tldr页面。
- 支持重建索引。
安装
$ (sudo) pip install tldr.py
用法
初始化
首先,将tldr repo克隆到某个位置(例如~/code/tldr)。我们将 在我们寻找命令用法时使用它。
$ cd ~/code $ git clone git@github.com:tldr-pages/tldr.git
然后,初始化配置文件, 配置文件是您的主目录,您可以使用 TLDR_CONFIG_DIR指向另一个环境变量的环境变量 文件夹(例如$home/.config)
$ tldr init Input the tldr repo path(absolute path): (e.g. /home/lord63/code/tldr/) Input your platform(linux, osx or sunos): (e.g. linux) Initializing the config file at ~/.tldrrc
配置文件应该如下:
colors: command: cyan description: blue usage: green platform: linux repo_directory: /home/lord63/code/tldr
不要担心colors选项,它是用于 找一个命令,你可以自己定制。 应该是['黑','红','绿','黄','蓝','洋红色', “青色”,“白色”])
最后,建立索引。py将通过 index.json。在新的克隆或添加新页面后, 记住重建索引。
$ tldr reindex Rebuild the index.
使用tldr
查找命令用法:
$ tldr find {{command}}
检查更新(以便我们可以获得最新的手册页):
$ tldr update
添加新页面后重新生成index.json:
$ tldr reindex
找到命令手册页:
$ tldr locate {{command}}
或者可以使用tldr --help获取帮助消息。
常见问题解答
Q: I want to add some custom command usages to a command, how to do it?
A:找到命令页的位置;添加命令用法;完成。
Q: I want to add some custom command pages, how?
a:将comand页面添加到正确的文件夹中(例如/tldrrepo/pages/linux); 重建索引;完成。
Q: I don’t like the default color theme, how to change it?
A:编辑位于~/.tldrrc的tldr配置文件;修改颜色 直到你满意为止。
Q: I faided to update the tldr pages, why?
A:实际上,^{TT5}$只是试图为 你,后面没有魔法。所以你不愿更新的原因是 tldr.py无法提取最新的上游,请检查失败的输出 你可能知道原因,比如你做了一些改变却没有 把他们交出来。你可以用手把书页拉出来,这样你可以有一个更好的 控制它。
Q: Why use the git repo instead of the assets packaged by the official?
A:事实上,如果你想使用官方资源,可以下载 资产并将其提取到某个位置,但是tldr.py不支持更新它 使用tldr update。
使用git repo,您可以:
- 做版本控制,是的,用git。
- 更适合定制,只需编辑页面并添加新页面,它们 属于你。你甚至可以维护自己的“tldr”。如果使用 官方资源,你总能得到最新的页面。
贡献
- 真糟糕?为什么不帮我改进一下呢?让我知道不好的事情。
- 想要新功能吗?请随意为功能请求提交问题。
- 找到虫子了吗?请打开一个问题,或者你可以给我一个 拉取请求。
随时欢迎投稿!:火花::蛋糕: :火花:
许可证
麻省理工学院。