https://github.com/xlucn/docdiff
Compare two text documents, and show differences in browser or terminal
https://github.com/xlucn/docdiff
diff flask plaintext
Last synced: 2 months ago
JSON representation
Compare two text documents, and show differences in browser or terminal
- Host: GitHub
- URL: https://github.com/xlucn/docdiff
- Owner: xlucn
- License: gpl-3.0
- Created: 2022-04-06T03:15:58.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-04T02:13:12.000Z (over 1 year ago)
- Last Synced: 2025-10-29T02:40:54.423Z (7 months ago)
- Topics: diff, flask, plaintext
- Language: Python
- Homepage: https://xlu.pythonanywhere.com/docdiff.html
- Size: 63.5 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 文档对比工具
自动对比两份纯文本文档,以不同颜色高亮形式输出。
增删部分分两行显示,无变化部分仅显示一行原文。
Demo: https://xlu.pythonanywhere.com/docdiff.html
## 使用方法
### 作为flask应用
```sh
gunicorn docdiff:app
```
或者
```sh
python docdiff.py -r
```
### 终端运行
注意:终端需支持标准的颜色转义字符串(如尝试执行`printf "\e[31mRed\e[0m\n"`)
```
usage: docdiff.py [-h] [-f FILE FILE] [-l] [-r]
options:
-h, --help show this help message and exit
-f FILE FILE, --file FILE FILE
Input files
-l, --line Fast line-by-line comparison
-r, --run-flask Run built-in flask app in terminal
```