diff --git a/README.md b/README.md index ad0ba77..40b369b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + +> [!NOTE] +> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。 +> [English](./README.en.md) · [原始项目](https://github.com/charmbracelet/freeze) · [上游 README](https://github.com/charmbracelet/freeze/blob/HEAD/README.md) +> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。 + # Freeze
-Generate images of code and terminal output. +生成代码和终端输出的图片。 -## Examples +## 示例 -Freeze generates PNGs, SVGs, and WebPs of code and terminal output alike. +Freeze 可以同样生成代码和终端输出的 PNG、SVG 和 WebP 图片。 -### Generate an image of code +### 生成代码图片 ```sh freeze artichoke.hs -o artichoke.png @@ -28,10 +34,9 @@ freeze artichoke.hs -o artichoke.png -### Generate an image of terminal output +### 生成终端输出图片 -You can use `freeze` to capture ANSI output of a terminal command with the -`--execute` flag. +你可以使用 `freeze` 配合 `--execute` 标志捕获终端命令的 ANSI 输出。 ```bash freeze --execute "eza -lah" @@ -43,9 +48,9 @@ freeze --execute "eza -lah" -Freeze is also [super customizable](#customization) and ships with an [interactive TUI](#interactive-mode). +Freeze 还[高度可定制](#customization),并提供[交互式 TUI](#interactive-mode)。 -## Installation +## 安装 ```sh # macOS or Linux @@ -58,12 +63,12 @@ yay -S freeze nix-env -iA nixpkgs.charm-freeze ``` -Or, download it: +或者,直接下载: -- [Packages][releases] are available in Debian and RPM formats -- [Binaries][releases] are available for Linux, macOS, and Windows +- [软件包][releases] 提供 Debian 和 RPM 格式 +- [二进制文件][releases] 适用于 Linux、macOS 和 Windows -Or, just install it with `go`: +或者,使用 `go` 安装: ```sh go install github.com/charmbracelet/freeze@latest @@ -71,11 +76,11 @@ go install github.com/charmbracelet/freeze@latest [releases]: https://github.com/charmbracelet/freeze/releases -## Customization +## 定制 -### Interactive mode +### 交互模式 -Freeze features a fully interactive mode for easy customization. +Freeze 提供完整的交互模式,便于轻松定制。 ```bash freeze --interactive @@ -83,43 +88,41 @@ freeze --interactive
-Settings are written to `$XDG_CONFIG/freeze/user.json` and can be accessed with
-`freeze --config user`.
+设置会写入 `$XDG_CONFIG/freeze/user.json`,可通过 `freeze --config user` 访问。
-### Flags
+### 标志
-Screenshots can be customized with `--flags` or [Configuration](#configuration) files.
+可使用 `--flags` 或[配置文件](#configuration)自定义截图。
> [!NOTE]
-> You can view all freeze customization with `freeze --help`.
+> 可使用 `freeze --help` 查看所有 freeze 定制选项。
-- [`-b`](#background), [`--background`](#background): Apply a background fill.
-- [`-c`](#configuration), [`--config`](#configuration): Base configuration file or template.
-- [`-l`](#language), [`--language`](#language): Language to apply to code
-- [`-m`](#margin), [`--margin`](#margin): Apply margin to the window.
-- [`-o`](#output), [`--output`](#output): Output location for .svg, .png, .jpg.
-- [`-p`](#padding), [`--padding`](#padding): Apply padding to the code.
-- [`-r`](#border-radius), [`--border.radius`](#border-radius): Corner radius of window.
-- [`-t`](#theme), [`--theme`](#theme): Theme to use for syntax highlighting.
-- [`-w`](#window), [`--window`](#window): Display window controls.
-- [`-H`](#height), [`--height`](#height): Height of terminal window.
-- [`--border.width`](#border-width): Border width thickness.
-- [`--border.color`](#border-width): Border color.
-- [`--shadow.blur`](#shadow): Shadow Gaussian Blur.
-- [`--shadow.x`](#shadow): Shadow offset x coordinate.
-- [`--shadow.y`](#shadow): Shadow offset y coordinate.
-- [`--font.family`](#font): Font family to use for code.
-- [`--font.ligatures`](#font): Use ligatures in the font.
-- [`--font.size`](#font): Font size to use for code.
-- [`--font.file`](#font): File path to the font to use (embedded in the SVG).
-- [`--line-height`](#font): Line height relative to font size.
-- [`--show-line-numbers`](#line-numbers): Show line numbers.
-- [`--lines`](#line-numbers): Lines to capture (start,end).
+- [`-b`](#background)、[`--background`](#background):应用背景填充。
+- [`-c`](#configuration)、[`--config`](#configuration):基础配置文件或模板。
+- [`-l`](#language)、[`--language`](#language):应用于代码的语言
+- [`-m`](#margin)、[`--margin`](#margin):为窗口应用外边距。
+- [`-o`](#output)、[`--output`](#output):.svg、.png、.jpg 的输出位置。
+- [`-p`](#padding)、[`--padding`](#padding):为代码应用内边距。
+- [`-r`](#border-radius)、[`--border.radius`](#border-radius):窗口圆角半径。
+- [`-t`](#theme)、[`--theme`](#theme):用于语法高亮的主题。
+- [`-w`](#window)、[`--window`](#window):显示窗口控件。
+- [`-H`](#height)、[`--height`](#height):终端窗口高度。
+- [`--border.width`](#border-width):边框宽度。
+- [`--border.color`](#border-width):边框颜色。
+- [`--shadow.blur`](#shadow):阴影高斯模糊。
+- [`--shadow.x`](#shadow):阴影 x 轴偏移量。
+- [`--shadow.y`](#shadow):阴影 y 轴偏移量。
+- [`--font.family`](#font):代码所用字体族。
+- [`--font.ligatures`](#font):在字体中使用连字(ligatures)。
+- [`--font.size`](#font):代码所用字号。
+- [`--font.file`](#font):所用字体文件路径(嵌入 SVG)。
+- [`--line-height`](#font):相对于字号的行高。
+- [`--show-line-numbers`](#line-numbers):显示行号。
+- [`--lines`](#line-numbers):要捕获的行(起始,结束)。
-### Language
+### 语言
-If possible, `freeze` auto-detects the language from the file name or analyzing
-the file contents. Override this inference with the `--language` flag.
+在可能的情况下,`freeze` 会根据文件名或分析文件内容自动检测语言。使用 `--language` 标志可覆盖此推断。
```bash
cat artichoke.hs | freeze --language haskell
@@ -131,9 +134,9 @@ cat artichoke.hs | freeze --language haskell