From 01539440f365504125ecfbc9be3150537299fcfb Mon Sep 17 00:00:00 2001 From: Chien-Hsun Chang Date: Wed, 21 Oct 2026 18:03:31 +0800 Subject: [PATCH] chore: rename project to Text Diff --- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- CONTRIBUTING.md | 8 ++++---- README.md | 24 +++++++++++----------- README_TW.md | 22 ++++++++++---------- index.html | 8 ++++---- js/locales/en.js | 2 +- js/locales/zh-TW.js | 2 +- package-lock.json | 4 ++-- package.json | 8 ++++---- scripts/serve.mjs | 2 +- scripts/verify-browser.mjs | 2 +- 11 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 7f42db3..af30b11 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,5 +1,5 @@ name: Feature request / 功能建議 -description: Suggest an idea for Diff. 提出新功能或改善建議。 +description: Suggest an idea for Text Diff. 提出新功能或改善建議。 labels: [enhancement] body: - type: textarea diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83b720b..fc02c40 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,11 +4,11 @@ ## English -Thank you for helping improve Diff! Bug reports, ideas, translations, and pull requests are all welcome. +Thank you for helping improve Text Diff! Bug reports, ideas, translations, and pull requests are all welcome. ### Reporting issues -- Use the issue templates for [bug reports](https://github.com/KageRyo/diff/issues/new?template=bug_report.yml) and [feature requests](https://github.com/KageRyo/diff/issues/new?template=feature_request.yml). +- Use the issue templates for [bug reports](https://github.com/KageRyo/text-diff/issues/new?template=bug_report.yml) and [feature requests](https://github.com/KageRyo/text-diff/issues/new?template=feature_request.yml). - For counting or diff problems, include a minimal sample text, the options you enabled, and the result you expected. - Do not paste private or sensitive text. @@ -52,11 +52,11 @@ feat(diff): add a word-level highlight option ## 正體中文 -感謝你協助改善 Diff!歡迎回報問題、提出想法、協助翻譯或送出 pull request。 +感謝你協助改善 Text Diff!歡迎回報問題、提出想法、協助翻譯或送出 pull request。 ### 回報問題 -- 請使用 [Bug 回報](https://github.com/KageRyo/diff/issues/new?template=bug_report.yml) 與 [功能建議](https://github.com/KageRyo/diff/issues/new?template=feature_request.yml) 範本。 +- 請使用 [Bug 回報](https://github.com/KageRyo/text-diff/issues/new?template=bug_report.yml) 與 [功能建議](https://github.com/KageRyo/text-diff/issues/new?template=feature_request.yml) 範本。 - 統計或比對結果有誤時,請附上最小的範例文字、勾選的選項,以及你預期的結果。 - 請勿貼上私人或敏感內容。 diff --git a/README.md b/README.md index a5e11cc..5225329 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# Diff +# Text Diff -[正體中文](README_TW.md) · [Demo](https://kageryo.github.io/diff/) +[正體中文](README_TW.md) · [Demo](https://kageryo.github.io/text-diff/) Compare two texts side by side with git-style highlighting, and count words, characters, Chinese characters, English words, digits, symbols, and whitespace as you type. Everything runs in your browser: your text is never uploaded or stored. -[![Release](https://img.shields.io/github/v/release/KageRyo/diff)](https://github.com/KageRyo/diff/releases) +[![Release](https://img.shields.io/github/v/release/KageRyo/text-diff)](https://github.com/KageRyo/text-diff/releases) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Tocas UI](https://img.shields.io/badge/Tocas_UI-5.7-1b1c1d)](https://tocas-ui.com/) [![jsdiff](https://img.shields.io/badge/jsdiff-9.0-cb3837?logo=npm&logoColor=white)](https://github.com/kpdecker/jsdiff) [![JavaScript](https://img.shields.io/badge/JavaScript-ES_modules-F7DF1E?logo=javascript&logoColor=black)](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Modules) -[![Pages](https://github.com/KageRyo/diff/actions/workflows/pages.yml/badge.svg)](https://github.com/KageRyo/diff/actions/workflows/pages.yml) +[![Pages](https://github.com/KageRyo/text-diff/actions/workflows/pages.yml/badge.svg)](https://github.com/KageRyo/text-diff/actions/workflows/pages.yml) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) -[![GitHub stars](https://img.shields.io/github/stars/KageRyo/diff?style=flat)](https://github.com/KageRyo/diff/stargazers) -[![Last commit](https://img.shields.io/github/last-commit/KageRyo/diff)](https://github.com/KageRyo/diff/commits) +[![GitHub stars](https://img.shields.io/github/stars/KageRyo/text-diff?style=flat)](https://github.com/KageRyo/text-diff/stargazers) +[![Last commit](https://img.shields.io/github/last-commit/KageRyo/text-diff)](https://github.com/KageRyo/text-diff/commits) -[![Diff comparing two Traditional Chinese paragraphs with line and character highlights and statistics for each side](docs/images/screenshot.png)](https://kageryo.github.io/diff/) +[![Text Diff comparing two Traditional Chinese paragraphs with line and character highlights and statistics for each side](docs/images/screenshot.png)](https://kageryo.github.io/text-diff/) ## At a glance @@ -52,20 +52,20 @@ Text is split into user-perceived characters (grapheme clusters), so an emoji se ## Usage -1. Open the [demo](https://kageryo.github.io/diff/). +1. Open the [demo](https://kageryo.github.io/text-diff/). 2. Paste the original text on the left and the modified text on the right. 3. Read the differences below the editors, and switch between **Split** and **Unified** views. 4. Adjust the statistics and diff options; your choices are remembered on this device. -The diff compares lines first, then highlights the characters that changed within each modified line. Lines that are too different are highlighted as a whole, and so are the remaining lines once highlighting a very large change has taken half a second. If the texts are so different that the comparison takes longer than 2 seconds, Diff shows the whole text as replaced. +The diff compares lines first, then highlights the characters that changed within each modified line. Lines that are too different are highlighted as a whole, and so are the remaining lines once highlighting a very large change has taken half a second. If the texts are so different that the comparison takes longer than 2 seconds, Text Diff shows the whole text as replaced. ## Development You need Node.js 22 or newer. There is no build step: the page loads Tocas UI from cdnjs, and an import map in `index.html` loads jsdiff from `node_modules`, so install the dependencies before you serve the page. ```bash -git clone https://github.com/KageRyo/diff.git -cd diff +git clone https://github.com/KageRyo/text-diff.git +cd text-diff npm install npm start ``` @@ -96,7 +96,7 @@ The browser and the unit tests use the same jsdiff files from `node_modules`, so The [Pages workflow](.github/workflows/pages.yml) runs the unit and browser tests on every push and pull request, and deploys the static files to GitHub Pages from `main`. To deploy a fork, open **Settings → Pages**, select **GitHub Actions** as the source, and push to `main`. -Diff is a static site, so you can also host it on any static web server. After `npm install`, publish `index.html`, `favicon.svg`, `css/`, `js/`, and `node_modules/diff/libesm/` together with `node_modules/diff/LICENSE`. +Text Diff is a static site, so you can also host it on any static web server. After `npm install`, publish `index.html`, `favicon.svg`, `css/`, `js/`, and `node_modules/diff/libesm/` together with `node_modules/diff/LICENSE`. ## Contributing diff --git a/README_TW.md b/README_TW.md index d43743c..892c431 100644 --- a/README_TW.md +++ b/README_TW.md @@ -1,20 +1,20 @@ -# Diff 文字比對與字數統計 +# Text Diff 文字比對與字數統計 -[English](README.md) · [Demo](https://kageryo.github.io/diff/) +[English](README.md) · [Demo](https://kageryo.github.io/text-diff/) 左右貼上兩段文字,即時以 git 風格標示差異,同時統計字數、字元數、中文字、英文單字、數字、符號與空白。所有處理都在瀏覽器中完成,文字不會上傳或保存。 -[![Release](https://img.shields.io/github/v/release/KageRyo/diff)](https://github.com/KageRyo/diff/releases) +[![Release](https://img.shields.io/github/v/release/KageRyo/text-diff)](https://github.com/KageRyo/text-diff/releases) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Tocas UI](https://img.shields.io/badge/Tocas_UI-5.7-1b1c1d)](https://tocas-ui.com/) [![jsdiff](https://img.shields.io/badge/jsdiff-9.0-cb3837?logo=npm&logoColor=white)](https://github.com/kpdecker/jsdiff) [![JavaScript](https://img.shields.io/badge/JavaScript-ES_modules-F7DF1E?logo=javascript&logoColor=black)](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Modules) -[![Pages](https://github.com/KageRyo/diff/actions/workflows/pages.yml/badge.svg)](https://github.com/KageRyo/diff/actions/workflows/pages.yml) +[![Pages](https://github.com/KageRyo/text-diff/actions/workflows/pages.yml/badge.svg)](https://github.com/KageRyo/text-diff/actions/workflows/pages.yml) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) -[![GitHub stars](https://img.shields.io/github/stars/KageRyo/diff?style=flat)](https://github.com/KageRyo/diff/stargazers) -[![Last commit](https://img.shields.io/github/last-commit/KageRyo/diff)](https://github.com/KageRyo/diff/commits) +[![GitHub stars](https://img.shields.io/github/stars/KageRyo/text-diff?style=flat)](https://github.com/KageRyo/text-diff/stargazers) +[![Last commit](https://img.shields.io/github/last-commit/KageRyo/text-diff)](https://github.com/KageRyo/text-diff/commits) -[![Diff 比對兩段正體中文:逐行與逐字標示差異,並顯示兩側統計](docs/images/screenshot.png)](https://kageryo.github.io/diff/) +[![Text Diff 比對兩段正體中文:逐行與逐字標示差異,並顯示兩側統計](docs/images/screenshot.png)](https://kageryo.github.io/text-diff/) ## 功能概覽 @@ -52,7 +52,7 @@ ## 使用方式 -1. 開啟 [Demo](https://kageryo.github.io/diff/)。 +1. 開啟 [Demo](https://kageryo.github.io/text-diff/)。 2. 左側貼上原始文字、右側貼上修改後的文字。 3. 在下方查看差異,並可切換「並排」或「合併」。 4. 依需求調整統計與比對選項,設定會保存在這台裝置上。 @@ -64,8 +64,8 @@ 需要 Node.js 22 以上。本專案不需要 build:頁面從 cdnjs 載入 Tocas UI,並透過 `index.html` 的 import map 從 `node_modules` 載入 jsdiff,因此請先安裝依賴再啟動。 ```bash -git clone https://github.com/KageRyo/diff.git -cd diff +git clone https://github.com/KageRyo/text-diff.git +cd text-diff npm install npm start ``` @@ -96,7 +96,7 @@ npm run screenshot # 重新產生 docs/images/screenshot.png [Pages workflow](.github/workflows/pages.yml) 會在每次 push 與 pull request 執行單元與瀏覽器測試,並從 `main` 部署靜態檔案到 GitHub Pages。若要部署自己的 fork,請到 **Settings → Pages** 將來源設為 **GitHub Actions**,再 push 到 `main`。 -Diff 是靜態網站,也可以放到任何靜態網頁伺服器:執行 `npm install` 後,發布 `index.html`、`favicon.svg`、`css/`、`js/`,以及 `node_modules/diff/libesm/` 與 `node_modules/diff/LICENSE`。 +Text Diff 是靜態網站,也可以放到任何靜態網頁伺服器:執行 `npm install` 後,發布 `index.html`、`favicon.svg`、`css/`、`js/`,以及 `node_modules/diff/libesm/` 與 `node_modules/diff/LICENSE`。 ## 參與貢獻 diff --git a/index.html b/index.html index 3b3e6ce..cd8bd28 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - Diff · 文字比對與字數統計 + Text Diff · 文字比對與字數統計 @@ -27,7 +27,7 @@
-

