diff --git a/Cargo.lock b/Cargo.lock index 941fb1b5..156b9686 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,7 +61,7 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cargo-auto" -version = "2024.209.504" +version = "2024.218.2136" dependencies = [ "anyhow", "base64ct", diff --git a/Cargo.toml b/Cargo.toml index dcbffca5..939b9ffb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-auto" -version = "2024.209.504" +version = "2024.218.2136" authors = ["bestia.dev"] homepage = "https://bestia.dev" edition = "2021" diff --git a/README.md b/README.md index d8c78df9..46757304 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [//]: # (auto_cargo_toml_to_md start) **cargo-auto - automation tasks written in Rust language for the build process of Rust projects** -***version: 2024.209.504 date: 2024-02-18 author: [bestia.dev](https://bestia.dev) repository: [GitHub](https://github.com/bestia-dev/cargo-auto)*** +***version: 2024.218.2136 date: 2024-02-18 author: [bestia.dev](https://bestia.dev) repository: [GitHub](https://github.com/bestia-dev/cargo-auto)*** [//]: # (auto_cargo_toml_to_md end) @@ -20,11 +20,11 @@ ![Hits](https://bestia.dev/webpage_hit_counter/get_svg_image/959103982.svg) [//]: # (auto_lines_of_code start) -[![Lines in Rust code](https://img.shields.io/badge/Lines_in_Rust-9172-green.svg)](https://github.com/bestia-dev/cargo-auto/) -[![Lines in Doc comments](https://img.shields.io/badge/Lines_in_Doc_comments-219-blue.svg)](https://github.com/bestia-dev/cargo-auto/) -[![Lines in Comments](https://img.shields.io/badge/Lines_in_comments-427-purple.svg)](https://github.com/bestia-dev/cargo-auto/) +[![Lines in Rust code](https://img.shields.io/badge/Lines_in_Rust-9157-green.svg)](https://github.com/bestia-dev/cargo-auto/) +[![Lines in Doc comments](https://img.shields.io/badge/Lines_in_Doc_comments-216-blue.svg)](https://github.com/bestia-dev/cargo-auto/) +[![Lines in Comments](https://img.shields.io/badge/Lines_in_comments-371-purple.svg)](https://github.com/bestia-dev/cargo-auto/) [![Lines in examples](https://img.shields.io/badge/Lines_in_examples-0-yellow.svg)](https://github.com/bestia-dev/cargo-auto/) -[![Lines in tests](https://img.shields.io/badge/Lines_in_tests-6334-orange.svg)](https://github.com/bestia-dev/cargo-auto/) +[![Lines in tests](https://img.shields.io/badge/Lines_in_tests-6310-orange.svg)](https://github.com/bestia-dev/cargo-auto/) [//]: # (auto_lines_of_code end) diff --git a/automation_tasks_rs/Cargo.lock b/automation_tasks_rs/Cargo.lock index e01a0297..ccd93194 100644 --- a/automation_tasks_rs/Cargo.lock +++ b/automation_tasks_rs/Cargo.lock @@ -153,9 +153,9 @@ dependencies = [ [[package]] name = "cargo_auto_lib" -version = "1.1.2" +version = "1.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1f87d809127bc54c9dfe61007640dd082f38d6978c344b792bdf021152c9108" +checksum = "b1ec8b0db4413553d58ee0092ac3f4b9db7715b9f51e55a6c77cbff5cce4e001" dependencies = [ "anyhow", "base64ct", diff --git a/automation_tasks_rs/Cargo.toml b/automation_tasks_rs/Cargo.toml index 7831501d..9e6652b3 100644 --- a/automation_tasks_rs/Cargo.toml +++ b/automation_tasks_rs/Cargo.toml @@ -8,7 +8,7 @@ description = "cargo auto - automation tasks written in Rust language" publish = false [dependencies] -cargo_auto_lib = "1.1.2" +cargo_auto_lib = "1.1.23" base64ct = {version = "1.6.0", features = ["alloc"] } tokio = {version = "1.36.0", features = ["rt","rt-multi-thread","fs"]} cargo_auto_github_lib = "0.1.24" diff --git a/automation_tasks_rs/src/main.rs b/automation_tasks_rs/src/main.rs index fa8be1c6..21798135 100644 --- a/automation_tasks_rs/src/main.rs +++ b/automation_tasks_rs/src/main.rs @@ -230,32 +230,8 @@ fn task_doc() { "echo \"\" > docs/index.html", cargo_toml.package_name().replace("-", "_") )); - - // region: tidy HTML - // The HTML generated by `cargo doc` is ugly and difficult to `git diff` - // tidy HTML is a HTML checker and formatter installed on most Linuxes. - // If it is not installed run: `sudo apt install -y tidy` - // From the bash you can install it inside the podman container like this: - // `podman exec --user root rust_dev_vscode_cnt apt install -y tidy` - // - // First we check if tidy is installed on the system - // Run a dummy command and write the std/err output to tidy_warnings.txt. - // The command `2>` will overwrite the file and not append like `2>>`. - cl::run_shell_command("tidy xxx 2> docs/tidy_warnings.txt"); - // Check if it contains `command not found` - let text = std::fs::read_to_string("docs/tidy_warnings.txt").unwrap(); - // don't need this file anymore - cl::run_shell_command("rm -f docs/tidy_warnings.txt"); - if !text.contains("command not found") { - // Use tidy HTML to format the docs/*.html files to be human readable and usable for git diff. - // Options: -m modify file, -q quiet suppress nonessential output, -w wrap at 160, -i indent 2 spaces - // The warnings and errors are appended to the file docs/tidy_warnings.txt - cl::run_shell_command( - r#"find ./docs -name '*.html' -type f -print -exec tidy -mq -w 160 -i 2 '{}' \; >> docs/tidy_warnings.txt 2>&1 "# - ); - } - // endregion: tidy HTML - + // pretty html + cl::auto_doc_tidy_html().unwrap(); cl::run_shell_command("cargo fmt"); // message to help user with next move println!( diff --git a/src/template_new_auto_mod.rs b/src/template_new_auto_mod.rs index 44673b01..ce70a519 100644 --- a/src/template_new_auto_mod.rs +++ b/src/template_new_auto_mod.rs @@ -125,7 +125,7 @@ description = "cargo auto - automation tasks written in Rust language" publish = false [dependencies] -cargo_auto_lib = "1.1.2" +cargo_auto_lib = "1.1.23" "###, }); vec_file.push(crate::FileItem{ @@ -141,6 +141,9 @@ use cargo_auto_lib::GREEN; use cargo_auto_lib::RED; use cargo_auto_lib::RESET; use cargo_auto_lib::YELLOW; + +// use cargo_auto_github_lib as cgl; + // region: library with basic automation tasks fn main() { @@ -312,39 +315,15 @@ fn task_doc() { "echo \"\" > docs/index.html", cargo_toml.package_name().replace("-", "_") )); - - // region: tidy HTML - // The HTML generated by `cargo doc` is ugly and difficult to `git diff` - // tidy HTML is a HTML checker and formatter installed on most Linuxes. - // If it is not installed run: `sudo apt install -y tidy` - // From the bash you can install it inside the podman container like this: - // `podman exec --user root rust_dev_vscode_cnt apt install -y tidy` - // - // First we check if tidy is installed on the system - // Run a dummy command and write the std/err output to tidy_warnings.txt. - // The command `2>` will overwrite the file and not append like `2>>`. - cl::run_shell_command("tidy xxx 2> docs/tidy_warnings.txt"); - // Check if it contains `command not found` - let text = std::fs::read_to_string("docs/tidy_warnings.txt").unwrap(); - // don't need this file anymore - cl::run_shell_command("rm -f docs/tidy_warnings.txt"); - if !text.contains("command not found") { - // Use tidy HTML to format the docs/*.html files to be human readable and usable for git diff. - // Options: -m modify file, -q quiet suppress nonessential output, -w wrap at 160, -i indent 2 spaces - // The warnings and errors are appended to the file docs/tidy_warnings.txt - cl::run_shell_command( - r#"find ./docs -name '*.html' -type f -print -exec tidy -mq -w 160 -i 2 '{}' \; >> docs/tidy_warnings.txt 2>&1 "# - ); - } - // endregion: tidy HTML - + // pretty html + cl::auto_doc_tidy_html().unwrap(); cl::run_shell_command("cargo fmt"); // message to help user with next move println!( r#" {YELLOW}After `cargo auto doc`, check `docs/index.html`. If ok, then test the documentation code examples{RESET} {GREEN}cargo auto test{RESET} -"# +}"# ); } diff --git a/src/template_new_cli_mod.rs b/src/template_new_cli_mod.rs index 0a446b10..fe8b6f36 100644 --- a/src/template_new_cli_mod.rs +++ b/src/template_new_cli_mod.rs @@ -42,8 +42,7 @@ pub fn get_vec_file() -> Vec { // region: files copied into strings by automation tasks vec_file.push(crate::FileItem{ file_name :"README.md", - file_content : r###" -# cargo_auto_template_new_cli + file_content : r###"# cargo_auto_template_new_cli [//]: # (auto_cargo_toml_to_md start) @@ -64,7 +63,6 @@ pub fn get_vec_file() -> Vec { [//]: # (auto_lines_of_code end) - ## Motivation The first line I typed when I learned the Rust language was `cargo new hello`. It is extraordinary for learning Rust, but it is a rudimentary example, not really useful in practical life. @@ -250,7 +248,6 @@ But I need also to drink. If you find my projects and tutorials helpful, please You know the price of a beer in your local bar ;-) So I can drink a free beer for your health :-) [Na zdravje!](https://translate.google.com/?hl=en&sl=sl&tl=en&text=Na%20zdravje&op=translate) [Alla salute!](https://dictionary.cambridge.org/dictionary/italian-english/alla-salute) [Prost!](https://dictionary.cambridge.org/dictionary/german-english/prost) [Nazdravlje!](https://matadornetwork.com/nights/how-to-say-cheers-in-50-languages/) 🍻 - "###, }); vec_file.push(crate::FileItem { @@ -400,16 +397,14 @@ fn upper_greet_name(greet_name: &str) -> anyhow::Result<()> { vec_file.push(crate::FileItem { file_name: "src/lib.rs", file_content: r###"// cargo_auto_template_new_cli/src/lib.rs - -#![doc=include_str!("../README.md")] - // The `main.rs` has all the stdin and stdout. // The `lib.rs` must be in/out agnostic. That is the responsibility of the `main.rs` - // The `lib.rs` does not have any real code. All the code is in modules in separate files. // The `lib.rs` has just the list of modules, it publishes module's functions or class for the caller // and it has some global stuff like the Error enum. +#![doc=include_str!("../README.md")] + // access to modules mod hello_mod; @@ -555,7 +550,7 @@ description = "cargo auto - automation tasks written in Rust language" publish = false [dependencies] -cargo_auto_lib = "1.1.2""###, +cargo_auto_lib = "1.1.23""###, }); vec_file.push(crate::FileItem{ file_name :"automation_tasks_rs/src/main.rs", @@ -570,9 +565,10 @@ use cargo_auto_lib::GREEN; use cargo_auto_lib::RED; use cargo_auto_lib::RESET; use cargo_auto_lib::YELLOW; -// region: library with basic automation tasks -// use cargo_auto_github_lib::*; +// use cargo_auto_github_lib as cgl; + +// region: library with basic automation tasks fn main() { cl::exit_if_not_run_in_rust_project_root_directory(); @@ -751,32 +747,8 @@ fn task_doc() { "echo \"\" > docs/index.html", cargo_toml.package_name().replace("-", "_") )); - - // region: tidy HTML - // The HTML generated by `cargo doc` is ugly and difficult to `git diff` - // tidy HTML is a HTML checker and formatter installed on most Linuxes. - // If it is not installed run: `sudo apt install -y tidy` - // From the bash you can install it inside the podman container like this: - // `podman exec --user root rust_dev_vscode_cnt apt install -y tidy` - // - // First we check if tidy is installed on the system - // Run a dummy command and write the std/err output to tidy_warnings.txt. - // The command `2>` will overwrite the file and not append like `2>>`. - cl::run_shell_command("tidy xxx 2> docs/tidy_warnings.txt"); - // Check if it contains `command not found` - let text = std::fs::read_to_string("docs/tidy_warnings.txt").unwrap(); - // don't need this file anymore - cl::run_shell_command("rm -f docs/tidy_warnings.txt"); - if !text.contains("command not found") { - // Use tidy HTML to format the docs/*.html files to be human readable and usable for git diff. - // Options: -m modify file, -q quiet suppress nonessential output, -w wrap at 160, -i indent 2 spaces - // The warnings and errors are appended to the file docs/tidy_warnings.txt - cl::run_shell_command( - r#"find ./docs -name '*.html' -type f -print -exec tidy -mq -w 160 -i 2 '{}' \; >> docs/tidy_warnings.txt 2>&1 "# - ); - } - // endregion: tidy HTML - + // pretty html + cl::auto_doc_tidy_html().unwrap(); cl::run_shell_command("cargo fmt"); // message to help user with next move println!( diff --git a/src/template_new_pwa_wasm_mod.rs b/src/template_new_pwa_wasm_mod.rs index 1f0632ba..77843d6a 100644 --- a/src/template_new_pwa_wasm_mod.rs +++ b/src/template_new_pwa_wasm_mod.rs @@ -278,8 +278,7 @@ pub fn get_vec_file() -> Vec { // region: files copied into strings by automation tasks vec_file.push(crate::FileItem{ file_name :"README.md", - file_content : r###" -# rust_project_name + file_content : r###"# rust_project_name [//]: # (auto_cargo_toml_to_md start) @@ -346,7 +345,6 @@ So I can drink a free beer for your health :-) [//github.com/bestia-dev](https://github.com/bestia-dev) [//bestiadev.substack.com](https://bestiadev.substack.com) [//youtube.com/@bestia-dev-tutorials](https://youtube.com/@bestia-dev-tutorials) - "###, }); vec_file.push(crate::FileItem { @@ -360,7 +358,7 @@ So I can drink a free beer for your health :-) // but the new service worker will not be activated until all // tabs with this webapp are closed. -const CACHE_NAME = '2024.209.504'; +const CACHE_NAME = '2024.218.2135'; self.addEventListener('install', event => { console.log('event install ', CACHE_NAME); @@ -7957,7 +7955,6 @@ fn upper_greet_name(greet_name: &str) -> anyhow::Result<()> { vec_file.push(crate::FileItem { file_name: "src/lib.rs", file_content: r###"// src/lib.rs - // This file has just the wasm_bindgen_start() function // and calls into main_mod.rs. // So the structure of the project modules can be similar to a binary CLI executable. @@ -8050,7 +8047,7 @@ description = "cargo auto - automation tasks written in Rust language" publish = false [dependencies] -cargo_auto_lib = "1.1.2""###, +cargo_auto_lib = "1.1.23""###, }); vec_file.push(crate::FileItem{ file_name :"automation_tasks_rs/src/main.rs", @@ -8239,32 +8236,8 @@ fn task_doc() { "echo \"\" > docs/index.html", cargo_toml.package_name().replace("-", "_") )); - - // region: tidy HTML - // The HTML generated by `cargo doc` is ugly and difficult to `git diff` - // tidy HTML is a HTML checker and formatter installed on most Linuxes. - // If it is not installed run: `sudo apt install -y tidy` - // From the bash you can install it inside the podman container like this: - // `podman exec --user root rust_dev_vscode_cnt apt install -y tidy` - // - // First we check if tidy is installed on the system - // Run a dummy command and write the std/err output to tidy_warnings.txt. - // The command `2>` will overwrite the file and not append like `2>>`. - cl::run_shell_command("tidy xxx 2> docs/tidy_warnings.txt"); - // Check if it contains `command not found` - let text = std::fs::read_to_string("docs/tidy_warnings.txt").unwrap(); - // don't need this file anymore - cl::run_shell_command("rm -f docs/tidy_warnings.txt"); - if !text.contains("command not found") { - // Use tidy HTML to format the docs/*.html files to be human readable and usable for git diff. - // Options: -m modify file, -q quiet suppress nonessential output, -w wrap at 160, -i indent 2 spaces - // The warnings and errors are appended to the file docs/tidy_warnings.txt - cl::run_shell_command( - r#"find ./docs -name '*.html' -type f -print -exec tidy -mq -w 160 -i 2 '{}' \; >> docs/tidy_warnings.txt 2>&1 "# - ); - } - // endregion: tidy HTML - + // pretty html + cl::auto_doc_tidy_html().unwrap(); cl::run_shell_command("cargo fmt"); // message to help user with next move println!( diff --git a/src/template_new_wasm_mod.rs b/src/template_new_wasm_mod.rs index dfaaabe7..a7661987 100644 --- a/src/template_new_wasm_mod.rs +++ b/src/template_new_wasm_mod.rs @@ -44,8 +44,7 @@ pub fn get_vec_file() -> Vec { // region: files copied into strings by automation tasks vec_file.push(crate::FileItem{ file_name :"README.md", - file_content : r###" -# cargo_auto_template_new_wasm + file_content : r###"# cargo_auto_template_new_wasm [//]: # (auto_cargo_toml_to_md start) @@ -113,7 +112,6 @@ So I can drink a free beer for your health :-) [//github.com/bestia-dev](https://github.com/bestia-dev) [//bestiadev.substack.com](https://bestiadev.substack.com) [//youtube.com/@bestia-dev-tutorials](https://youtube.com/@bestia-dev-tutorials) - "###, }); vec_file.push(crate::FileItem { @@ -659,10 +657,10 @@ r#"The result is }); vec_file.push(crate::FileItem { file_name: "src/lib.rs", - file_content: r###"//! src/lib.rs -//! This file has just the wasm_bindgen_start() function -//! and calls into main_mod.rs. -//! So the structure of the project modules can be similar to a binary CLI executable. + file_content: r###"// src/lib.rs +// This file has just the wasm_bindgen_start() function +// and calls into main_mod.rs. +// So the structure of the project modules can be similar to a binary CLI executable. #![doc=include_str!("../README.md")] @@ -754,7 +752,7 @@ description = "cargo auto - automation tasks written in Rust language" publish = false [dependencies] -cargo_auto_lib = "1.1.2""###, +cargo_auto_lib = "1.1.23""###, }); vec_file.push(crate::FileItem{ file_name :"automation_tasks_rs/src/main.rs", @@ -941,32 +939,8 @@ fn task_doc() { "echo \"\" > docs/index.html", cargo_toml.package_name().replace("-", "_") )); - - // region: tidy HTML - // The HTML generated by `cargo doc` is ugly and difficult to `git diff` - // tidy HTML is a HTML checker and formatter installed on most Linuxes. - // If it is not installed run: `sudo apt install -y tidy` - // From the bash you can install it inside the podman container like this: - // `podman exec --user root rust_dev_vscode_cnt apt install -y tidy` - // - // First we check if tidy is installed on the system - // Run a dummy command and write the std/err output to tidy_warnings.txt. - // The command `2>` will overwrite the file and not append like `2>>`. - cl::run_shell_command("tidy xxx 2> docs/tidy_warnings.txt"); - // Check if it contains `command not found` - let text = std::fs::read_to_string("docs/tidy_warnings.txt").unwrap(); - // don't need this file anymore - cl::run_shell_command("rm -f docs/tidy_warnings.txt"); - if !text.contains("command not found") { - // Use tidy HTML to format the docs/*.html files to be human readable and usable for git diff. - // Options: -m modify file, -q quiet suppress nonessential output, -w wrap at 160, -i indent 2 spaces - // The warnings and errors are appended to the file docs/tidy_warnings.txt - cl::run_shell_command( - r#"find ./docs -name '*.html' -type f -print -exec tidy -mq -w 160 -i 2 '{}' \; >> docs/tidy_warnings.txt 2>&1 "# - ); - } - // endregion: tidy HTML - + // pretty html + cl::auto_doc_tidy_html().unwrap(); cl::run_shell_command("cargo fmt"); // message to help user with next move println!( diff --git a/template_new_auto/Cargo.toml b/template_new_auto/Cargo.toml index a5a8facb..ff016017 100644 --- a/template_new_auto/Cargo.toml +++ b/template_new_auto/Cargo.toml @@ -8,4 +8,4 @@ description = "cargo auto - automation tasks written in Rust language" publish = false [dependencies] -cargo_auto_lib = "1.1.2" +cargo_auto_lib = "1.1.23" diff --git a/template_new_auto/src/main.rs b/template_new_auto/src/main.rs index 3d1ac8ec..18e8c013 100644 --- a/template_new_auto/src/main.rs +++ b/template_new_auto/src/main.rs @@ -183,32 +183,8 @@ fn task_doc() { "echo \"\" > docs/index.html", cargo_toml.package_name().replace("-", "_") )); - - // region: tidy HTML - // The HTML generated by `cargo doc` is ugly and difficult to `git diff` - // tidy HTML is a HTML checker and formatter installed on most Linuxes. - // If it is not installed run: `sudo apt install -y tidy` - // From the bash you can install it inside the podman container like this: - // `podman exec --user root rust_dev_vscode_cnt apt install -y tidy` - // - // First we check if tidy is installed on the system - // Run a dummy command and write the std/err output to tidy_warnings.txt. - // The command `2>` will overwrite the file and not append like `2>>`. - cl::run_shell_command("tidy xxx 2> docs/tidy_warnings.txt"); - // Check if it contains `command not found` - let text = std::fs::read_to_string("docs/tidy_warnings.txt").unwrap(); - // don't need this file anymore - cl::run_shell_command("rm -f docs/tidy_warnings.txt"); - if !text.contains("command not found") { - // Use tidy HTML to format the docs/*.html files to be human readable and usable for git diff. - // Options: -m modify file, -q quiet suppress nonessential output, -w wrap at 160, -i indent 2 spaces - // The warnings and errors are appended to the file docs/tidy_warnings.txt - cl::run_shell_command( - r#"find ./docs -name '*.html' -type f -print -exec tidy -mq -w 160 -i 2 '{}' \; >> docs/tidy_warnings.txt 2>&1 "# - ); - } - // endregion: tidy HTML - + // pretty html + cl::auto_doc_tidy_html().unwrap(); cl::run_shell_command("cargo fmt"); // message to help user with next move println!( diff --git a/template_new_cli/automation_tasks_rs/Cargo.toml b/template_new_cli/automation_tasks_rs/Cargo.toml index f8b46a83..bdb7859f 100644 --- a/template_new_cli/automation_tasks_rs/Cargo.toml +++ b/template_new_cli/automation_tasks_rs/Cargo.toml @@ -9,4 +9,4 @@ description = "cargo auto - automation tasks written in Rust language" publish = false [dependencies] -cargo_auto_lib = "1.1.2" \ No newline at end of file +cargo_auto_lib = "1.1.23" \ No newline at end of file diff --git a/template_new_cli/automation_tasks_rs/src/main.rs b/template_new_cli/automation_tasks_rs/src/main.rs index 3f30df75..775c12c1 100644 --- a/template_new_cli/automation_tasks_rs/src/main.rs +++ b/template_new_cli/automation_tasks_rs/src/main.rs @@ -191,32 +191,8 @@ fn task_doc() { "echo \"\" > docs/index.html", cargo_toml.package_name().replace("-", "_") )); - - // region: tidy HTML - // The HTML generated by `cargo doc` is ugly and difficult to `git diff` - // tidy HTML is a HTML checker and formatter installed on most Linuxes. - // If it is not installed run: `sudo apt install -y tidy` - // From the bash you can install it inside the podman container like this: - // `podman exec --user root rust_dev_vscode_cnt apt install -y tidy` - // - // First we check if tidy is installed on the system - // Run a dummy command and write the std/err output to tidy_warnings.txt. - // The command `2>` will overwrite the file and not append like `2>>`. - cl::run_shell_command("tidy xxx 2> docs/tidy_warnings.txt"); - // Check if it contains `command not found` - let text = std::fs::read_to_string("docs/tidy_warnings.txt").unwrap(); - // don't need this file anymore - cl::run_shell_command("rm -f docs/tidy_warnings.txt"); - if !text.contains("command not found") { - // Use tidy HTML to format the docs/*.html files to be human readable and usable for git diff. - // Options: -m modify file, -q quiet suppress nonessential output, -w wrap at 160, -i indent 2 spaces - // The warnings and errors are appended to the file docs/tidy_warnings.txt - cl::run_shell_command( - r#"find ./docs -name '*.html' -type f -print -exec tidy -mq -w 160 -i 2 '{}' \; >> docs/tidy_warnings.txt 2>&1 "# - ); - } - // endregion: tidy HTML - + // pretty html + cl::auto_doc_tidy_html().unwrap(); cl::run_shell_command("cargo fmt"); // message to help user with next move println!( diff --git a/template_new_pwa_wasm/automation_tasks_rs/Cargo.toml b/template_new_pwa_wasm/automation_tasks_rs/Cargo.toml index f8b46a83..bdb7859f 100644 --- a/template_new_pwa_wasm/automation_tasks_rs/Cargo.toml +++ b/template_new_pwa_wasm/automation_tasks_rs/Cargo.toml @@ -9,4 +9,4 @@ description = "cargo auto - automation tasks written in Rust language" publish = false [dependencies] -cargo_auto_lib = "1.1.2" \ No newline at end of file +cargo_auto_lib = "1.1.23" \ No newline at end of file diff --git a/template_new_pwa_wasm/automation_tasks_rs/src/main.rs b/template_new_pwa_wasm/automation_tasks_rs/src/main.rs index 009a7d86..351c6626 100644 --- a/template_new_pwa_wasm/automation_tasks_rs/src/main.rs +++ b/template_new_pwa_wasm/automation_tasks_rs/src/main.rs @@ -183,32 +183,8 @@ fn task_doc() { "echo \"\" > docs/index.html", cargo_toml.package_name().replace("-", "_") )); - - // region: tidy HTML - // The HTML generated by `cargo doc` is ugly and difficult to `git diff` - // tidy HTML is a HTML checker and formatter installed on most Linuxes. - // If it is not installed run: `sudo apt install -y tidy` - // From the bash you can install it inside the podman container like this: - // `podman exec --user root rust_dev_vscode_cnt apt install -y tidy` - // - // First we check if tidy is installed on the system - // Run a dummy command and write the std/err output to tidy_warnings.txt. - // The command `2>` will overwrite the file and not append like `2>>`. - cl::run_shell_command("tidy xxx 2> docs/tidy_warnings.txt"); - // Check if it contains `command not found` - let text = std::fs::read_to_string("docs/tidy_warnings.txt").unwrap(); - // don't need this file anymore - cl::run_shell_command("rm -f docs/tidy_warnings.txt"); - if !text.contains("command not found") { - // Use tidy HTML to format the docs/*.html files to be human readable and usable for git diff. - // Options: -m modify file, -q quiet suppress nonessential output, -w wrap at 160, -i indent 2 spaces - // The warnings and errors are appended to the file docs/tidy_warnings.txt - cl::run_shell_command( - r#"find ./docs -name '*.html' -type f -print -exec tidy -mq -w 160 -i 2 '{}' \; >> docs/tidy_warnings.txt 2>&1 "# - ); - } - // endregion: tidy HTML - + // pretty html + cl::auto_doc_tidy_html().unwrap(); cl::run_shell_command("cargo fmt"); // message to help user with next move println!( diff --git a/template_new_pwa_wasm/web_server_folder/pwa_short_name/service_worker.js b/template_new_pwa_wasm/web_server_folder/pwa_short_name/service_worker.js index 281c00f8..66e278a2 100644 --- a/template_new_pwa_wasm/web_server_folder/pwa_short_name/service_worker.js +++ b/template_new_pwa_wasm/web_server_folder/pwa_short_name/service_worker.js @@ -7,7 +7,7 @@ // but the new service worker will not be activated until all // tabs with this webapp are closed. -const CACHE_NAME = '2024.209.504'; +const CACHE_NAME = '2024.218.2136'; self.addEventListener('install', event => { console.log('event install ', CACHE_NAME); diff --git a/template_new_wasm/automation_tasks_rs/Cargo.toml b/template_new_wasm/automation_tasks_rs/Cargo.toml index f8b46a83..bdb7859f 100644 --- a/template_new_wasm/automation_tasks_rs/Cargo.toml +++ b/template_new_wasm/automation_tasks_rs/Cargo.toml @@ -9,4 +9,4 @@ description = "cargo auto - automation tasks written in Rust language" publish = false [dependencies] -cargo_auto_lib = "1.1.2" \ No newline at end of file +cargo_auto_lib = "1.1.23" \ No newline at end of file diff --git a/template_new_wasm/automation_tasks_rs/src/main.rs b/template_new_wasm/automation_tasks_rs/src/main.rs index be496e56..d6d0af3e 100644 --- a/template_new_wasm/automation_tasks_rs/src/main.rs +++ b/template_new_wasm/automation_tasks_rs/src/main.rs @@ -181,32 +181,8 @@ fn task_doc() { "echo \"\" > docs/index.html", cargo_toml.package_name().replace("-", "_") )); - - // region: tidy HTML - // The HTML generated by `cargo doc` is ugly and difficult to `git diff` - // tidy HTML is a HTML checker and formatter installed on most Linuxes. - // If it is not installed run: `sudo apt install -y tidy` - // From the bash you can install it inside the podman container like this: - // `podman exec --user root rust_dev_vscode_cnt apt install -y tidy` - // - // First we check if tidy is installed on the system - // Run a dummy command and write the std/err output to tidy_warnings.txt. - // The command `2>` will overwrite the file and not append like `2>>`. - cl::run_shell_command("tidy xxx 2> docs/tidy_warnings.txt"); - // Check if it contains `command not found` - let text = std::fs::read_to_string("docs/tidy_warnings.txt").unwrap(); - // don't need this file anymore - cl::run_shell_command("rm -f docs/tidy_warnings.txt"); - if !text.contains("command not found") { - // Use tidy HTML to format the docs/*.html files to be human readable and usable for git diff. - // Options: -m modify file, -q quiet suppress nonessential output, -w wrap at 160, -i indent 2 spaces - // The warnings and errors are appended to the file docs/tidy_warnings.txt - cl::run_shell_command( - r#"find ./docs -name '*.html' -type f -print -exec tidy -mq -w 160 -i 2 '{}' \; >> docs/tidy_warnings.txt 2>&1 "# - ); - } - // endregion: tidy HTML - + // pretty html + cl::auto_doc_tidy_html().unwrap(); cl::run_shell_command("cargo fmt"); // message to help user with next move println!(