16 个稳定版本

1.9.3 2024 年 7 月 29 日
1.9.1 2024 年 3 月 28 日
1.8.0 2023 年 11 月 30 日
1.5.0 2023 年 7 月 24 日

#45命令行工具

Download history 242/week @ 2024-04-25 72/week @ 2024-05-02 44/week @ 2024-05-09 29/week @ 2024-05-16 28/week @ 2024-05-23 55/week @ 2024-05-30 39/week @ 2024-06-06 63/week @ 2024-06-13 48/week @ 2024-06-20 36/week @ 2024-06-27 102/week @ 2024-07-04 22/week @ 2024-07-11 46/week @ 2024-07-18 237/week @ 2024-07-25 95/week @ 2024-08-01 40/week @ 2024-08-08

421 每月下载量

MIT 许可证

72KB
1.5K SLoC

tlrc

用 Rust 编写的 tldr 客户端。

CI release crates.io license
github downloads matrix

screenshot

安装

Packaging status

Linux/macOS 使用 Homebrew

使用 Homebrew 安装 tlrc

brew install tlrc

Linux/macOS 使用 Nix

从 nixpkgs 安装 tlrc

Arch Linux

从 AUR 安装 tlrc(源码)或 tlrc-bin(预构建)

openSUSE

使用 Zypper 安装 tlrc

zypper install tlrc

Windows 使用 Winget

使用 Winget 安装 tlrc

winget install tldr-pages.tlrc

Windows 使用 Scoop

使用 Scoop 安装 tlrc

scoop install tlrc

macOS 使用 MacPorts

使用 MacPorts 安装 tlrc

port install tlrc

NetBSD

使用 pkgin 安装 tlrc

pkgin install tlrc

从 crates.io

要使用源码包构建 tlrc,运行

cargo install tlrc

[!NOTE] 此方式不会安装 shell 完成文件和 man 页面。

从 GitHub 发布版本

您可以在 这里 找到预构建的二进制文件。

使用方法

查看 man tldr 或在线 man 页面 在线 man 页面。要获取简短说明,也可以运行

tldr --help

配置

Tlrc 可以使用 TOML 配置文件进行自定义。要获取您系统的默认路径,运行

tldr --config-path

要生成默认配置文件,运行

tldr --gen-config > "$(tldr --config-path)"

或复制下面的示例。

配置选项

[cache]
# Override the cache directory.
dir = "/path/to/cache"
# Override the base URL used for downloading tldr pages.
# The mirror must provide files with the same names as the official tldr pages repository:
# mirror/tldr.sha256sums            must point to the SHA256 checksums of all assets
# mirror/tldr-pages.LANGUAGE.zip    must point to a zip archive that contains platform directories with pages in LANGUAGE
mirror = "https://github.com/tldr-pages/tldr/releases/latest/download"
# Automatically update the cache if it's older than max_age hours.
auto_update = true
max_age = 336 # 336 hours = 2 weeks
# Specify a list of desired page languages. If it's empty, languages specified in
# the LANG and LANGUAGE environment variables are downloaded.
# English is implied and will always be downloaded.
# You can see a list of language codes here: https://github.com/tldr-pages/tldr
# Example: ["de", "pl"]
languages = []

[output]
# Show the title in the rendered page.
show_title = true
# Show the platform name ('common', 'linux', etc.) in the title.
platform_title = false
# Prefix descriptions of examples with hyphens.
show_hyphens = false
# Use a custom string instead of a hyphen.
example_prefix = "- "
# Strip empty lines from output.
compact = false
# Print pages in raw markdown.
raw_markdown = false

# Number of spaces to put before each line of the page.
[indent]
# Command name.
title = 2
# Command description.
description = 2
# Descriptions of examples.
bullet = 2
# Example command invocations.
example = 4

# Style for the title of the page (command name).
[style.title]
# Fixed colors:       "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "default"
# 256color ANSI code: { color256 = 50 }
# RGB:                { rgb = [0, 255, 255] }
color = "magenta"
background = "default"
bold = true
underline = false
italic = false
dim = false
strikethrough = false

# Style for the description of the page.
[style.description]
color = "magenta"
background = "default"
bold = false
underline = false
italic = false
dim = false
strikethrough = false

# Style for descriptions of examples.
[style.bullet]
color = "green"
background = "default"
bold = false
underline = false
italic = false
dim = false
strikethrough = false

# Style for command examples.
[style.example]
color = "cyan"
background = "default"
bold = false
underline = false
italic = false
dim = false
strikethrough = false

# Style for URLs inside the description.
[style.url]
color = "red"
background = "default"
bold = false
underline = false
italic = true
dim = false
strikethrough = false

# Style for text surrounded by backticks (`).
[style.inline_code]
color = "yellow"
background = "default"
bold = false
underline = false
italic = true
dim = false
strikethrough = false

# Style for placeholders inside command examples.
[style.placeholder]
color = "red"
background = "default"
bold = false
underline = false
italic = true
dim = false
strikethrough = false

依赖关系

~13–22MB
~413K SLoC