Diff

+

Text Diff

文字比對與字數統計
@@ -37,7 +37,7 @@

Diff

- +
@@ -132,7 +132,7 @@

修改 diff --git a/js/locales/en.js b/js/locales/en.js index c3fcd5a..e65329d 100644 --- a/js/locales/en.js +++ b/js/locales/en.js @@ -1,6 +1,6 @@ /** English interface strings. Keep the keys in sync with zh-TW.js. */ export default { - 'app.title': 'Diff · Text Compare & Word Count', + 'app.title': 'Text Diff · Text Compare & Word Count', 'app.tagline': 'Compare texts and count words', 'theme.auto': 'Auto', 'theme.light': 'Light', diff --git a/js/locales/zh-TW.js b/js/locales/zh-TW.js index dd8fc66..9f65ecb 100644 --- a/js/locales/zh-TW.js +++ b/js/locales/zh-TW.js @@ -1,6 +1,6 @@ /** Traditional Chinese (Taiwan) interface strings. Keep the keys in sync with en.js. */ export default { - 'app.title': 'Diff · 文字比對與字數統計', + 'app.title': 'Text Diff · 文字比對與字數統計', 'app.tagline': '文字比對與字數統計', 'theme.auto': '自動', 'theme.light': '淺色', diff --git a/package-lock.json b/package-lock.json index a091e3f..832a52c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "kageryo-diff", + "name": "kageryo-text-diff", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "kageryo-diff", + "name": "kageryo-text-diff", "version": "0.1.0", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index b5d4220..e8915c7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "kageryo-diff", + "name": "kageryo-text-diff", "version": "0.1.0", "private": true, "description": "Compare two texts with git-style diffs and count words, characters, Chinese characters, letters, digits, symbols, and whitespace in your browser.", @@ -21,13 +21,13 @@ ], "author": "Chien-Hsun Chang", "license": "MIT", - "homepage": "https://kageryo.github.io/diff/", + "homepage": "https://kageryo.github.io/text-diff/", "repository": { "type": "git", - "url": "https://github.com/KageRyo/diff.git" + "url": "https://github.com/KageRyo/text-diff.git" }, "bugs": { - "url": "https://github.com/KageRyo/diff/issues" + "url": "https://github.com/KageRyo/text-diff/issues" }, "engines": { "node": ">=22" diff --git a/scripts/serve.mjs b/scripts/serve.mjs index f50f8d3..ad28564 100644 --- a/scripts/serve.mjs +++ b/scripts/serve.mjs @@ -36,5 +36,5 @@ export function startServer(port = Number(process.env.PORT) || 8080) { if (process.argv[1] === fileURLToPath(import.meta.url)) { const server = await startServer(); - console.log(`Diff is running at http://localhost:${server.address().port}`); + console.log(`Text Diff is running at http://localhost:${server.address().port}`); } diff --git a/scripts/verify-browser.mjs b/scripts/verify-browser.mjs index a421281..b9bf13d 100644 --- a/scripts/verify-browser.mjs +++ b/scripts/verify-browser.mjs @@ -96,7 +96,7 @@ try { await page.click('#lang-toggle'); await waitForText(page, '#left-title', 'Original'); assert.equal(await page.evaluate(() => document.documentElement.lang), 'en'); - assert.equal(await page.title(), 'Diff · Text Compare & Word Count'); + assert.equal(await page.title(), 'Text Diff · Text Compare & Word Count'); }); await check('cycles themes', async () => {