[tutorial v1.1_003] Set a default value (config and doc)

This commit is contained in:
egarette@silique.fr 2026-01-08 20:21:59 +01:00
parent 632bc898c5
commit 42728482ea
7 changed files with 39 additions and 53 deletions

View file

@ -1,11 +1,11 @@
- [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md) - [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md)
- [[tutorial v1.1_001] Lets 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))
# [tutorial v1.1_002] Describe the variable # [tutorial v1.1_003] Set a default value
[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_002~1..v1.1_002) [View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_003~1..v1.1_003)
[Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/preliminary.html#describe-the-variable) [Read the documentation](https://pedago.gwenaelremond.fr/bribes/rougail/tutorial/preliminary.html#set-a-default-value)
## Screenshot ## Screenshot
@ -31,7 +31,7 @@ pip install rougail-cli rougail-output-exporter rougail-output-doc rougail-user-
Then switch to the tutorial page: Then switch to the tutorial page:
```shell ```shell
git switch --detach v1.1_002 git switch --detach v1.1_003
``` ```
## Structure ## Structure
@ -39,9 +39,9 @@ git switch --detach v1.1_002
<p> <p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_002/./">.</a><br/> <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_003/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_002/./firefox/">firefox</a><br/> └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_003/./firefox/">firefox</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_002/./firefox/00-proxy.yml">00-proxy.yml</a><br/>     └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_003/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
<br/><br/></p> <br/><br/></p>
Contents of the firefox/00-proxy.yml file Contents of the firefox/00-proxy.yml file
@ -51,7 +51,7 @@ Contents of the firefox/00-proxy.yml file
--- ---
version: 1.1 version: 1.1
proxy_mode: # Configure Proxy Access to the Internet proxy_mode: No proxy # Configure Proxy Access to the Internet
... ...
``` ```
@ -63,8 +63,8 @@ proxy_mode: # Configure Proxy Access to the Internet
rougail -m firefox/ -o doc rougail -m firefox/ -o doc
``` ```
| Variable | Description | | Variable | Description |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------| |------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| **<a id="proxy_mode" name="proxy_mode">proxy_mode</a>**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Configure Proxy Access to the Internet. | | **<a id="proxy_mode" name="proxy_mode">proxy_mode</a>**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Configure Proxy Access to the Internet.<br/>**Default**: No proxy |
*** ***
@ -76,8 +76,8 @@ rougail -m firefox/ -o doc --doc.contents changelog
#### Modified variable #### Modified variable
| Variable | Description | | Variable | Description |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------| |------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| **<a id="proxy_mode" name="proxy_mode">proxy_mode</a>**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | <ins>Configure Proxy Access to the Internet.</ins> | | **<a id="proxy_mode" name="proxy_mode">proxy_mode</a>**<br/>[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Configure Proxy Access to the Internet.<br/>**Default**: <ins>No proxy</ins> |
*** ***
@ -98,16 +98,6 @@ rougail -m firefox/ -o doc --doc.contents changelog
```shell ```shell
rougail -m firefox/ -u yaml -yf config/01/config.yml rougail -m firefox/ -u yaml -yf config/01/config.yml
``` ```
> [!CAUTION]
>
> - proxy_mode (Configure Proxy Access to the Internet): :stop_sign: <span style="color: #C23636">mandatory variable but has no value</span>
***
#### Output in read write mode
```shell
rougail -m firefox/ -u yaml -yf config/01/config.yml --cli.read_write
```
> [!NOTE] > [!NOTE]
> >
> **Caption:** > **Caption:**
@ -115,7 +105,7 @@ rougail -m firefox/ -u yaml -yf config/01/config.yml --cli.read_write
> - <span style="color: #B8860B">Default value</span> > - <span style="color: #B8860B">Default value</span>
Variables: Variables:
- :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #B8860B">null</span> - :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #B8860B">No proxy</span>
*** ***
### Example 2 ### Example 2
@ -139,9 +129,10 @@ rougail -m firefox/ -u yaml -yf config/02/config.yml
> **Caption:** > **Caption:**
> - Variable > - Variable
> - <span style="color: #006400">Modified value</span> > - <span style="color: #006400">Modified value</span>
> - (:hourglass_flowing_sand: Original default value)
Variables: Variables:
- :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #006400">No proxy</span> ← loaded from the YAML file "config/02/config.yml" - :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #006400">No proxy</span> ← loaded from the YAML file "config/02/config.yml" (:hourglass_flowing_sand: No proxy)
*** ***
### Example 3 ### Example 3
@ -165,11 +156,12 @@ rougail -m firefox/ -u yaml -yf config/03/config.yml
> **Caption:** > **Caption:**
> - Variable > - Variable
> - <span style="color: #006400">Modified value</span> > - <span style="color: #006400">Modified value</span>
> - (:hourglass_flowing_sand: Original default value)
Variables: Variables:
- :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #006400">foo</span> ← loaded from the YAML file "config/03/config.yml" - :notebook: proxy_mode (Configure Proxy Access to the Internet): <span style="color: #006400">foo</span> ← loaded from the YAML file "config/03/config.yml" (:hourglass_flowing_sand: No proxy)
*** ***
- [[tutorial v1.1_003] Set a default value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_003/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_003~1..v1.1_003)) - [[tutorial v1.1_010] A variable with a list of possible values](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_010/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_010~1..v1.1_010))

