-
Notifications
You must be signed in to change notification settings - Fork 46
feat: add script reference and code highlight #71
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
feat: add script reference and code highlight #71
Conversation
There was a problem hiding this 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
shikiplugin. 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.scssto improve readability, especially in dark mode, where the previous color was difficult to see. - Dependency Updates: The
package.jsonandpnpm-lock.yamlfiles have been updated to include the newshikiandvuepress-plugin-md-enhancedependencies, 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
-
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. ↩
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]*?)($|\\;.*?$)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, andifare present here but not documented in the new script reference. - The command
commentis 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.
| 使用 Live2D 需要开发者做一些准备工作,详情请见 [关于Live2D](../../live2D.md)。 | ||
| ::: | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 使用 Live2D 需要开发者做一些准备工作,详情请见 [关于Live2D](../../live2D.md)。 | |
| ::: | |
| :::info | |
| 使用 Live2D 需要开发者做一些准备工作,详情请见 [关于Live2D](../../live2D.md)。 | |
| ::: |
|
|
||
| 无论原样式被替换为什么新样式,替换样式依旧是原样式名在前; | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - 默认值:0 | ||
| - 单位:弧度 | ||
|
|
||
| 旋转。改变对象的旋转弧度,以顺时针为正方形。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
存在一些错误拼写和格式问题,请参考 AI Review 稍作修改 |
介绍
新增 脚本参考 模块,旨在完整介绍 所有命令 的 所有参数,包括 transform 属性。可能有部分内容与已有的文档重复,我觉得应该是可以容忍的,以后有机会再整理吧。
代码可以自定义高亮了。
close #47 close #51 close #53 close #67
主要更改
shiki以实现自动高亮gradle代码标识。不知道为什么,不支持的标识会直接报错dracula主题里找相似颜色,我尝试用自定义主题但失败了vuepress-plugin-md-enhance以重复利用部分文档其他
暂时没有做日文翻译和英文翻译,有什么又快又好的方法吗?