Skip to content

Commit

Permalink
docs: add tutorials and reference on registry
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Feb 6, 2023
1 parent 4159a39 commit a56201f
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 5 deletions.
2 changes: 2 additions & 0 deletions docs/en/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

- [Create a Tool](tutorials/create_a_tool.md)

- [Submit Your Tooth to Lip Registry](tutorials/submit_your_tooth_to_lip_registry.md)

- Commands

- [lip](commands/lip.md)
Expand Down
16 changes: 14 additions & 2 deletions docs/en/commands/lip_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ Note that `lip install` prefers to leave the installed version as-is unless `--u

When looking at the items to be installed, Lip checks what type of item each is, in the following order:

1. Tooth repository, which can be accessed via Goproxy.
1. Remote tooth file with suffix `.tth` and prefix `http://` or `https://`.
2. Local tooth file with suffix `.tth`.
3. Tooth repository, which can be accessed via Goproxy.
4. Tooth alias, which can be looked up in Lip registry.

In the first case, all letters will be converted to lowercase before processing.
In 3 and 4, all letters will be converted to lowercase before processing.

### Lip Registry

Since v0.8.0, Lip supports Lip registry, which enables you to use aliases to install teeth. By default, Lip will use the registry at <https://registry.litebds.com>. You can also use your own registry by setting environment variable `LIP_REGISTRY` to the URL of your registry.

### Satisfying Requirements

Expand Down Expand Up @@ -104,4 +110,10 @@ Install from a local tooth:
```shell
lip install example.tth
lip install ./example/example.tth
```

Install with an alias:

```shell
lip install liteloaderbds
```
49 changes: 49 additions & 0 deletions docs/en/tutorials/submit_your_tooth_to_lip_registry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Tutorial: Submit Your Tooth to Lip Registry

Since v0.8.0, Lip supports looking up teeth from a registry and installing them. You can submit your tooth to the registry to make it easier for others to install your tooth.

In this tutorial, we will submit a tooth to the official Lip registry (<https://registry.litebds.com>).

## Create a Lip Tooth

Follow the [Create a Lip Tooth](tutorials/create_a_lip_tooth.md) tutorial to create a Lip tooth. Make sure that you have a `tooth.json` file in the root directory of your tooth. And the **tooth** field is right the repository path of your tooth.

## Submit Your Tooth to Lip Registry

To submit your tooth to the registry, you need to create a pull request to the registry repository (<https://github.com/LiteLDev/Registry>).

You should create a new file in the `teeth` directory. The file name should be the alias of your tooth. The file content should be a simplified version of your `tooth.json`. The file content should be in JSON format and should contain the following fields. In this example, the alias of the tooth is `exampletool`. Therefore, the file name is `exampletool.json`.

```json
{
"format_version": 1,
"tooth": "example.com/exampleuser/exampletool",
"information": {
"name": "Example Tool",
"description": "An example tool",
"author": "Example User",
"license": "MIT",
"homepage": "example.com"
}
}
```

Unlike the `tooth.json` under your tooth repository, every field in the registry file is required. The `format_version` field should be `1`.

After you create the file, you can create a pull request to the registry repository. The registry maintainers will review your pull request and merge it if it is valid.

## Install Your Tooth from Lip Registry

After your tooth is submitted to the registry, everyone can install it from the registry. You can use the `lip install` command to install your tooth from the registry.

```bash
lip install exampletool
```

## Update Your Tooth in Lip Registry

If you want to update your tooth in the registry, you need to update the registry file. You can update the registry file in the same way as submitting your tooth to the registry. The registry maintainers will review your pull request and merge it if it is valid.

## Remove Your Tooth from Lip Registry

If you want to remove your tooth from the registry, you need to remove the registry file. You can remove the registry file in the same way as submitting your tooth to the registry. The registry maintainers will review your pull request and merge it if it is valid.
2 changes: 2 additions & 0 deletions docs/zh-Hans/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- [创建一个Tooth包](tutorials/create_a_lip_tooth.md)

- [创建一个工具](tutorials/create_a_tool.md)

- [Submit Your Tooth to Lip Registry](tutorials/submit_your_tooth_to_lip_registry.md)

- 命令

Expand Down
18 changes: 15 additions & 3 deletions docs/zh-Hans/commands/lip_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ lip install [options] <tooth url/files>

在查看要安装的项目时,Lip按以下步骤检查每个项目是什么类型的:

1. 可以通过Goproxy访问tooth存储库.
2. 带有tth后缀的本地tooth文件 `.tth`.
1. Remote tooth file with suffix `.tth` and prefix `http://` or `https://`.
2. Local tooth file with suffix `.tth`.
3. Tooth repository, which can be accessed via Goproxy.
4. Tooth alias, which can be looked up in Lip registry.

在第一种情况下,所有字母在处理前将被转换为小写。
In 3 and 4, all letters will be converted to lowercase before processing.

### Lip Registry

Since v0.8.0, Lip supports Lip registry, which enables you to use aliases to install teeth. By default, Lip will use the registry at <https://registry.litebds.com>. You can also use your own registry by setting environment variable `LIP_REGISTRY` to the URL of your registry.

### 安装依赖

Expand Down Expand Up @@ -105,4 +111,10 @@ lip install https://example.com/example.tth
```shell
lip install example.tth
lip install ./example/example.tth
```

Install with an alias:

```shell
lip install liteloaderbds
```
49 changes: 49 additions & 0 deletions docs/zh-Hans/tutorials/submit_your_tooth_to_lip_registry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Tutorial: Submit Your Tooth to Lip Registry

Since v0.8.0, Lip supports looking up teeth from a registry and installing them. You can submit your tooth to the registry to make it easier for others to install your tooth.

In this tutorial, we will submit a tooth to the official Lip registry (<https://registry.litebds.com>).

## Create a Lip Tooth

Follow the [Create a Lip Tooth](tutorials/create_a_lip_tooth.md) tutorial to create a Lip tooth. Make sure that you have a `tooth.json` file in the root directory of your tooth. And the **tooth** field is right the repository path of your tooth.

## Submit Your Tooth to Lip Registry

To submit your tooth to the registry, you need to create a pull request to the registry repository (<https://github.com/LiteLDev/Registry>).

You should create a new file in the `teeth` directory. The file name should be the alias of your tooth. The file content should be a simplified version of your `tooth.json`. The file content should be in JSON format and should contain the following fields. In this example, the alias of the tooth is `exampletool`. Therefore, the file name is `exampletool.json`.

```json
{
"format_version": 1,
"tooth": "example.com/exampleuser/exampletool",
"information": {
"name": "Example Tool",
"description": "An example tool",
"author": "Example User",
"license": "MIT",
"homepage": "example.com"
}
}
```

Unlike the `tooth.json` under your tooth repository, every field in the registry file is required. The `format_version` field should be `1`.

After you create the file, you can create a pull request to the registry repository. The registry maintainers will review your pull request and merge it if it is valid.

## Install Your Tooth from Lip Registry

After your tooth is submitted to the registry, everyone can install it from the registry. You can use the `lip install` command to install your tooth from the registry.

```bash
lip install exampletool
```

## Update Your Tooth in Lip Registry

If you want to update your tooth in the registry, you need to update the registry file. You can update the registry file in the same way as submitting your tooth to the registry. The registry maintainers will review your pull request and merge it if it is valid.

## Remove Your Tooth from Lip Registry

If you want to remove your tooth from the registry, you need to remove the registry file. You can remove the registry file in the same way as submitting your tooth to the registry. The registry maintainers will review your pull request and merge it if it is valid.

0 comments on commit a56201f

Please sign in to comment.