misc: restructure docs
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
这是一个读取 Gitea PR,并将其内容整理为 LLM 友好的文档的项目。
|
||||
|
||||
主要输出两种格式:
|
||||
|
||||
1. `markdown`:直接面向 LLM 的可读文档,重点保留 review/comment/reply 内容。
|
||||
2. `json`:结构化输出,便于二次处理。
|
||||
|
||||
使用:
|
||||
|
||||
```bash
|
||||
GITEA_PR_CLI_API_TOKEN=...
|
||||
GITEA_PR_CLI_URL=https://gitea.com
|
||||
GITEA_PR_CLI_REPO=Origami404/aaa
|
||||
|
||||
# 默认输出 markdown 到 stdout
|
||||
gitea-pr-review fetch <pr-index>
|
||||
|
||||
# 输出 json 到 stdout
|
||||
gitea-pr-review fetch <pr-index> --format json
|
||||
|
||||
# 输出到文件
|
||||
gitea-pr-review fetch <pr-index> --format json --out pr.json
|
||||
gitea-pr-review fetch <pr-index> --out pr.md
|
||||
|
||||
# 从已有 json 重新生成 markdown
|
||||
gitea-pr-review render-md --in pr.json
|
||||
gitea-pr-review render-md --in pr.json --out pr.md
|
||||
```
|
||||
|
||||
返回的 markdown 结构大致如下:
|
||||
|
||||
`````md
|
||||
# <repo> `#<pr-index>` <pr-title>
|
||||
|
||||
## Metadata
|
||||
|
||||
### Commits
|
||||
- <sha-short> <title> (<author>, <date>)
|
||||
|
||||
### Diff Stat
|
||||
- files changed: <n>
|
||||
- additions: <n>
|
||||
- deletions: <n>
|
||||
- <file-path>: +<additions>, -<deletions>
|
||||
|
||||
## Review 1 (<review-state>)
|
||||
> <reviewer>
|
||||
|
||||
### Comment 1.1
|
||||
<file>:<line>
|
||||
<user>:
|
||||
```md
|
||||
<原始评论正文>
|
||||
```
|
||||
|
||||
### Reply 1.1.1
|
||||
<user>:
|
||||
```md
|
||||
<原始回复正文>
|
||||
```
|
||||
`````
|
||||
Reference in New Issue
Block a user