Skip to content

修改 path 说明。 - #48

Merged
hacxy merged 2 commits into
hacxy:mainfrom
hgalytoby:update-docs
May 5, 2024
Merged

hacxy merged 2 commits into
hacxy:mainfrom
hgalytoby:update-docs

Conversation

@hgalytoby

Copy link
Copy Markdown
Contributor

修改 path 说明。

昨天看到更新后发现文档没有说明切换衣服怎么使用。

看了 #44 ,是由 path 实现切换衣服的。

@hacxy

hacxy commented May 5, 2024 •

Copy link
Copy Markdown
Owner

选项说明的文档内容不应该被手动修改, 应该在类型的注释中对其描述进行修改:
https://github.com/oh-my-live2d/oh-my-live2d/blob/main/packages/oh-my-live2d/src/types/model.ts#L18

注意类型声明的标签, 使用的是 @valueType, 例如:

  /**
   * 模型的 json 文件 url 地址, 必填项
   * @valueType string | string[]
   */
  path: string | string[];

项目在构建文档时, 会自动根据选项的注释内容生成每个选项的文档描述

### path

- 类型: `string`
- 类型: `string | [string]`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 类型: `string | [string]`
- 类型: `string | string[]`

- 类型: `string | [string]`

模型的 json 文件 url 地址, 必填项
模型的 json 文件 url 地址, 必填项。类型 [string] 可以切换衣服。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
模型的 json 文件 url 地址, 必填项。类型 [string] 可以切换衣服。
模型的 json 文件 url 地址, 必填项。类型 string[] 可以切换衣服。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句话也太口语了

@Mister-Hope

Copy link
Copy Markdown
Contributor

自动生成的话,是不是忘记更新了?至少类型都对不上

@hacxy

hacxy commented May 5, 2024

Copy link
Copy Markdown
Owner

自动生成的话,是不是忘记更新了?至少类型都对不上

目前文档构建脚本对复杂的类型描述不太智能, 需要手动的加上 @valueType 标签明确类型描述😅

@hacxy
hacxy merged commit 5049688 into hacxy:main May 5, 2024
@hgalytoby
hgalytoby deleted the update-docs branch May 5, 2024 09:54
@hgalytoby

Copy link
Copy Markdown
Contributor Author

选项说明的文档内容不应该被手动修改, 应该在类型的注释中对其描述进行修改: https://github.com/oh-my-live2d/oh-my-live2d/blob/main/packages/oh-my-live2d/src/types/model.ts#L18

注意类型声明的标签, 使用的是 @valueType, 例如:

  /**
   * 模型的 json 文件 url 地址, 必填项
   * @valueType string | string[]
   */
  path: string | string[];

项目在构建文档时, 会自动根据选项的注释内容生成每个选项的文档描述

不好意思,現在我了解了!

chnak pushed a commit to chnak/l2d-widget that referenced this pull request Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants