From 72c57380883a1c1cc796dea6d35048ab5bed5f53 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 12 Mar 2026 19:04:12 +0800 Subject: Add helpdoc system with interactive viewer --- resources/helpdoc/Welcome_To_JVCS.en.md | 1 + resources/helpdoc/Welcome_To_JVCS.zh-CN.md | 1 + resources/helpdoc/commands/hexdump.en.md | 6 ++++++ resources/helpdoc/commands/hexdump.zh-CN.md | 6 ++++++ resources/helpdoc/commands/sheetdump.en.md | 13 +++++++++++++ resources/helpdoc/commands/sheetdump.zh-CN.md | 12 ++++++++++++ resources/helpdoc/commands/sheetedit.en.md | 12 ++++++++++++ resources/helpdoc/commands/sheetedit.zh-CN.md | 12 ++++++++++++ resources/locales/jvn/en.yml | 27 ++++++++++++-------------- resources/locales/jvn/helpdoc_viewer/en.yml | 5 +++++ resources/locales/jvn/helpdoc_viewer/zh-CN.yml | 5 +++++ resources/locales/jvn/zh-CN.yml | 27 ++++++++++++-------------- 12 files changed, 97 insertions(+), 30 deletions(-) create mode 100644 resources/helpdoc/Welcome_To_JVCS.en.md create mode 100644 resources/helpdoc/Welcome_To_JVCS.zh-CN.md create mode 100644 resources/helpdoc/commands/hexdump.en.md create mode 100644 resources/helpdoc/commands/hexdump.zh-CN.md create mode 100644 resources/helpdoc/commands/sheetdump.en.md create mode 100644 resources/helpdoc/commands/sheetdump.zh-CN.md create mode 100644 resources/helpdoc/commands/sheetedit.en.md create mode 100644 resources/helpdoc/commands/sheetedit.zh-CN.md create mode 100644 resources/locales/jvn/helpdoc_viewer/en.yml create mode 100644 resources/locales/jvn/helpdoc_viewer/zh-CN.yml (limited to 'resources') diff --git a/resources/helpdoc/Welcome_To_JVCS.en.md b/resources/helpdoc/Welcome_To_JVCS.en.md new file mode 100644 index 0000000..f82f58e --- /dev/null +++ b/resources/helpdoc/Welcome_To_JVCS.en.md @@ -0,0 +1 @@ +# Welcome diff --git a/resources/helpdoc/Welcome_To_JVCS.zh-CN.md b/resources/helpdoc/Welcome_To_JVCS.zh-CN.md new file mode 100644 index 0000000..2dfd3ee --- /dev/null +++ b/resources/helpdoc/Welcome_To_JVCS.zh-CN.md @@ -0,0 +1 @@ +# 你好 diff --git a/resources/helpdoc/commands/hexdump.en.md b/resources/helpdoc/commands/hexdump.en.md new file mode 100644 index 0000000..60d5275 --- /dev/null +++ b/resources/helpdoc/commands/hexdump.en.md @@ -0,0 +1,6 @@ +# Hexdump + +> Print binary information + +## Usage +jvn hexdump diff --git a/resources/helpdoc/commands/hexdump.zh-CN.md b/resources/helpdoc/commands/hexdump.zh-CN.md new file mode 100644 index 0000000..9b5b8ad --- /dev/null +++ b/resources/helpdoc/commands/hexdump.zh-CN.md @@ -0,0 +1,6 @@ +# Hexdump + +> 打印二进制信息 + +## 使用 +jvn hexdump diff --git a/resources/helpdoc/commands/sheetdump.en.md b/resources/helpdoc/commands/sheetdump.en.md new file mode 100644 index 0000000..1616f12 --- /dev/null +++ b/resources/helpdoc/commands/sheetdump.en.md @@ -0,0 +1,13 @@ +# Sheetdump + +> Visually output the internal structure of a `Sheet` + +## Usage +jvn sheetdump # Default output +jvn sheetdump --no-sort # No sorting +jvn sheetdump --no-pretty # No prettifying + +## Tip +You can also use `renderer override` to access the internal structure of a `Sheet`, +for example: +jvn sheetdump --renderer json | jq ".mappings" diff --git a/resources/helpdoc/commands/sheetdump.zh-CN.md b/resources/helpdoc/commands/sheetdump.zh-CN.md new file mode 100644 index 0000000..0ae46ef --- /dev/null +++ b/resources/helpdoc/commands/sheetdump.zh-CN.md @@ -0,0 +1,12 @@ +# Sheetdump + +> 可视化地输出 `Sheet` 的内部结构 + +## 使用 +jvn sheetdump # 默认输出 +jvn sheetdump --no-sort # 无排序 +jvn sheetdump --no-pretty # 无美化 + +## 提示 +您也可以使用 `渲染器重载` 来访问 `Sheet` 的内部结构,例如 +jvn sheetdump --renderer json | jq ".mappings" diff --git a/resources/helpdoc/commands/sheetedit.en.md b/resources/helpdoc/commands/sheetedit.en.md new file mode 100644 index 0000000..80f2a7b --- /dev/null +++ b/resources/helpdoc/commands/sheetedit.en.md @@ -0,0 +1,12 @@ +# Sheetedit + +> Edit `Sheet` files using your system editor + +## Usage +jvn sheetedit + +## Note +It reads and uses a command-line editor program in the following priority order: +1. JV\_TEXT\_EDITOR +2. EDITOR +3. If neither exists, it falls back to using `jvii` diff --git a/resources/helpdoc/commands/sheetedit.zh-CN.md b/resources/helpdoc/commands/sheetedit.zh-CN.md new file mode 100644 index 0000000..f30825a --- /dev/null +++ b/resources/helpdoc/commands/sheetedit.zh-CN.md @@ -0,0 +1,12 @@ +# Sheetedit + +> 使用系统编辑器修改 `Sheet` 文件 + +## 使用 +jvn sheetedit + +## 注意 +它读取按照以下优先级寻找命令行编辑器程序: +1. JV\_TEXT\_EDITOR +2. EDITOR +3. 若都不存在,使用 `jvii` 回退 diff --git a/resources/locales/jvn/en.yml b/resources/locales/jvn/en.yml index 6e632f2..7df57fd 100644 --- a/resources/locales/jvn/en.yml +++ b/resources/locales/jvn/en.yml @@ -1,28 +1,25 @@ -help: | - NO - process_error: no_matching_command: | No matching command found! - Use `jv -h` to get help + Use `jvn -h` to get help no_matching_command_but_similar: | No matching command found, but similar commands were found: - jv %{similars} + jvn %{similars} - Use `jv -h` to get help + Use `jvn -h` to get help no_node_found: | Unable to find command `%{node}` This is usually a compilation-phase issue, not a user input error. - Please use `jv -v -C` to get detailed version traceback and contact the developers. + Please use `jvn -v -C` to get detailed version traceback and contact the developers. github: https://github.com/JustEnoughVCS/CommandLine/ parse_error: | An error occurred while parsing your command arguments! - Please use `jv --help` to view help + Please use `jvn --help` to view help renderer_override_but_request_help: | Renderer override mode is enabled, but help output was requested. @@ -38,7 +35,7 @@ process_error: Type conversion failed! This is usually a compilation-phase issue, not a user input error. - Please use `jv -v -C` to get detailed version traceback and contact the developers. + Please use `jvn -v -C` to get detailed version traceback and contact the developers. github: https://github.com/JustEnoughVCS/CommandLine/ @@ -57,19 +54,19 @@ prepare_error: local_config_not_found: | Failed to read workspace config. File may not exist or format mismatch. - Use `jv update` and try again. + Use `jvn update` and try again. latest_info_not_found: | Unable to read latest upstream info! - Use `jv update` and try again. + Use `jvn update` and try again. latest_file_data_not_exist: | Unable to read latest file info for member `%{member_id}`! - Use `jv update` and try again. + Use `jvn update` and try again. cached_sheet_not_found: | Unable to read cached upstream sheet `%{sheet_name}`! - Use `jv update` and try again. + Use `jvn update` and try again. local_sheet_not_found: | Unable to read local sheet `%{sheet_name}` for member `%{member_id}`. @@ -80,7 +77,7 @@ prepare_error: Also, verify that a structure sheet is in use. no_sheet_in_use: | - No sheet in use. Use `jv use `. + No sheet in use. Use `jvn use `. execute_error: io: | @@ -110,7 +107,7 @@ render_error: type_mismatch: | Render type mismatch! This is usually a compilation-phase issue, not a user input error. - Please use `jv -v -C` to get detailed version traceback and contact the developers. + Please use `jvn -v -C` to get detailed version traceback and contact the developers. github: https://github.com/JustEnoughVCS/CommandLine/ diff --git a/resources/locales/jvn/helpdoc_viewer/en.yml b/resources/locales/jvn/helpdoc_viewer/en.yml new file mode 100644 index 0000000..1f5d9d4 --- /dev/null +++ b/resources/locales/jvn/helpdoc_viewer/en.yml @@ -0,0 +1,5 @@ +helpdoc_viewer: + tree_area_hint: | + _List_ | ↑↓: Page | ←→/Space: Switch view | Q: Quit + content_area_hint: | + _Read_ | ↑↓: Page | ←→/Space: Switch view | Q: Quit diff --git a/resources/locales/jvn/helpdoc_viewer/zh-CN.yml b/resources/locales/jvn/helpdoc_viewer/zh-CN.yml new file mode 100644 index 0000000..65825d5 --- /dev/null +++ b/resources/locales/jvn/helpdoc_viewer/zh-CN.yml @@ -0,0 +1,5 @@ +helpdoc_viewer: + tree_area_hint: | + _列表_ | ↑↓: 翻页 | ←→/Space: 切换视图 | Q: 退出 + content_area_hint: | + _阅读_ | ↑↓: 浏览 | ←→/Space: 切换视图 | Q: 退出 diff --git a/resources/locales/jvn/zh-CN.yml b/resources/locales/jvn/zh-CN.yml index f62b53b..ff1b67a 100644 --- a/resources/locales/jvn/zh-CN.yml +++ b/resources/locales/jvn/zh-CN.yml @@ -1,27 +1,24 @@ -help: | - NO - process_error: no_matching_command: | - 无法匹配该命令,使用 `jv -h` 查看帮助 + 无法匹配该命令,使用 `jvn -h` 查看帮助 no_matching_command_but_similar: | 无法找到匹配的命令,但找到相似命令: - jv %{similars} + jvn %{similars} - 使用 `jv -h` 查看帮助 + 使用 `jvn -h` 查看帮助 no_node_found: | 无法找到命令 `%{node}` 这通常是编译期造成的问题,而非用户的错误输入 - 请使用 `jv -v -C` 获得详细的版本追溯,并联系开发人员 + 请使用 `jvn -v -C` 获得详细的版本追溯,并联系开发人员 github: https://github.com/JustEnoughVCS/CommandLine/ parse_error: | 在将您的命令参数进行解析时出现错误! - 请使用 `jv <命令> --help` 查看帮助 + 请使用 `jvn <命令> --help` 查看帮助 renderer_override_but_request_help: | 启用渲染器覆盖模式,但请求输出帮助信息 @@ -37,7 +34,7 @@ process_error: 类型转换失败! 这通常是编译期造成的问题,而非用户的错误输入 - 请使用 `jv -v -C` 获得详细的版本追溯,并联系开发人员 + 请使用 `jvn -v -C` 获得详细的版本追溯,并联系开发人员 github: https://github.com/JustEnoughVCS/CommandLine/ @@ -56,19 +53,19 @@ prepare_error: local_config_not_found: | 读取本地工作区配置文件失败,它可能不存在或格式不匹配 - 请使用 `jv update` 更新工作区信息后再尝试 + 请使用 `jvn update` 更新工作区信息后再尝试 latest_info_not_found: | 无法找到或读取最新上游信息! - 请使用 `jv update` 更新工作区信息后再尝试 + 请使用 `jvn update` 更新工作区信息后再尝试 latest_file_data_not_exist: | 无法找到或读取成员 `%{member_id}` 的最新文件信息! - 请使用 `jv update` 更新工作区信息后再尝试 + 请使用 `jvn update` 更新工作区信息后再尝试 cached_sheet_not_found: | 无法找到或读取上游结构表 `%{sheet_name}` 的缓存信息! - 请使用 `jv update` 更新工作区信息后再尝试 + 请使用 `jvn update` 更新工作区信息后再尝试 local_sheet_not_found: | 无法找到或读取成员 `%{member_id}` 的本地结构表 `%{sheet_name}` @@ -78,7 +75,7 @@ prepare_error: 请检查当前工作区是否正确设置上游,并正在使用结构表 no_sheet_in_use: | - 当前没有在使用表,请使用 `jv use <结构表名称>` 使用一张结构表 + 当前没有在使用表,请使用 `jvn use <结构表名称>` 使用一张结构表 execute_error: io: | @@ -108,7 +105,7 @@ render_error: type_mismatch: | 渲染类型不匹配! 这通常是编译期造成的问题,而非用户的错误输入 - 请使用 `jv -v -C` 获得详细的版本追溯,并联系开发人员 + 请使用 `jvn -v -C` 获得详细的版本追溯,并联系开发人员 github: https://github.com/JustEnoughVCS/CommandLine/ -- cgit