Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(github): update docs #396

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/.vuepress/public/img/drivers/github/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/img/drivers/github/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/img/drivers/github/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 99 additions & 0 deletions docs/guide/drivers/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
# This is the icon of the page
icon: iconfont icon-state
# This control sidebar order
order: 40
# A page can have multiple categories
category:
- Guide
# A page can have multiple tags
tag:
- Storage
- Guide
- "302"
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: true
---
# GitHub API

:::tip
GitHub API does not support operating files larger than 100MiB and folders containing more than 100,000 sub-items.

All `.gitkeep` files will be managed by the driver and will be invisible to the user.

Operations on submodules are currently not supported.
:::

## **Token**

1. Log in GitHub and visit <https://github.com/settings/tokens>.
2. ![](/img/drivers/github/1.png)
3. ![](/img/drivers/github/2.png)
4. ![](/img/drivers/github/3.png)

## **Owner**

The owner of the repository. For example, if the URL of the repository is `github.com/AAA/BBB`, fill in `AAA` here.

## **Repo**

The name of the repository. For example, if the URL of the repository is `github.com/AAA/BBB`, fill in `BBB` here.

## **Ref**

A branch, a tag or a commit SHA. Only when a branch name is filled in is the driver writable. It defaults to the default branch if not filled.

## **Committer name**

Custom committer name, defaulting to the owner's of the token when not filled.

## **Committer email**

Custom committer name, defaulting to the owner's of the token when not filled.

Required when "Committer name" is filled. Required to be empty when "Committer name" is empty.

## **Author name**

Custom author name, defaulting to the owner's of the token when not filled.

## **Author email**

Custom author name, defaulting to the owner's of the token when not filled.

Required when "Author name" is filled. Required to be empty when "Author name" is empty.

## **\*\*\* commit message**

Custom commit message, supporting the following template variables:
- `UserName`: the user operating the file.
- `ObjName`: the name of the file (or the folder) operated.
- `ObjPath`: the path to the file (or the folder) operated.
- `ParentName`: the name of the parent folder of the file (or the folder) operated.
- `ParentPath`: the path to the parent folder of the file (or the folder) operated.
- `TargetName`: (when renaming) new name. (when copying and moving) the target folder name.
- `TargetPath`: (when renaming) new path. (when copying and moving) the target path.

### **The default download method used**

```mermaid
---
title: Which download method is used by default?
---
flowchart TB
style a1 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff
style a2 fill:#ff7575,stroke:#333,stroke-width:4px
subgraph ide1 [ ]
a1
end
a1[302]:::someclass====|default|a2[user equipment]
classDef someclass fill:#f96
c1[local proxy]-.alternative.->a2[user equipment]
b1[Download proxy URL]-.alternative.->a2[user equipment]
click a1 "../drivers/common.html#webdav-policy"
click b1 "../drivers/common.html#webdav-policy"
click c1 "../drivers/common.html#webdav-policy"
```

99 changes: 99 additions & 0 deletions docs/zh/guide/drivers/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
# This is the icon of the page
icon: iconfont icon-state
# This control sidebar order
order: 40
# A page can have multiple categories
category:
- Guide
# A page can have multiple tags
tag:
- Storage
- Guide
- "302"
# this page is sticky in article list
sticky: true
# this page will appear in starred articles
star: true
---
# GitHub API

:::tip
GitHub API 不支持操作 100M 或更大的文件,不支持操作含有超过 100,000 个子文件(夹)的文件夹。

本驱动会忽略仓库内的所有`.gitkeep`文件。

本驱动暂不支持操作子模块。
:::

## **Token**

1. 登录 GitHub,访问<https://github.com/settings/tokens>
2. ![](/img/drivers/github/1.png)
3. ![](/img/drivers/github/2.png)
4. ![](/img/drivers/github/3.png)

## **所有者**

仓库的所有者,比如仓库链接是`github.com/AAA/BBB`,这里就填`AAA`。

## **仓库**

仓库名,比如仓库链接是`github.com/AAA/BBB`,这里就填`BBB`。

## **引用**

分支名、tag或提交SHA,只有在填写分支名的情况下驱动才可写,不填会使用默认分支。

## **提交者名称**

自定义提交者名称,不填会使用 Token 的所有者。

## **提交者邮箱**

自定义提交者邮箱,不填会使用 Token 的所有者。

填写“提交者名称”时必填,未填写“提交者名称”时必不填。

## **作者名称**

自定义作者名称,不填会使用 Token 的所有者。

## **作者邮箱**

自定义作者邮箱,不填会使用 Token 的所有者。

填写“作者名称”时必填,未填写“作者名称”时必不填。

## **\*\*\*提交信息**

自定义提交信息,支持以下模板变量:
- `UserName`: 发起操作的用户
- `ObjName`: 被操作文件(夹)的名称
- `ObjPath`: 被操作文件(夹)的路径
- `ParentName`: 被操作文件(夹)的父文件夹名称
- `ParentPath`: 被操作文件(夹)的父文件夹路径
- `TargetName`: (重命名时)新名称(复制、移动时)目标文件夹名称。
- `TargetPath`: (重命名时)新路径(复制、移动时)目标路径

### **默认使用的下载方式**

```mermaid
---
title: 默认使用的哪种下载方式?
---
flowchart TB
style a1 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff
style a2 fill:#ff7575,stroke:#333,stroke-width:4px
subgraph ide1 [ ]
a1
end
a1[302]:::someclass====|默认|a2[用户设备]
classDef someclass fill:#f96
c1[本机代理]-.备选.->a2[用户设备]
b1[代理URL]-.备选.->a2[用户设备]
click a1 "../drivers/common.html#webdav-策略"
click b1 "../drivers/common.html#webdav-策略"
click c1 "../drivers/common.html#webdav-策略"
```