diff --git a/README.md b/README.md index 75e921b..0a87ae6 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ - [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md) +- [[tutorial v1.1_000] Creating a structure file](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_000/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_000~1..v1.1_000)) -# [tutorial v1.1_000] Creating a structure file +# [tutorial v1.1_001] Let’s add our first variable -[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_000~1..v1.1_000) +[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_001~1..v1.1_001) -[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/preliminary.html#creating-a-structure-file) +[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/preliminary.html#let-s-add-our-first-variable) ## Screenshot @@ -30,7 +31,7 @@ pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user- Then switch to the tutorial page: ```shell -git switch --detach v1.1_000 +git switch --detach v1.1_001 ``` ## Structure @@ -38,9 +39,9 @@ git switch --detach v1.1_000

-.
- └── firefox
-     └── 00-proxy.yml
+.
+ └── firefox
+     └── 00-proxy.yml


Contents of the firefox/00-proxy.yml file @@ -49,10 +50,36 @@ Contents of the firefox/00-proxy.yml file %YAML 1.2 --- version: 1.1 + +proxy_mode: ... ``` +*** +### Let's generate the documentation + +```shell +rougail -m firefox/ -o doc +``` +| Variable | +|------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **proxy_mode**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | + + +*** +### Let's generate the changelog + +```shell +rougail -m firefox/ -o doc --doc.contents changelog +``` +#### New variable + +| Variable | +|------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **proxy_mode**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | + + *** ## User datas @@ -71,8 +98,85 @@ version: 1.1 ```shell rougail -m firefox/ -u yaml -yf config/01/config.yml ``` +> [!CAUTION] +> +> - proxy_mode: :stop_sign: mandatory variable but has no value + +*** +#### Output in read write mode + +```shell +rougail -m firefox/ -u yaml -yf config/01/config.yml --cli.read_write +``` +> [!NOTE] +> +> **Caption:** +> - Variable +> - Default value + +Variables: +- :notebook: proxy_mode: null + +*** +### Example 2 + +#### config/02/config.yml + + +```yml +--- +proxy_mode: No proxy +``` + +*** +#### Output + +```shell +rougail -m firefox/ -u yaml -yf config/02/config.yml +``` +> [!NOTE] +> +> **Caption:** +> - Variable +> - Modified value + +Variables: +- :notebook: proxy_mode: No proxy ← loaded from the YAML file "config/02/config.yml" + +*** +### Example 3 + +#### config/03/config.yml + + +```yml +--- +proxy_mode: 1 +``` + +*** +#### Output + +```shell +rougail -m firefox/ -u yaml -yf config/03/config.yml +``` +> [!CAUTION] +> +> - proxy_mode +> - [#EFBF04]:bell: the value "1" is an invalid string, it's not a string, it will be ignored when loading from the YAML file "config/03/config.yml"[/#EFBF04] +> - [#C23636]:stop_sign: mandatory variable but has no value[/#C23636] + +*** +#### Output when invalid user data is an error + +```shell +rougail -m firefox/ -u yaml -yf config/03/config.yml --cli.invalid_user_data_error +``` +> [!CAUTION] +> +> - proxy_mode: :stop_sign: the value "1" is an invalid string, it's not a string, it has been loading from the YAML file "config/03/config.yml" *** -- [[tutorial v1.1_001] Let’s add our first variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_001/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_001~1..v1.1_001)) +- [[tutorial v1.1_002] Describe the variable](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_002/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_002~1..v1.1_002)) diff --git a/config/01/cmd_rw.txt b/config/01/cmd_rw.txt new file mode 100644 index 0000000..93f7d8e --- /dev/null +++ b/config/01/cmd_rw.txt @@ -0,0 +1 @@ +rougail -m firefox/ -u yaml -yf config/01/config.yml --cli.read_write \ No newline at end of file diff --git a/config/01/output_ro.html b/config/01/output_ro.html index 24ce020..d28fe85 100644 --- a/config/01/output_ro.html +++ b/config/01/output_ro.html @@ -1 +1,3 @@ -

+
🛑 Caution
+┗━━ proxy_mode: 🛑 mandatory variable but has no value
+
diff --git a/config/01/output_rw.html b/config/01/output_rw.html new file mode 100644 index 0000000..68c2795 --- /dev/null +++ b/config/01/output_rw.html @@ -0,0 +1,9 @@ +
> [!NOTE]
+>
+> **Caption:**
+> - Variable
+> - <span style="color: #B8860B">Default value</span>
+
+Variables:
+- :notebook: proxy_mode: <span style="color: #B8860B">null</span>
+
diff --git a/config/02/cmd_ro.txt b/config/02/cmd_ro.txt new file mode 100644 index 0000000..772ebbe --- /dev/null +++ b/config/02/cmd_ro.txt @@ -0,0 +1 @@ +rougail -m firefox/ -u yaml -yf config/02/config.yml \ No newline at end of file diff --git a/config/02/config.yml b/config/02/config.yml new file mode 100644 index 0000000..d914488 --- /dev/null +++ b/config/02/config.yml @@ -0,0 +1,2 @@ +--- +proxy_mode: No proxy diff --git a/config/02/output_ro.html b/config/02/output_ro.html new file mode 100644 index 0000000..fd3af12 --- /dev/null +++ b/config/02/output_ro.html @@ -0,0 +1,6 @@ +
╭──────── Caption ────────╮
+│ Variable Modified value │
+╰─────────────────────────╯
+Variables:
+┗━━ 📓 proxy_mode: No proxy ◀ loaded from the YAML file "config/02/config.yml"
+
diff --git a/config/03/cmd_invalid.txt b/config/03/cmd_invalid.txt new file mode 100644 index 0000000..3fe251f --- /dev/null +++ b/config/03/cmd_invalid.txt @@ -0,0 +1 @@ +rougail -m firefox/ -u yaml -yf config/03/config.yml --cli.invalid_user_data_error \ No newline at end of file diff --git a/config/03/cmd_ro.txt b/config/03/cmd_ro.txt new file mode 100644 index 0000000..fc8085e --- /dev/null +++ b/config/03/cmd_ro.txt @@ -0,0 +1 @@ +rougail -m firefox/ -u yaml -yf config/03/config.yml \ No newline at end of file diff --git a/config/03/config.yml b/config/03/config.yml new file mode 100644 index 0000000..bf6f64c --- /dev/null +++ b/config/03/config.yml @@ -0,0 +1,2 @@ +--- +proxy_mode: 1 diff --git a/config/03/output_invalid.html b/config/03/output_invalid.html new file mode 100644 index 0000000..c1e7b2c --- /dev/null +++ b/config/03/output_invalid.html @@ -0,0 +1,4 @@ +
🛑 Caution
+┗━━ proxy_mode: 🛑 the value "1" is an invalid string, it's not a string, it has
+    been loading from the YAML file "config/03/config.yml"
+
diff --git a/config/03/output_ro.html b/config/03/output_ro.html new file mode 100644 index 0000000..e298a88 --- /dev/null +++ b/config/03/output_ro.html @@ -0,0 +1,6 @@ +
🛑 Caution
+┗━━ proxy_mode
+    ┣━━ 🔔 the value "1" is an invalid string, it's not a string, it will be 
+    ignored when loading from the YAML file "config/03/config.yml"
+    ┗━━ 🛑 mandatory variable but has no value
+
diff --git a/firefox.png b/firefox.png index 050f837..45725ac 100644 Binary files a/firefox.png and b/firefox.png differ diff --git a/tree.html b/tree.html index 81f6c21..f271246 100644 --- a/tree.html +++ b/tree.html @@ -1,5 +1,5 @@

-.
- └── firefox
-     └── 00-proxy.yml
+.
+ └── firefox
+     └── 00-proxy.yml


\ No newline at end of file