changelogkit 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- changelogkit-0.1.0/.gitignore +11 -0
- changelogkit-0.1.0/LICENSE +21 -0
- changelogkit-0.1.0/PKG-INFO +151 -0
- changelogkit-0.1.0/README.md +123 -0
- changelogkit-0.1.0/examples/README.md +22 -0
- changelogkit-0.1.0/examples/repo/.changelog.toml +14 -0
- changelogkit-0.1.0/examples/repo/Docs/ChangeHistory.md +24 -0
- changelogkit-0.1.0/examples/repo/Docs/development/features.json +12 -0
- changelogkit-0.1.0/examples/repo/Sources/Sample.swift +9 -0
- changelogkit-0.1.0/pyproject.toml +44 -0
- changelogkit-0.1.0/src/changelogkit/__init__.py +11 -0
- changelogkit-0.1.0/src/changelogkit/__main__.py +6 -0
- changelogkit-0.1.0/src/changelogkit/assets/about.html +37 -0
- changelogkit-0.1.0/src/changelogkit/assets/about.js +22 -0
- changelogkit-0.1.0/src/changelogkit/assets/dev.css +90 -0
- changelogkit-0.1.0/src/changelogkit/assets/dev.html +29 -0
- changelogkit-0.1.0/src/changelogkit/assets/dev.js +244 -0
- changelogkit-0.1.0/src/changelogkit/assets/file.css +51 -0
- changelogkit-0.1.0/src/changelogkit/assets/file.html +29 -0
- changelogkit-0.1.0/src/changelogkit/assets/file.js +101 -0
- changelogkit-0.1.0/src/changelogkit/assets/highlight.js +74 -0
- changelogkit-0.1.0/src/changelogkit/assets/i18n.js +10 -0
- changelogkit-0.1.0/src/changelogkit/assets/index.css +49 -0
- changelogkit-0.1.0/src/changelogkit/assets/index.html +56 -0
- changelogkit-0.1.0/src/changelogkit/assets/index.js +175 -0
- changelogkit-0.1.0/src/changelogkit/assets/markdown.js +144 -0
- changelogkit-0.1.0/src/changelogkit/assets/static_dev.html +37 -0
- changelogkit-0.1.0/src/changelogkit/assets/static_doc.html +30 -0
- changelogkit-0.1.0/src/changelogkit/assets/static_history.html +46 -0
- changelogkit-0.1.0/src/changelogkit/assets/theme.css +86 -0
- changelogkit-0.1.0/src/changelogkit/assets/theme.js +28 -0
- changelogkit-0.1.0/src/changelogkit/assets.py +55 -0
- changelogkit-0.1.0/src/changelogkit/buildinfo.py +71 -0
- changelogkit-0.1.0/src/changelogkit/cli.py +190 -0
- changelogkit-0.1.0/src/changelogkit/config.py +123 -0
- changelogkit-0.1.0/src/changelogkit/export.py +219 -0
- changelogkit-0.1.0/src/changelogkit/history.py +233 -0
- changelogkit-0.1.0/src/changelogkit/i18n.py +92 -0
- changelogkit-0.1.0/src/changelogkit/index.py +288 -0
- changelogkit-0.1.0/src/changelogkit/lang/en.json +140 -0
- changelogkit-0.1.0/src/changelogkit/lang/zh-TW.json +140 -0
- changelogkit-0.1.0/src/changelogkit/scanners/__init__.py +60 -0
- changelogkit-0.1.0/src/changelogkit/scanners/common.py +48 -0
- changelogkit-0.1.0/src/changelogkit/scanners/cpp.py +61 -0
- changelogkit-0.1.0/src/changelogkit/scanners/csharp.py +49 -0
- changelogkit-0.1.0/src/changelogkit/scanners/dart.py +49 -0
- changelogkit-0.1.0/src/changelogkit/scanners/go.py +55 -0
- changelogkit-0.1.0/src/changelogkit/scanners/java.py +49 -0
- changelogkit-0.1.0/src/changelogkit/scanners/javascript.py +46 -0
- changelogkit-0.1.0/src/changelogkit/scanners/kotlin.py +57 -0
- changelogkit-0.1.0/src/changelogkit/scanners/python.py +33 -0
- changelogkit-0.1.0/src/changelogkit/scanners/ruby.py +47 -0
- changelogkit-0.1.0/src/changelogkit/scanners/rust.py +67 -0
- changelogkit-0.1.0/src/changelogkit/scanners/swift.py +72 -0
- changelogkit-0.1.0/src/changelogkit/server.py +134 -0
- changelogkit-0.1.0/tests/test_changelogkit.py +257 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nuclear0709
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: changelogkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: 本機變更歷史 GUI 與開發索引:解析 ChangeHistory.md、唯讀索引 Git/文件/API 宣告
|
|
5
|
+
Project-URL: Homepage, https://github.com/TwhomeGH/ChangeLogKit
|
|
6
|
+
Project-URL: Repository, https://github.com/TwhomeGH/ChangeLogKit
|
|
7
|
+
Project-URL: Issues, https://github.com/TwhomeGH/ChangeLogKit/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/TwhomeGH/ChangeLogKit/tree/main/Docs
|
|
9
|
+
Author: TwhomeGH
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: changelog,developer-tools,docc,documentation,git
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
24
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: tomli>=2; python_version < '3.11'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# changelogkit
|
|
30
|
+
|
|
31
|
+
本機(開發機)用的兩合一工具,與特定 repo 解耦:
|
|
32
|
+
|
|
33
|
+
- **變更歷史 GUI**:解析 `Docs/ChangeHistory.md`(路徑可設定),提供網頁瀏覽/新增/編輯與 CLI 檢索。
|
|
34
|
+
- **開發索引**:唯讀索引 Git 近期改動(提交可展開看 unified diff,含語法上色)、Swift 宣告定位、Markdown 文件與鎖定套件。
|
|
35
|
+
|
|
36
|
+
不需要 Xcode;只要開發機有 Python 3.10+ 與 `git`。
|
|
37
|
+
|
|
38
|
+
## 安裝
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pipx install changelogkit # 建議:隔離安裝並提供全域指令
|
|
42
|
+
# 或
|
|
43
|
+
pip install changelogkit
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 在 PyPI 上線前如何使用
|
|
47
|
+
|
|
48
|
+
套件尚未發佈到 PyPI 時,有三種本機用法(擇一)。以下把 `<ChangeLogTools>` 換成套件所在目錄。
|
|
49
|
+
|
|
50
|
+
### 1. 零安裝(最快;改程式即時生效)
|
|
51
|
+
|
|
52
|
+
用**絕對路徑**的 `PYTHONPATH` 指向套件的 `src/`,即可在任何 repo 內執行:
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
$env:PYTHONPATH = "<ChangeLogTools>\src" # PowerShell;路徑要用絕對路徑
|
|
56
|
+
cd D:\某個repo
|
|
57
|
+
python -m changelogkit serve --no-browser
|
|
58
|
+
python -m changelogkit list
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
(可在該 repo 放一個薄殼 `change_log.cmd` 包住上述指令,之後雙擊即可。)
|
|
62
|
+
|
|
63
|
+
### 2. 可編輯安裝(開發套件本身)
|
|
64
|
+
|
|
65
|
+
```powershell
|
|
66
|
+
cd <ChangeLogTools>
|
|
67
|
+
pip install -e .
|
|
68
|
+
changelogkit serve
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
> ⚠️ **路徑含非 ASCII 字元時不要用 `-e`。** 若套件放在像 `…\桌面\…` 這種路徑,editable 安裝會寫出含中文路徑的 `.pth`;在 **cp950(繁體中文)語系的 Windows** 上,Python 以 locale 讀 `.pth` 會 `UnicodeDecodeError`,害**任何 `python`/`pip` 指令都啟動不了**(`Fatal Python error: init_import_site`)。
|
|
72
|
+
> 解法:刪掉那個 `.pth` 後改用一般安裝 `pip install <ChangeLogTools>`(複製進 site-packages,不產生 `.pth`)或第 3 種 pipx;也可先 `set PYTHONUTF8=1`。
|
|
73
|
+
|
|
74
|
+
### 3. 全域 CLI、又保持隔離(推薦)
|
|
75
|
+
|
|
76
|
+
```powershell
|
|
77
|
+
pipx install <ChangeLogTools>
|
|
78
|
+
# 之後更新程式:
|
|
79
|
+
pipx install --force <ChangeLogTools>
|
|
80
|
+
# 或直接從 git(不經 PyPI):
|
|
81
|
+
pipx install git+https://github.com/TwhomeGH/ChangeLogKit.git
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 驗證「使用者真正拿到的成品」
|
|
85
|
+
|
|
86
|
+
```powershell
|
|
87
|
+
python -m build
|
|
88
|
+
python -m venv .venv
|
|
89
|
+
.\.venv\Scripts\pip install dist\changelogkit-0.1.0-py3-none-any.whl
|
|
90
|
+
.\.venv\Scripts\changelogkit --help
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 使用
|
|
94
|
+
|
|
95
|
+
在任何 repo 目錄下執行:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
changelogkit # 等同 serve:啟動本機網頁 GUI
|
|
99
|
+
changelogkit serve --port 8710 --no-browser
|
|
100
|
+
changelogkit add "修正 XXX" --type 修復 --file a/b.swift
|
|
101
|
+
changelogkit list --grep RTMP
|
|
102
|
+
changelogkit show 3
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
網頁 GUI:`/` 為變更歷史,`/development` 為開發索引(功能/API 宣告/文件/近期改動)。
|
|
106
|
+
|
|
107
|
+
## 設定:`.changelog.toml`
|
|
108
|
+
|
|
109
|
+
放在 repo 根目錄(工具會從工作目錄往上尋找;找不到就用預設值):
|
|
110
|
+
|
|
111
|
+
```toml
|
|
112
|
+
[tool.changelog]
|
|
113
|
+
title = "ReplyKit 變更歷史" # 網頁標題
|
|
114
|
+
history = "Docs/ChangeHistory.md" # 變更歷史 markdown
|
|
115
|
+
features = "Docs/development/features.json" # 選填:功能清單
|
|
116
|
+
assets = "Scripts/changelog-overrides" # 選填:覆寫預設網頁資產
|
|
117
|
+
|
|
118
|
+
[[tool.changelog.sources]] # 開發索引要一起看的 repo(預設只有自己)
|
|
119
|
+
name = "app"
|
|
120
|
+
path = "."
|
|
121
|
+
[[tool.changelog.sources]]
|
|
122
|
+
name = "haishinkit"
|
|
123
|
+
path = "${HAISHINKIT_ROOT}" # 支援環境變數;不存在就略過
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
未設定時預設:`history = Docs/ChangeHistory.md`、`features = Docs/development/features.json`、
|
|
127
|
+
`title = <repo 目錄名>`、單一來源(自己)。`path` 支援 `${ENV}` 展開。
|
|
128
|
+
|
|
129
|
+
### 覆寫網頁資產
|
|
130
|
+
|
|
131
|
+
`assets` 指向一個目錄;載入資產時**先找該目錄的同名檔,找不到才用套件預設**。因此可以:
|
|
132
|
+
|
|
133
|
+
- 只放 `theme.css` → 只換配色;
|
|
134
|
+
- 放整套 `index.*`/`dev.*`/`file.*` → 整包換掉版面。
|
|
135
|
+
|
|
136
|
+
## 文件
|
|
137
|
+
|
|
138
|
+
- [安裝與本地使用](Docs/install.md):三種裝法、cp950/中文路徑地雷、解除安裝
|
|
139
|
+
- [用法](Docs/usage.md):指令、`.changelog.toml` 全欄位、資產覆寫、變更歷史格式
|
|
140
|
+
- [GitHub Pages](Docs/pages.md):靜態匯出的產物、限制與啟用方式
|
|
141
|
+
- [PyPI 發佈](Docs/publishing.md):Trusted Publishing 設定與版本流程
|
|
142
|
+
- [架構](Docs/architecture.md):模組結構與設計要點
|
|
143
|
+
|
|
144
|
+
## 開發
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
pip install -e .
|
|
148
|
+
python tests/test_changelogkit.py
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
網頁資產在 `src/changelogkit/assets/`,改版面/配色只需動這些檔案,不必改 Python。
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# changelogkit
|
|
2
|
+
|
|
3
|
+
本機(開發機)用的兩合一工具,與特定 repo 解耦:
|
|
4
|
+
|
|
5
|
+
- **變更歷史 GUI**:解析 `Docs/ChangeHistory.md`(路徑可設定),提供網頁瀏覽/新增/編輯與 CLI 檢索。
|
|
6
|
+
- **開發索引**:唯讀索引 Git 近期改動(提交可展開看 unified diff,含語法上色)、Swift 宣告定位、Markdown 文件與鎖定套件。
|
|
7
|
+
|
|
8
|
+
不需要 Xcode;只要開發機有 Python 3.10+ 與 `git`。
|
|
9
|
+
|
|
10
|
+
## 安裝
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pipx install changelogkit # 建議:隔離安裝並提供全域指令
|
|
14
|
+
# 或
|
|
15
|
+
pip install changelogkit
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 在 PyPI 上線前如何使用
|
|
19
|
+
|
|
20
|
+
套件尚未發佈到 PyPI 時,有三種本機用法(擇一)。以下把 `<ChangeLogTools>` 換成套件所在目錄。
|
|
21
|
+
|
|
22
|
+
### 1. 零安裝(最快;改程式即時生效)
|
|
23
|
+
|
|
24
|
+
用**絕對路徑**的 `PYTHONPATH` 指向套件的 `src/`,即可在任何 repo 內執行:
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
$env:PYTHONPATH = "<ChangeLogTools>\src" # PowerShell;路徑要用絕對路徑
|
|
28
|
+
cd D:\某個repo
|
|
29
|
+
python -m changelogkit serve --no-browser
|
|
30
|
+
python -m changelogkit list
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
(可在該 repo 放一個薄殼 `change_log.cmd` 包住上述指令,之後雙擊即可。)
|
|
34
|
+
|
|
35
|
+
### 2. 可編輯安裝(開發套件本身)
|
|
36
|
+
|
|
37
|
+
```powershell
|
|
38
|
+
cd <ChangeLogTools>
|
|
39
|
+
pip install -e .
|
|
40
|
+
changelogkit serve
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> ⚠️ **路徑含非 ASCII 字元時不要用 `-e`。** 若套件放在像 `…\桌面\…` 這種路徑,editable 安裝會寫出含中文路徑的 `.pth`;在 **cp950(繁體中文)語系的 Windows** 上,Python 以 locale 讀 `.pth` 會 `UnicodeDecodeError`,害**任何 `python`/`pip` 指令都啟動不了**(`Fatal Python error: init_import_site`)。
|
|
44
|
+
> 解法:刪掉那個 `.pth` 後改用一般安裝 `pip install <ChangeLogTools>`(複製進 site-packages,不產生 `.pth`)或第 3 種 pipx;也可先 `set PYTHONUTF8=1`。
|
|
45
|
+
|
|
46
|
+
### 3. 全域 CLI、又保持隔離(推薦)
|
|
47
|
+
|
|
48
|
+
```powershell
|
|
49
|
+
pipx install <ChangeLogTools>
|
|
50
|
+
# 之後更新程式:
|
|
51
|
+
pipx install --force <ChangeLogTools>
|
|
52
|
+
# 或直接從 git(不經 PyPI):
|
|
53
|
+
pipx install git+https://github.com/TwhomeGH/ChangeLogKit.git
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 驗證「使用者真正拿到的成品」
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
python -m build
|
|
60
|
+
python -m venv .venv
|
|
61
|
+
.\.venv\Scripts\pip install dist\changelogkit-0.1.0-py3-none-any.whl
|
|
62
|
+
.\.venv\Scripts\changelogkit --help
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 使用
|
|
66
|
+
|
|
67
|
+
在任何 repo 目錄下執行:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
changelogkit # 等同 serve:啟動本機網頁 GUI
|
|
71
|
+
changelogkit serve --port 8710 --no-browser
|
|
72
|
+
changelogkit add "修正 XXX" --type 修復 --file a/b.swift
|
|
73
|
+
changelogkit list --grep RTMP
|
|
74
|
+
changelogkit show 3
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
網頁 GUI:`/` 為變更歷史,`/development` 為開發索引(功能/API 宣告/文件/近期改動)。
|
|
78
|
+
|
|
79
|
+
## 設定:`.changelog.toml`
|
|
80
|
+
|
|
81
|
+
放在 repo 根目錄(工具會從工作目錄往上尋找;找不到就用預設值):
|
|
82
|
+
|
|
83
|
+
```toml
|
|
84
|
+
[tool.changelog]
|
|
85
|
+
title = "ReplyKit 變更歷史" # 網頁標題
|
|
86
|
+
history = "Docs/ChangeHistory.md" # 變更歷史 markdown
|
|
87
|
+
features = "Docs/development/features.json" # 選填:功能清單
|
|
88
|
+
assets = "Scripts/changelog-overrides" # 選填:覆寫預設網頁資產
|
|
89
|
+
|
|
90
|
+
[[tool.changelog.sources]] # 開發索引要一起看的 repo(預設只有自己)
|
|
91
|
+
name = "app"
|
|
92
|
+
path = "."
|
|
93
|
+
[[tool.changelog.sources]]
|
|
94
|
+
name = "haishinkit"
|
|
95
|
+
path = "${HAISHINKIT_ROOT}" # 支援環境變數;不存在就略過
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
未設定時預設:`history = Docs/ChangeHistory.md`、`features = Docs/development/features.json`、
|
|
99
|
+
`title = <repo 目錄名>`、單一來源(自己)。`path` 支援 `${ENV}` 展開。
|
|
100
|
+
|
|
101
|
+
### 覆寫網頁資產
|
|
102
|
+
|
|
103
|
+
`assets` 指向一個目錄;載入資產時**先找該目錄的同名檔,找不到才用套件預設**。因此可以:
|
|
104
|
+
|
|
105
|
+
- 只放 `theme.css` → 只換配色;
|
|
106
|
+
- 放整套 `index.*`/`dev.*`/`file.*` → 整包換掉版面。
|
|
107
|
+
|
|
108
|
+
## 文件
|
|
109
|
+
|
|
110
|
+
- [安裝與本地使用](Docs/install.md):三種裝法、cp950/中文路徑地雷、解除安裝
|
|
111
|
+
- [用法](Docs/usage.md):指令、`.changelog.toml` 全欄位、資產覆寫、變更歷史格式
|
|
112
|
+
- [GitHub Pages](Docs/pages.md):靜態匯出的產物、限制與啟用方式
|
|
113
|
+
- [PyPI 發佈](Docs/publishing.md):Trusted Publishing 設定與版本流程
|
|
114
|
+
- [架構](Docs/architecture.md):模組結構與設計要點
|
|
115
|
+
|
|
116
|
+
## 開發
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pip install -e .
|
|
120
|
+
python tests/test_changelogkit.py
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
網頁資產在 `src/changelogkit/assets/`,改版面/配色只需動這些檔案,不必改 Python。
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# 範例 repo
|
|
2
|
+
|
|
3
|
+
把這個目錄當成一個獨立 repo 的縮影,示範 `changelogkit` 需要的檔案與設定:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
repo/
|
|
7
|
+
.changelog.toml # 設定(可省略,用預設值)
|
|
8
|
+
Docs/ChangeHistory.md # 變更歷史(必要)
|
|
9
|
+
Docs/development/features.json # 功能清單(選填)
|
|
10
|
+
Sources/Sample.swift # 被索引的原始碼(開發索引用)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
試跑(先 `pip install -e ..`,或在 repo 內設定 `PYTHONPATH` 指向套件的 `src`):
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cd examples/repo
|
|
17
|
+
changelogkit serve --no-browser # 開 / 與 /development
|
|
18
|
+
changelogkit list
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
複製 `.changelog.toml` 到你的專案根目錄,再依需要調整 `title` / `history` /
|
|
22
|
+
`features` / `assets` / `sources` 即可。
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# 這個 repo 的 changelogkit 設定。全部欄位皆可省略(省略時用預設值)。
|
|
2
|
+
[tool.changelog]
|
|
3
|
+
title = "範例專案變更歷史"
|
|
4
|
+
history = "Docs/ChangeHistory.md"
|
|
5
|
+
features = "Docs/development/features.json"
|
|
6
|
+
# assets = "Scripts/changelog-overrides" # 選填:覆寫預設網頁資產的目錄
|
|
7
|
+
|
|
8
|
+
# 開發索引要一起看的來源;未設定時預設為單一來源(name = "app", path = ".")。
|
|
9
|
+
# [[tool.changelog.sources]]
|
|
10
|
+
# name = "app"
|
|
11
|
+
# path = "."
|
|
12
|
+
# [[tool.changelog.sources]]
|
|
13
|
+
# name = "lib"
|
|
14
|
+
# path = "${SOME_LIB_ROOT}" # 支援 ${ENV} 展開;不存在就略過
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
## 2026.01.02 10:00 新增範例功能
|
|
2
|
+
|
|
3
|
+
**類型**: 功能 · **檔案**: `Sources/Sample.swift`
|
|
4
|
+
|
|
5
|
+
### 修改 - 新增 Sample
|
|
6
|
+
|
|
7
|
+
- 示範一條變更紀錄的格式。
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 2026.01.01 09:00 範例修正
|
|
12
|
+
|
|
13
|
+
**類型**: 修正 · **檔案**: `Sources/Sample.swift`
|
|
14
|
+
|
|
15
|
+
### 問題 - 有錯
|
|
16
|
+
|
|
17
|
+
說明。
|
|
18
|
+
|
|
19
|
+
### 根因 - 原因
|
|
20
|
+
|
|
21
|
+
說明。
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "sample-feature",
|
|
4
|
+
"name": "範例功能",
|
|
5
|
+
"summary": "示範功能清單的一筆(欄位完全通用)。",
|
|
6
|
+
"labels": { "platform": "平台", "status": "狀態" },
|
|
7
|
+
"platform": "iOS / macOS",
|
|
8
|
+
"status": "待驗證",
|
|
9
|
+
"files": ["Sources/Sample.swift"],
|
|
10
|
+
"docs": ["Docs/ChangeHistory.md"]
|
|
11
|
+
}
|
|
12
|
+
]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "changelogkit"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "本機變更歷史 GUI 與開發索引:解析 ChangeHistory.md、唯讀索引 Git/文件/API 宣告"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "TwhomeGH" }]
|
|
13
|
+
keywords = ["changelog", "documentation", "docc", "git", "developer-tools"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Topic :: Software Development :: Documentation",
|
|
26
|
+
"Topic :: Software Development :: Version Control :: Git",
|
|
27
|
+
]
|
|
28
|
+
# tomllib 是 Python 3.11+ 的標準庫;3.10 需要 tomli 讀 .changelog.toml。
|
|
29
|
+
dependencies = ["tomli>=2; python_version < '3.11'"]
|
|
30
|
+
|
|
31
|
+
[project.scripts]
|
|
32
|
+
changelogkit = "changelogkit.cli:main"
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/TwhomeGH/ChangeLogKit"
|
|
36
|
+
Repository = "https://github.com/TwhomeGH/ChangeLogKit"
|
|
37
|
+
Issues = "https://github.com/TwhomeGH/ChangeLogKit/issues"
|
|
38
|
+
Documentation = "https://github.com/TwhomeGH/ChangeLogKit/tree/main/Docs"
|
|
39
|
+
|
|
40
|
+
[tool.hatch.build.targets.wheel]
|
|
41
|
+
packages = ["src/changelogkit"]
|
|
42
|
+
|
|
43
|
+
[tool.hatch.build.targets.sdist]
|
|
44
|
+
include = ["src", "tests", "examples", "README.md"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""changelogkit:本機變更歷史 GUI 與開發索引。
|
|
2
|
+
|
|
3
|
+
通用工具,與任何特定 repo 解耦:
|
|
4
|
+
|
|
5
|
+
* 變更歷史 — 解析 ``Docs/ChangeHistory.md``(可設定路徑),提供網頁 GUI 與 CLI。
|
|
6
|
+
* 開發索引 — 唯讀索引 Git 近期改動(可展開 diff)、Swift 宣告定位、Markdown 文件。
|
|
7
|
+
|
|
8
|
+
每個 repo 的差異由 repo 根目錄的 ``.changelog.toml`` 提供;未提供時用預設值。
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="{{lang_html}}"><head>
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
5
|
+
<title>{{t.about.title}}</title>
|
|
6
|
+
<script src="/assets/theme.js"></script>
|
|
7
|
+
<script src="/assets/i18n.js"></script>
|
|
8
|
+
<script>window.CK_I18N = {{i18n_json}};</script>
|
|
9
|
+
<link rel="stylesheet" href="/assets/theme.css">
|
|
10
|
+
<style>
|
|
11
|
+
main { max-width: 720px; margin: 0 auto; padding: 24px }
|
|
12
|
+
.card dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 10px 0 0 }
|
|
13
|
+
.card dt { color: var(--mut); font-size: 13px }
|
|
14
|
+
.card dd { margin: 0; overflow-wrap: anywhere }
|
|
15
|
+
.card code { font-size: 13px }
|
|
16
|
+
</style>
|
|
17
|
+
</head><body>
|
|
18
|
+
<header class="appbar">
|
|
19
|
+
<h1>{{t.about.title}}</h1>
|
|
20
|
+
<a href="/">{{t.nav.history}}</a>
|
|
21
|
+
<a href="/development">{{t.nav.dev}}</a>
|
|
22
|
+
<button id="theme" aria-label="{{t.btn.theme}}" title="{{t.btn.theme}}">🌙</button>
|
|
23
|
+
</header>
|
|
24
|
+
<main>
|
|
25
|
+
<article class="card">
|
|
26
|
+
<h2>changelogkit</h2>
|
|
27
|
+
<p class="muted">{{t.about.intro}}</p>
|
|
28
|
+
<dl>
|
|
29
|
+
<dt>{{t.about.version}}</dt><dd id="version">…</dd>
|
|
30
|
+
<dt>{{t.about.commit}}</dt><dd id="commit">…</dd>
|
|
31
|
+
<dt>{{t.about.locales}}</dt><dd id="locales">…</dd>
|
|
32
|
+
<dt>{{t.about.home}}</dt><dd><a href="https://github.com/TwhomeGH/ChangeLogKit">github.com/TwhomeGH/ChangeLogKit</a></dd>
|
|
33
|
+
</dl>
|
|
34
|
+
</article>
|
|
35
|
+
</main>
|
|
36
|
+
<script src="/assets/about.js"></script>
|
|
37
|
+
</body></html>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* 關於頁:向 /api/buildinfo 取版本與來源 commit(commit 連到 GitHub)。 */
|
|
2
|
+
const REPO = "https://github.com/TwhomeGH/ChangeLogKit";
|
|
3
|
+
|
|
4
|
+
fetch("/api/buildinfo")
|
|
5
|
+
.then((r) => r.json())
|
|
6
|
+
.then((b) => {
|
|
7
|
+
document.getElementById("version").textContent = b.version || CK_T("about.na");
|
|
8
|
+
/* UI 語系清單,* 標示目前生效者。 */
|
|
9
|
+
document.getElementById("locales").textContent =
|
|
10
|
+
(b.locales || []).map((l) => l + (l === b.locale ? " *" : "")).join(" ");
|
|
11
|
+
const raw = b.commit || "";
|
|
12
|
+
if (!raw) {
|
|
13
|
+
document.getElementById("commit").textContent = CK_T("about.unknown");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const hash = raw.replace(/\+dirty$/, "");
|
|
17
|
+
document.getElementById("commit").innerHTML =
|
|
18
|
+
'<a href="' + REPO + "/commit/" + hash + '"><code>' + raw + "</code></a>";
|
|
19
|
+
})
|
|
20
|
+
.catch(() => {
|
|
21
|
+
document.getElementById("version").textContent = CK_T("about.load_failed");
|
|
22
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* 開發索引頁面版面。主題與共用元件在 theme.css。 */
|
|
2
|
+
main { max-width: 1100px; margin: auto; padding: 24px 28px 60px }
|
|
3
|
+
#hint { margin: 4px 0 0 }
|
|
4
|
+
#tabs { display: flex; gap: 8px; margin: 18px 0 6px; flex-wrap: wrap }
|
|
5
|
+
#tabs button { white-space: nowrap }
|
|
6
|
+
#tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent) }
|
|
7
|
+
#message { padding: 6px 0 10px; font-size: 13px }
|
|
8
|
+
article.card h2 { margin: 0 0 6px; font-size: 19px; line-height: 1.35 }
|
|
9
|
+
article.card h2 a { color: var(--fg); text-decoration: none }
|
|
10
|
+
article.card h2 a:hover { color: var(--accent); text-decoration: underline }
|
|
11
|
+
.meta { font-size: 12.5px; color: var(--mut); margin-bottom: 8px }
|
|
12
|
+
.kind {
|
|
13
|
+
display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em;
|
|
14
|
+
padding: 1px 7px; border-radius: 6px; background: var(--code); color: var(--accent); margin-right: 6px;
|
|
15
|
+
}
|
|
16
|
+
.card dl { display: grid; grid-template-columns: 108px 1fr; gap: 6px 12px; margin: 10px 0 4px }
|
|
17
|
+
.card dt { color: var(--mut); font-size: 13px } .card dd { margin: 0 }
|
|
18
|
+
.card h3 { font-size: 13px; color: var(--mut); margin: 14px 0 6px; text-transform: none }
|
|
19
|
+
.doc { line-height: 1.6 } .doc p { margin: .3em 0 } .doc ul { margin: .3em 0; padding-left: 1.3em }
|
|
20
|
+
.files a { display: inline-block; margin: 0 12px 6px 0 }
|
|
21
|
+
.preview { font: 13px/1.6 ui-monospace, Consolas, "Courier New", monospace; color: var(--mut); white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0 }
|
|
22
|
+
pre.blob { background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow: auto; font-size: 12.5px; line-height: 1.55 }
|
|
23
|
+
.deps { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin-top: 6px }
|
|
24
|
+
.deps code { font-size: 12.5px }
|
|
25
|
+
@media (max-width: 640px) {
|
|
26
|
+
main { padding: 16px 16px 48px }
|
|
27
|
+
.card dl { grid-template-columns: 1fr }
|
|
28
|
+
.card dt { font-weight: 700 }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* 「API 宣告」篩選列。 */
|
|
32
|
+
#filters { margin: 4px 0 10px; display: flex; flex-direction: column; gap: 6px }
|
|
33
|
+
#filters .supported { font-size: 12.5px; color: var(--mut); overflow-wrap: anywhere }
|
|
34
|
+
#filters .chips { display: flex; flex-wrap: wrap; gap: 6px 8px }
|
|
35
|
+
#filters .chip.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent) }
|
|
36
|
+
#filters .kindfilter { font-size: 13px; color: var(--mut) }
|
|
37
|
+
#filters .kindfilter select { width: auto; margin-left: 6px }
|
|
38
|
+
|
|
39
|
+
/* 符號簽名列:等寬、可換行、深淺色一致。 */
|
|
40
|
+
.sig {
|
|
41
|
+
margin: 6px 0 10px; padding: 9px 12px; border-radius: 10px;
|
|
42
|
+
background: var(--code); border: 1px solid var(--line);
|
|
43
|
+
color: var(--fg); font-size: 12.5px; white-space: pre-wrap;
|
|
44
|
+
word-break: break-word; overflow-x: auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* 近期改動:提交卡片與差異檢視。 */
|
|
48
|
+
.commits { display: flex; flex-direction: column; gap: 6px }
|
|
49
|
+
.commit { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg) }
|
|
50
|
+
.commit-head {
|
|
51
|
+
display: flex; flex-direction: column; gap: 3px; align-items: stretch; width: 100%;
|
|
52
|
+
text-align: left; background: transparent; border: 0; border-radius: 0; padding: 8px 12px;
|
|
53
|
+
}
|
|
54
|
+
.commit-head:hover { background: var(--line2) }
|
|
55
|
+
.commit-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap }
|
|
56
|
+
.commit-head .hash { color: var(--accent); font-size: 12.5px; background: none; padding: 0 }
|
|
57
|
+
.commit-head .when { color: var(--mut); font-size: 12px; white-space: nowrap }
|
|
58
|
+
.commit-head .subject { font-weight: 600; white-space: normal; overflow-wrap: anywhere }
|
|
59
|
+
.commit-files { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 7px 12px; border-top: 1px solid var(--line2) }
|
|
60
|
+
.commit-files a.cfile { font-size: 12px; color: var(--mut) }
|
|
61
|
+
.commit-files a.cfile:hover { color: var(--accent) }
|
|
62
|
+
.wt-wrap { margin: 6px 0 2px }
|
|
63
|
+
.commit .diff, .wt-wrap .diff { padding: 8px 12px 10px }
|
|
64
|
+
|
|
65
|
+
/* 統一分歧(unified diff):等寬、可橫向捲動,+/- 綠紅底色。 */
|
|
66
|
+
.dpre {
|
|
67
|
+
margin: 0; background: var(--code); border: 1px solid var(--line); border-radius: 10px;
|
|
68
|
+
overflow: auto; padding: 8px 0; white-space: pre;
|
|
69
|
+
font: 12.5px/1.55 ui-monospace, Consolas, "Courier New", monospace;
|
|
70
|
+
}
|
|
71
|
+
.dline { display: block; padding: 0 12px }
|
|
72
|
+
.dmark { display: inline-block; width: 1.3em; color: var(--mut); user-select: none }
|
|
73
|
+
.d-add { background: rgba(16, 185, 129, .14) }
|
|
74
|
+
.d-del { background: rgba(239, 68, 68, .13) }
|
|
75
|
+
.d-add .dmark { color: #059669 } .d-del .dmark { color: #dc2626 }
|
|
76
|
+
.d-hunk { color: #8b5cf6; background: rgba(139, 92, 246, .08) }
|
|
77
|
+
.d-file { color: var(--mut); font-weight: 600 }
|
|
78
|
+
.d-meta { color: var(--mut) }
|
|
79
|
+
|
|
80
|
+
/* 靜態匯出:<details class="commit">(動態版用 button.commit-head,故這些規則不衝突)。 */
|
|
81
|
+
details.commit > summary { padding: 8px 12px; cursor: pointer }
|
|
82
|
+
details.commit > summary::marker { color: var(--mut) }
|
|
83
|
+
details.commit > summary:hover { background: var(--line2) }
|
|
84
|
+
details.commit > summary .cbody { display: block }
|
|
85
|
+
details.commit > summary .commit-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap }
|
|
86
|
+
details.commit > summary .hash { color: var(--accent); font-size: 12.5px; background: none; padding: 0 }
|
|
87
|
+
details.commit > summary .when { color: var(--mut); font-size: 12px; white-space: nowrap }
|
|
88
|
+
details.commit > summary .subject { display: block; font-weight: 600; white-space: normal; overflow-wrap: anywhere }
|
|
89
|
+
details.commit > .commit-files { border-top: 1px solid var(--line2) }
|
|
90
|
+
details.commit > .dpre { margin: 8px 12px 10px }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="{{lang_html}}"><head>
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
5
|
+
<title>{{t.dev.title}}</title>
|
|
6
|
+
<script src="/assets/theme.js"></script>
|
|
7
|
+
<script src="/assets/i18n.js"></script>
|
|
8
|
+
<script>window.CK_I18N = {{i18n_json}};</script>
|
|
9
|
+
<link rel="stylesheet" href="/assets/theme.css">
|
|
10
|
+
<link rel="stylesheet" href="/assets/dev.css">
|
|
11
|
+
</head><body>
|
|
12
|
+
<header class="appbar">
|
|
13
|
+
<h1>{{t.dev.title}}</h1>
|
|
14
|
+
<a href="/">{{t.nav.history}}</a>
|
|
15
|
+
<a href="/about">{{t.nav.about}}</a>
|
|
16
|
+
<input id="search" aria-label="{{t.dev.search}}" placeholder="{{t.dev.search}}">
|
|
17
|
+
<select id="repo" aria-label="{{t.dev.repo_all}}"><option value="">{{t.dev.repo_all}}</option></select>
|
|
18
|
+
<button id="reload" aria-label="{{t.dev.reload}}" title="{{t.dev.reload}}">↻</button>
|
|
19
|
+
<button id="theme" aria-label="{{t.btn.theme}}" title="{{t.btn.theme}}">🌙</button>
|
|
20
|
+
</header>
|
|
21
|
+
<main>
|
|
22
|
+
<p class="muted" id="hint">{{t.dev.hint}}</p>
|
|
23
|
+
<nav id="tabs"></nav>
|
|
24
|
+
<div id="message" role="status" class="muted">{{t.dev.loading}}</div>
|
|
25
|
+
<div id="filters" hidden></div>
|
|
26
|
+
<section id="results"></section>
|
|
27
|
+
</main>
|
|
28
|
+
<script src="/assets/dev.js"></script>
|
|
29
|
+
</body></html>
|