rougail/docs/tutorial/domainname.rst
2025-12-01 21:35:27 +01:00

74 lines
1.6 KiB
ReStructuredText

Variable types and parameters
==================================
.. objectives:: Objectives
FIXME
.. type-along:: Variables can have parameters
.. questions:: Question
**question**: Does our `address` domain name variable accepts IP addresses ?
**answer**: Well it depends.
We need to specify whether our variable accepts to be filled using an IP or a domain name only.
This is where the ability to parameterize our variable comes in.
.. type-along:: let's create a variable parameter named `allow_ip`
..
---
manual:
description: Manual proxy configuration
http_proxy:
description: HTTP Proxy
address:
description: HTTP address
type: domainname
params:
allow_ip: true
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/tag/v1.1_034/firefox/10-manual.yml
:language: yaml
:caption: The `address` has a parameter set in the :file:`firefox/10-manual.yml` structure file
:name: RougailAddressParameter
:linenos:
..
---
manual:
description: Manual proxy configuration
http_proxy:
description: HTTP Proxy
address:
description: HTTP address
type: domainname
params:
allow_ip: true
We can see line 11 and 12 that the params allow the domain name `address` variable to be set
with IPs.
.. glossary::
parameter
A parameter is a property of a variable that can refine its behavior
.. keypoints:: let's review the key points
**Keywords**
- we can add :term:`parameter`\ s to variables to refine their behavior
**Progress**
FIXME