View file

@ -1 +0,0 @@
rougail -m firefox/ -u yaml -yf config/01/config.yml --cli.read_write

View file

@ -1,4 +1,6 @@
<pre><span style="font-weight: bold; color: #ff0000">🛑 Caution</span> <pre>╭─────── Caption ────────╮
<span style="color: #ff0000">┗━━ </span>proxy_mode (Configure Proxy Access to the Internet): <span style="color: #ff0000">🛑 mandatory variable </span> │ Variable <span style="color: #ffd700">Default value</span>
<span style="color: #ff0000"> </span><span style="color: #ff0000">but has no value</span> ╰────────────────────────╯
Variables:
<span style="color: #5c5cff">┗━━ </span>📓 proxy_mode (Configure Proxy Access to the Internet): <span style="color: #ffd700">No proxy</span>
</pre> </pre>

View file

@ -1,9 +0,0 @@
<pre>&gt; [!NOTE]
&gt;
&gt; **Caption:**
&gt; - Variable
&gt; - &lt;span style="color: #B8860B"&gt;Default value&lt;/span&gt;
Variables:
- :notebook: proxy_mode (Configure Proxy Access to the Internet): &lt;span style="color: #B8860B"&gt;null&lt;/span&gt;
</pre>

View file

@ -1,7 +1,8 @@
<pre>╭──────── Caption ────────╮ <pre>╭────────────── Caption ───────────────╮
│ Variable <span style="color: #00aa00">Modified value</span> │ Variable <span style="color: #00aa00">Modified value</span>
╰─────────────────────────╯ │ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables: Variables:
<span style="color: #5c5cff">┗━━ </span>📓 proxy_mode (Configure Proxy Access to the Internet): <span style="color: #00aa00">No proxy</span> ◀ loaded <span style="color: #5c5cff">┗━━ </span>📓 proxy_mode (Configure Proxy Access to the Internet): <span style="color: #00aa00">No proxy</span> ◀ loaded
<span style="color: #5c5cff"> </span>from the YAML file "config/02/config.yml" <span style="color: #5c5cff"> </span>from the YAML file "config/02/config.yml" (⏳ No proxy)
</pre> </pre>

View file

@ -1,7 +1,8 @@
<pre>╭──────── Caption ────────╮ <pre>╭────────────── Caption ───────────────╮
│ Variable <span style="color: #00aa00">Modified value</span> │ Variable <span style="color: #00aa00">Modified value</span>
╰─────────────────────────╯ │ (⏳ Original default value) │
╰──────────────────────────────────────╯
Variables: Variables:
<span style="color: #5c5cff">┗━━ </span>📓 proxy_mode (Configure Proxy Access to the Internet): <span style="color: #00aa00">foo</span> ◀ loaded from <span style="color: #5c5cff">┗━━ </span>📓 proxy_mode (Configure Proxy Access to the Internet): <span style="color: #00aa00">foo</span> ◀ loaded from
<span style="color: #5c5cff"> </span>the YAML file "config/03/config.yml" <span style="color: #5c5cff"> </span>the YAML file "config/03/config.yml" (⏳ No proxy)
</pre> </pre>

View file

@ -1,5 +1,5 @@
<p> <p>
<a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_002/./">.</a><br/> <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_003/./">.</a><br/>
└── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_002/./firefox/">firefox</a><br/> └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_003/./firefox/">firefox</a><br/>
    └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_002/./firefox/00-proxy.yml">00-proxy.yml</a><br/>     └── <a href="https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_003/./firefox/00-proxy.yml">00-proxy.yml</a><br/>
<br/><br/></p> <br/><br/></p>