Skip to content

Commit 7234550

Browse files
committed
docs: 优化文档结构和内容
- 重新组织文档目录结构,将 commit.md 和 version-log.md 移动到 docs/docs/ 目录下 - 更新 README.md 和 README_EN.md 中的链接和文本内容 - 更新导航配置,添加更新日志和问题反馈链接 - 优化版本日志生成脚本的逻辑和代码结构 - 更新 package.json 添加翻译脚本命令 - 修正文档中的拼写和格式问题
1 parent 3e89433 commit 7234550

File tree

8 files changed

+64
-35
lines changed

8 files changed

+64
-35
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
[Discord](https://discord.gg/3wDmhCsVeU) ·
1313
[使用文档](https://linuxdo-scripts.zishu.me) ·
14+
[更新日志](http://linuxdo-scripts.zishu.me/version-log) ·
1415
[问题反馈](https://github.com/anghunk/linuxdo-scripts/issues/new/choose) ·
1516
[最新版本](https://github.com/anghunk/linuxdo-scripts/releases/latest)
1617

README_EN.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
[Discord](https://discord.gg/3wDmhCsVeU) ·
1313
[Documentation](https://linuxdo-scripts.zishu.me) ·
14+
[Changelog](http://linuxdo-scripts.zishu.me/version-log) ·
1415
[Issue Feedback](https://github.com/anghunk/linuxdo-scripts/issues/new/choose) ·
1516
[Latest Release](https://github.com/anghunk/linuxdo-scripts/releases/latest)
1617

@@ -28,14 +29,14 @@
2829

2930
## 1. Project Introduction
3031

31-
LinuxDo Scripts is a feature-rich browser extension designed to enhance the user experience of the LinuxDo forum. It integrates multiple practical functions, ranging from basic UI optimizations to advanced AI assistance, making your forum browsing and interaction experience smoother and more efficient.
32+
LinuxDo Scripts is a feature-rich browser extension designed to enhance the user experience of the LinuxDo forum. It integrates multiple practical functions, from basic UI optimizations to advanced AI assistance, making your forum browsing and interaction experience smoother and more efficient.
3233

3334
> [!note]
34-
> Forum discussion thread: [linuxdo enhanced plugin, continuous updates welcome for feedback - LINUX DO](https://linux.do/t/topic/170951), QQ exchange group: 1035556246
35+
> Forum discussion thread: [LinuxDo Enhanced Plugin, Continuous Updates Welcome for Feedback - LINUX DO](https://linux.do/t/topic/170951), QQ Exchange Group: 1035556246
3536
>
36-
> It is also compatible with [idcflare.com](https://idcflare.com).
37+
> Synchronously compatible with [idcflare.com](https://idcflare.com) website.
3738
38-
For more features, please visit [LinuxDo Scripts Documentation](https://linuxdo-scripts.zishu.me)
39+
For more features, visit [LinuxDo Scripts Documentation](https://linuxdo-scripts.zishu.me)
3940

4041
![Main Image](https://github.com/user-attachments/assets/1b0039de-3f3e-420b-9a91-6bc651e8c8e5)
4142

@@ -52,17 +53,17 @@ For more features, please visit [LinuxDo Scripts Documentation](https://linuxdo-
5253

5354
### 1. Supported Browsers
5455

55-
| Browser | Installation Link | Note |
56-
| ------------------------------- | --------------------------------------------------------------------------------------------- | --------------- |
57-
| **Chrome / Edge / Arc / Brave** | [Chrome Web Store](https://chromewebstore.google.com/detail/fbgblmjbeebanackldpbmpacppflgmlj) | Recommended |
58-
| **Firefox** | [Firefox Addons](https://addons.mozilla.org/zh-CN/firefox/addon/linux_do-scripts/) | Recommended |
59-
| **Users in China** | [Crx Store](https://www.crxsoso.com/webstore/detail/fbgblmjbeebanackldpbmpacppflgmlj) | No VPN required |
56+
| Browser | Installation Link | Notes |
57+
| ------------------------------- | --------------------------------------------------------------------------------------------- | -------- |
58+
| **Chrome / Edge / Arc / Brave** | [Chrome Web Store](https://chromewebstore.google.com/detail/fbgblmjbeebanackldpbmpacppflgmlj) | Recommended |
59+
| **Firefox** | [Firefox Addons](https://addons.mozilla.org/zh-CN/firefox/addon/linux_do-scripts/) | Recommended |
60+
| **Users in China** | [Crx Store](https://www.crxsoso.com/webstore/detail/fbgblmjbeebanackldpbmpacppflgmlj) | No VPN required |
6061

6162
### 2. Installation Steps
6263

6364
1. Click the installation link for your browser above
6465
2. Click "Add to Browser" in the extension store
65-
3. Confirm the installation permissions
66+
3. Confirm installation permissions
6667
4. Visit [LinuxDo Forum](https://linux.do) to start using
6768

6869
## 4. Development Guide
@@ -87,18 +88,18 @@ npm run dev
8788

8889
### 3. Loading the Extension
8990

90-
1. Open the browser's extension management page
91+
1. Open the browser extension management page
9192
- Chrome: `chrome://extensions/`
9293
- Firefox: `about:addons`
9394
2. Enable "Developer Mode"
94-
3. Click "Load Unpacked"
95+
3. Click "Load Unpacked Extension"
9596
4. Select the `.output/chrome-mv3` folder in the project root directory
9697

9798
### 4. Development Standards
9899

99100
- 🧩 **Component-based Development**: Each feature is an independent component to avoid conflicts
100101
- 🔄 **Submission Process**: PR → Code Review → Merge
101-
- 📚 **Documentation Update**: New features must be accompanied by documentation updates
102+
- 📚 **Documentation Update**: New features must update documentation simultaneously
102103

103104
## 5. Contributing
104105

@@ -109,7 +110,7 @@ npm run dev
109110
- 🔧 [Submit Code](https://github.com/anghunk/linuxdo-scripts/pulls)
110111
- 🙍‍♂️ [Join Discussion](https://discord.gg/3wDmhCsVeU)
111112

112-
### 2. Contributors
113+
### 2. Contributors List
113114

114115
![Contributors](https://contrib.rocks/image?repo=anghunk/linuxdo-scripts)
115116

@@ -135,17 +136,17 @@ This project uses the [Apache License 2.0](https://github.com/anghunk/linuxdo-sc
135136

136137
- ✅ Use, copy, modify, and distribute this software
137138
- ✅ Use for commercial purposes
138-
-Re-license under the terms of the agreement
139+
-Reauthorize under the terms of the license
139140

140141
**But you must:**
141142

142-
- 📋 Retain the original copyright notice
143-
- 📋 Indicate any changes made to the original code
143+
- 📋 Retain original copyright notices
144+
- 📋 Indicate modifications to the original code
144145

145146
### 3. Disclaimer
146147

147-
- This project is **free and open source**, and is not guaranteed to be absolutely perfect or error-free
148-
- Please assess the risks yourself before use and comply with relevant laws and regulations
148+
- This project is **free and open source**, not guaranteed to be absolutely perfect
149+
- Please assess risks yourself before use and comply with relevant laws and regulations
149150
- Any form of abuse is strictly prohibited
150151
- If there are any infringement issues, please contact [@anghunk](https://github.com/anghunk) for timely processing
151152

@@ -157,7 +158,7 @@ This project uses the [Apache License 2.0](https://github.com/anghunk/linuxdo-sc
157158
<p>
158159
If this project is helpful to you, please consider giving us a ⭐ Star!
159160

160-
Or [buy us a coffee](https://github.com/anghunk/anghunk/blob/main/Sponsor.md)
161+
Or [Buy us a coffee](https://github.com/anghunk/anghunk/blob/main/Sponsor.md)
161162
</p>
162163
<p>Made with ❤️ by <a href="https://github.com/anghunk">@anghunk</a> and <a href="https://github.com/anghunk/linuxdo-scripts/graphs/contributors">contributors</a></p>
163164
</div>
File renamed without changes.

docs/docs/.vitepress/configs/nav.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
export default [
22
{ text: '使用指南', link: '/guide/0-home/home.md' },
33
{ text: '开发文档', link: '/develop/home' },
4+
{ text: '更新日志', link: '/version-log' },
5+
{ text: '问题反馈', link: 'https://github.com/anghunk/linuxdo-scripts/issues/new/choose' },
46
{
57
text: '安装使用',
68
items: [

version-log.md renamed to docs/docs/version-log.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
# Changelog / 更新日志
2+
13
## 1.5.24
24

35
- refactor(bookmark): 重构收藏夹侧边栏结构与样式
46
- chore(i18n): 删除所有语言的 README 文档
57
- feat(popupviews): 优化热门话题与最新话题标题格式化
68

9+
https://github.com/anghunk/linuxdo-scripts/releases/tag/1.5.24
10+
711
## 1.5.23
812

913
- fix(ldc): 修正账户信息显示条件判断
@@ -14,7 +18,7 @@
1418

1519
## 1.5.21
1620

17-
- feat(LDC): 新增LDC账户信息及积分统计面板
21+
- feat(LDC): 新增 LDC 账户信息及积分统计面板
1822

1923
## 1.5.20
2024

@@ -40,7 +44,7 @@
4044

4145
## 1.5.15
4246

43-
- feat(export): 支持HTML表格转换为Markdown格式 #289
47+
- feat(export): 支持 HTML 表格转换为 Markdown 格式 #289
4448

4549
## 1.5.14
4650

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"compile": "vue-tsc --noEmit",
1616
"postinstall": "wxt prepare",
1717
"publish": "wxt build && wxt zip && wxt zip -b firefox && py scripts/build.py",
18-
"rf": "rimraf node_modules"
18+
"rf": "rimraf node_modules",
19+
"tran": "py scripts/translate_md.py"
1920
},
2021
"dependencies": {
2122
"@arco-themes/vue-indigo-sky": "^0.0.1",

scripts/build.py

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import json
44
import shutil
55

6-
version_log_file = 'version-log.md'
6+
version_log_file = 'docs/docs/version-log.md'
77
changelog_file = 'CHANGELOG.md'
88
package_file = 'package.json'
99

@@ -20,14 +20,16 @@
2020
print(f"文件 {version_log_file} 不存在,请检查路径。")
2121
else:
2222
with open(version_log_file, 'r', encoding='utf-8') as f:
23-
# 读取第一行
24-
version_log_first_line = f.readline().strip()
23+
lines = f.readlines()
2524

26-
# 处理第一行不符合预期的情况
27-
if version_log_first_line.startswith('##'):
28-
version_log_version = version_log_first_line.split(' ')[-1]
29-
else:
30-
version_log_version = '0.0.0'
25+
# 查找第一个版本标题(## 开头)
26+
version_log_version = '0.0.0'
27+
for line in lines:
28+
stripped_line = line.strip()
29+
if stripped_line.startswith('##'):
30+
# 提取版本号(例如:## 1.5.24 -> 1.5.24)
31+
version_log_version = stripped_line.split(' ')[-1]
32+
break
3133

3234
# 仅在版本号不一致时才更新 version-log.md
3335
if version != version_log_version:
@@ -37,10 +39,28 @@
3739
with open(changelog_file, 'r', encoding='utf-8') as f:
3840
changelog_content = f.read()
3941

40-
with open(version_log_file, 'r+', encoding='utf-8') as f:
41-
existing_content = f.read()
42-
f.seek(0, 0)
43-
f.write(f"## {version}\n\n" + changelog_content + '\n\n' + existing_content)
42+
# 读取现有文件内容
43+
with open(version_log_file, 'r', encoding='utf-8') as f:
44+
lines = f.readlines()
45+
46+
# 构建新内容:在一级标题后插入新版本
47+
new_lines = []
48+
inserted = False
49+
50+
for line in lines:
51+
new_lines.append(line)
52+
# 在一级标题后插入新版本内容
53+
if line.strip().startswith('# ') and not inserted:
54+
new_lines.append(f'\n## {version}\n\n{changelog_content}\n\nhttps://github.com/anghunk/linuxdo-scripts/releases/tag/{version}\n')
55+
inserted = True
56+
57+
# 如果没有找到一级标题,则在文件开头插入
58+
if not inserted:
59+
new_lines.insert(0, f'## {version}\n\n{changelog_content}\n\nhttps://github.com/anghunk/linuxdo-scripts/releases/tag/{version}\n\n')
60+
61+
# 写回文件
62+
with open(version_log_file, 'w', encoding='utf-8') as f:
63+
f.writelines(new_lines)
4464

4565
print(f"已更新 {version_log_file} 文件,版本号为 {version}。")
4666
else:
File renamed without changes.

0 commit comments

Comments
 (0)