Skip to content

Conversation

@HardyNLee
Copy link

介绍

新增 脚本参考 模块,旨在完整介绍 所有命令所有参数,包括 transform 属性。可能有部分内容与已有的文档重复,我觉得应该是可以容忍的,以后有机会再整理吧。
代码可以自定义高亮了。
close #47 close #51 close #53 close #67

主要更改

  • 新增 脚本参考 模块
    • 所有命令与参数
    • 所有变换属性
  • 导入 shiki 以实现自动高亮
    • 移除了 gradle 代码标识。不知道为什么,不支持的标识会直接报错
    • 现在的高亮颜色实际上是强行从 dracula 主题里找相似颜色,我尝试用自定义主题但失败了
    • 设置主题后,代码块不会根据浅色深色变化了,我觉得是可以容忍的
  • 导入 vuepress-plugin-md-enhance 以重复利用部分文档
  • 调整了主题颜色,因为其在深色模式下看不清字

其他

暂时没有做日文翻译和英文翻译,有什么又快又好的方法吗?

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @HardyNLee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the documentation aspect of the project by introducing a dedicated script reference and improving code readability through custom syntax highlighting. It also includes minor theme adjustments and dependency updates to support these new features.

Highlights

  • New Script Reference Module: I've introduced a comprehensive 'Script Reference' module, accessible via the Chinese sidebar. This module provides detailed documentation for all WebGAL commands and their parameters, including an in-depth guide to transform properties. This aims to centralize and complete the command documentation.
  • Custom Code Highlighting: I've implemented custom code highlighting for WebGAL scripts using the shiki plugin. This includes a new TextMate grammar file (webgal.tmLanguage.json) to define the syntax rules for WebGAL, allowing for automatic and visually distinct highlighting of script commands and arguments. I've also configured it to use the 'dracula' theme and support other common languages like TypeScript, Bash, JSON, XML, and Kotlin.
  • Documentation Enhancements & Reuse: To facilitate documentation management and reuse, I've integrated vuepress-plugin-md-enhance. This allows for embedding and reusing markdown content, which is particularly useful for parameter definitions across multiple command documents in the new script reference.
  • Theme Color Adjustment: I've adjusted the main theme color in palette.scss to improve readability, especially in dark mode, where the previous color was difficult to see.
  • Dependency Updates: The package.json and pnpm-lock.yaml files have been updated to include the new shiki and vuepress-plugin-md-enhance dependencies, along with their transitive dependencies, to support the new features.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive script reference section with documentation for all commands and adds syntax highlighting for webgal script files using shiki. The changes are extensive and well-structured. My review focuses on improving documentation correctness and addressing some maintainability concerns, such as the use of deprecated dependencies and duplicated, inconsistent data in the new syntax highlighting definition.


vuepress-plugin-md-enhance@2.0.0-beta.66:
resolution: {integrity: sha512-SjP+sVq8MgxDiFlyo+ukFHhEcHQ5ePOg9l1eKtYVUUF17ZR8VcXOHI/UjAGIjdzy8UkQUkrMZRkvzwzWXQO9cQ==}
deprecated: Please use latest version

Choose a reason for hiding this comment

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

high

This dependency, vuepress-plugin-md-enhance, is marked as deprecated. Using deprecated packages is a risk for future maintenance and security, as they won't receive updates. Please consider using the latest non-deprecated version.

This might also resolve the deprecation warnings for its transitive dependencies like vuepress-plugin-sass-palette and @mr-hope/vuepress-shared.

},
"character-colon": {
"comment": "[char]:[utt[ -args]][;cmt]",
"match": "^(?!(?:say|changeBg|changeFigure|bgm|playVideo|pixiPerform|pixiInit|intro|miniAvatar|changeScene|choose|end|setComplexAnimation|setFilter|label|jumpLabel|chooseLabel|setVar|if|callScene|showVars|unlockCg|unlockBgm|filmMode|setTextbox|setAnimation|playEffect|setTempAnimation|comment|setTransform|setTransition|getUserInput|applyStyle|wait)\\:)(.*?)(\\:)([^\\;\\n]*?)($|\\;.*?$)",

Choose a reason for hiding this comment

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

high

The list of WebGAL commands is hardcoded in four different regular expressions in this file. This creates a maintenance burden, as any change to the command set needs to be reflected in all four places.

Furthermore, the command list here is inconsistent with the new documentation in the sidebar:

  • Commands like setFilter, chooseLabel, and if are present here but not documented in the new script reference.
  • The command comment is listed here, but its documentation page states it's not a command keyword.

To improve maintainability and correctness, I suggest ensuring the command list is consistent with the documentation. If the tmLanguage format doesn't support defining the list once, consider adding a comment to the file to remind future developers to update all instances.

Comment on lines +40 to +42
使用 Live2D 需要开发者做一些准备工作,详情请见 [关于Live2D](../../live2D.md)
:::

Choose a reason for hiding this comment

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

medium

It seems there's a typo in the custom container syntax. It should be ::: info with three colons, not four. This typo will likely prevent the container from rendering correctly.

I've noticed this pattern (::::) in several other new markdown files as well (e.g., changeScene.md, setAnimation.md, transform.md). Please correct them all.

Suggested change
使用 Live2D 需要开发者做一些准备工作,详情请见 [关于Live2D](../../live2D.md)
:::
:::info
使用 Live2D 需要开发者做一些准备工作,详情请见 [关于Live2D](../../live2D.md)
:::


无论原样式被替换为什么新样式,替换样式依旧是原样式名在前;

```

Choose a reason for hiding this comment

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

medium

This code block is missing the webgal language identifier. Since one of the main features of this PR is to add code highlighting, it would be great to ensure all code blocks have the correct language specified for proper syntax highlighting.

Suggested change
```
```webgal

- 默认值:0
- 单位:弧度

旋转。改变对象的旋转弧度,以顺时针为正方形。

Choose a reason for hiding this comment

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

medium

There's a small typo here. "正方形" (square) should be "正方向" (positive direction). This will improve the clarity and correctness of the documentation.

Suggested change
旋转。改变对象的旋转弧度,以顺时针为正方形
旋转。改变对象的旋转弧度,以顺时针为正方向

@MakinoharaShoko
Copy link
Member

存在一些错误拼写和格式问题,请参考 AI Review 稍作修改

@MakinoharaShoko MakinoharaShoko merged commit be96484 into OpenWebGAL:main Aug 7, 2025
1 check passed
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.

补充 wait 指令的用法 补充关于 applyStyle 的文档 补充关于 continue 参数的文档 补充 setTempAnimation 文档

2 participants