diff --git a/crates/moon/src/cli.rs b/crates/moon/src/cli.rs index 64723fd0..182a3efa 100644 --- a/crates/moon/src/cli.rs +++ b/crates/moon/src/cli.rs @@ -246,8 +246,14 @@ pub fn get_compiler_flags(src_dir: &Path, build_flags: &BuildFlags) -> anyhow::R } #[test] -fn gen_docs_for_moon_new() { +fn gen_docs_for_moon_help_page() { let markdown: String = clap_markdown::help_markdown::(); + let markdown = markdown.replace("Default value: `zsh`", "Default value: ``"); + let markdown = markdown.replace("Default value: `bash`", "Default value: ``"); + let markdown = markdown.replace( + "Default value: `powershell`", + "Default value: ``", + ); let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); let file_path = std::path::PathBuf::from(&manifest_dir).join("../../docs/manual-zh/src/commands.md"); diff --git a/crates/moonutil/src/module.rs b/crates/moonutil/src/module.rs index 2fff1b67..b644e3c1 100644 --- a/crates/moonutil/src/module.rs +++ b/crates/moonutil/src/module.rs @@ -475,5 +475,11 @@ fn validate_mod_json_schema() { env!("CARGO_MANIFEST_DIR"), "/../../docs/manual/src/source/mod_json_schema.html" ); - std::fs::write(html_path, content).unwrap(); + std::fs::write(html_path, &content).unwrap(); + + let html_path_zh = concat!( + env!("CARGO_MANIFEST_DIR"), + "/../../docs/manual-zh/src/source/mod_json_schema.html" + ); + std::fs::write(html_path_zh, content).unwrap(); } diff --git a/crates/moonutil/src/package.rs b/crates/moonutil/src/package.rs index 4edf3dea..cc7cb1bc 100644 --- a/crates/moonutil/src/package.rs +++ b/crates/moonutil/src/package.rs @@ -507,5 +507,11 @@ fn validate_pkg_json_schema() { env!("CARGO_MANIFEST_DIR"), "/../../docs/manual/src/source/pkg_json_schema.html" ); - std::fs::write(html_path, content).unwrap(); + std::fs::write(html_path, &content).unwrap(); + + let zh_html_path = concat!( + env!("CARGO_MANIFEST_DIR"), + "/../../docs/manual-zh/src/source/pkg_json_schema.html" + ); + std::fs::write(zh_html_path, content).unwrap(); } diff --git a/docs/manual-zh/src/SUMMARY.md b/docs/manual-zh/src/SUMMARY.md index e9d22779..4edec9fe 100644 --- a/docs/manual-zh/src/SUMMARY.md +++ b/docs/manual-zh/src/SUMMARY.md @@ -28,3 +28,4 @@ - [alert 列表](./package/alerts.md) - [条件编译](./package/conditional-compilation.md) - [预构建命令](./package/pre-build.md) +- [JSON Schema](./json_schema.md) diff --git a/docs/manual-zh/src/commands.md b/docs/manual-zh/src/commands.md index af8c3fb5..7aa20eaf 100644 --- a/docs/manual-zh/src/commands.md +++ b/docs/manual-zh/src/commands.md @@ -541,7 +541,7 @@ Discussion: * `--shell ` — The shell to generate completion for - Default value: `zsh` + Default value: `` Possible values: `bash`, `elvish`, `fish`, `powershell`, `zsh` diff --git a/docs/manual-zh/src/json_schema.md b/docs/manual-zh/src/json_schema.md new file mode 100644 index 00000000..c7e57e2d --- /dev/null +++ b/docs/manual-zh/src/json_schema.md @@ -0,0 +1,7 @@ +# Config JSON Schema + +## moon.mod.json + + +## moon.pkg.json + \ No newline at end of file diff --git a/docs/manual-zh/src/source/mod_json_schema.html b/docs/manual-zh/src/source/mod_json_schema.html new file mode 100644 index 00000000..eb43300b --- /dev/null +++ b/docs/manual-zh/src/source/mod_json_schema.html @@ -0,0 +1,143 @@ + + + + + + + + + + moon.mod.json schema viewer + + + + +
+ + + + + \ No newline at end of file diff --git a/docs/manual-zh/src/source/pkg_json_schema.html b/docs/manual-zh/src/source/pkg_json_schema.html new file mode 100644 index 00000000..b8bc7603 --- /dev/null +++ b/docs/manual-zh/src/source/pkg_json_schema.html @@ -0,0 +1,407 @@ + + + + + + + + + + moon.pkg.json schema viewer + + + + +
+ + + + + \ No newline at end of file diff --git a/docs/manual/src/commands.md b/docs/manual/src/commands.md index af8c3fb5..7aa20eaf 100644 --- a/docs/manual/src/commands.md +++ b/docs/manual/src/commands.md @@ -541,7 +541,7 @@ Discussion: * `--shell ` — The shell to generate completion for - Default value: `zsh` + Default value: `` Possible values: `bash`, `elvish`, `fish`, `powershell`, `zsh`