Skip to content

Commit 8844155

Browse files
docs: 更新开发文档 (#12)
1 parent 869272a commit 8844155

File tree

5 files changed

+535
-6
lines changed

5 files changed

+535
-6
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## 如何贡献
66

7+
> [!TIP]
8+
> 在贡献本项目前,请先阅读程序的[开发文档](https://github.com/DuckDuckStudio/GitHubView/tree/master/ghv/docs),如对文档有疑问,请提出新的优化分类 Issue。
9+
710
1. **Fork 仓库**:点击右上角的 "Fork" 按钮,将仓库复制到您的 GitHub 账户中。
811
2. **克隆仓库**:将 Fork 的仓库克隆到本地计算机。
912
```bash
@@ -23,7 +26,7 @@
2326
```bash
2427
git push origin feature/your-feature-name
2528
```
26-
7. **创建 Pull Request**:在 GitHub 上创建一个 Pull Request,描述您的更改并请求合并。
29+
7. **创建 Pull Request**:在 GitHub 上创建一个 **指向 `develop` 分支的** Pull Request,描述您的更改并请求合并。
2730

2831
### 本地调试
2932
1. 安装依赖:
@@ -41,11 +44,6 @@
4144
dotnet run --project ghv <命令或参数>
4245
```
4346

44-
## 代码规范
45-
46-
- 请确保您的代码符合项目的代码风格。
47-
- 提交前请运行所有测试并确保它们通过。
48-
4947
## 报告问题
5048

5149
如果您发现了一个问题,请通过 GitHub Issues 报告。请提供尽可能详细的信息,以帮助我们重现和解决问题。

ghv/docs/Command/About.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# ghv about 命令
2+
3+
## 在这里我们需要做什么
4+
接收到执行指令后,显示一个带有程序信息的表格。
5+
6+
## 如何实现表格显示
7+
我使用第三方库 [Spectre.Console](https://spectreconsole.net/) 来实现表格显示,官方文档: https://spectreconsole.net/widgets/table
8+
9+
## 如何区分开发版本与发行版本
10+
```csharp
11+
using Spectre.Console;
12+
13+
/* 条件表达式
14+
string versionLink = Program.Version == "develop"
15+
? $"[link=https://github.com/DuckDuckStudio/GitHubView/tree/{Program.Version}][yellow]{Program.Version}[/][/]"
16+
: $"[link=https://github.com/DuckDuckStudio/GitHubView/releases/tag/{Program.Version}]{Program.Version}[/]";
17+
table.AddRow("版本", versionLink);
18+
*/
19+
20+
Table table = new();
21+
table.AddColumn("条目");
22+
table.AddColumn("内容");
23+
24+
string versionLink;
25+
if (Program.Version == "develop") // 从主程序 (Program.cs) 中获取版本号
26+
{
27+
versionLink = $"[link=https://github.com/DuckDuckStudio/GitHubView/tree/{Program.Version}][yellow]{Program.Version}[/][/]";
28+
}
29+
else
30+
{
31+
versionLink = $"[link=https://github.com/DuckDuckStudio/GitHubView/releases/tag/{Program.Version}]{Program.Version}[/]";
32+
}
33+
34+
table.AddRow("版本", versionLink);
35+
```

0 commit comments

Comments
 (0)