Skip to content

Commit

Permalink
docs: beautify README.md in both English and zh-CN
Browse files Browse the repository at this point in the history
Signed-off-by: jingfelix <jingfelix@outlook.com>
  • Loading branch information
jingfelix committed Dec 21, 2024
1 parent 508d65a commit 8576c6b
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 10 deletions.
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Patche

Modern patch, written in Python.

## Usage
<div align="center">
<h1>Patche</h1>
<h3>Modern patch, written in Python.</h3>
<div>English | <a href="README.zh-CN.md">简体中文</a></div>
<br>
<a href="https://pypi.org/project/Patche/"><img src="https://img.shields.io/pypi/v/Patche" alt="PyPI"></a>
<!-- <a href="https://pypi.org/project/Patche/"><img src="https://img.shields.io/pypi/pyversions/Patche" alt="PyPI - Python Version"></a> -->
<a href="https://github.com/jingfelix/Patche/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/Patche" alt="PyPI - License"></a>
<a href="https://pdm-project.org"><img src="https://img.shields.io/badge/pdm-managed-blueviolet" alt="pdm-managed"></a>
</div>

## 🔨 Usage

The following commands are supported:

### apply
### ➡️ patche apply

Apply a patch to target files.

Expand All @@ -18,31 +25,31 @@ Options:
- `-R, --reverse`: Assume patches were created with old and new files swapped
- `-F, --fuzz LINES`: Set the fuzz factor to LINES for inexact matching

### show
### ↕️ patche show

Show details of a patch file.

```shell
patche show <patch-file>
```

### settings
### ⚙️ patche settings

Display current configuration.

```shell
patche settings
```

## Config
## 🧰 Config

`patche` loads the configuration from a file named `.patche.env` in `$HOME`.

```shell
max_diff_lines = 3
```

## Development
## 💻 Development

`patche` uses `pdm` as package manager. To install the dependencies in your workspace, run:

Expand Down
62 changes: 62 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<div align="center">
<h1>Patche</h1>
<h3>Python 编写的现代补丁工具</h3>
<div><a href="README.md">English</a> | 简体中文</div>
<br>
<a href="https://pypi.org/project/Patche/"><img src="https://img.shields.io/pypi/v/Patche" alt="PyPI"></a>
<a href="https://github.com/jingfelix/Patche/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/Patche" alt="PyPI - License"></a>
<a href="https://pdm-project.org"><img src="https://img.shields.io/badge/pdm-managed-blueviolet" alt="pdm-managed"></a>
</div>

## 🔨 使用方法

支持以下命令:

### ➡️ patche apply

将补丁应用到目标文件。

```shell
patche apply <patch-file>
```

选项:
- `-R, --reverse`: 假设补丁文件在创建时新旧文件被交换
- `-F, --fuzz LINES`: 为不精确匹配设置模糊行数 LINES

### ↕️ patche show

显示补丁文件的详细信息。

```shell
patche show <patch-file>
```

### ⚙️ patche settings

显示当前配置。

```shell
patche settings
```

## 🧰 配置

`patche``$HOME` 目录下的 `.patche.env` 文件加载配置。

```shell
max_diff_lines = 3
```

## 💻 开发

`patche` 使用 `pdm` 作为包管理器。要在工作空间中安装依赖项,请运行:

```bash
pdm install --prod

# 如果你想追踪 patche 的执行过程
pdm install
```

参考:[PDM 文档](https://pdm-project.org/en/latest/usage/dependency/)

0 comments on commit 8576c6b

Please sign in to comment.