rougail/docs/tutorial/index.rst

68 lines
2.2 KiB
ReStructuredText
Raw Normal View History

2025-11-06 11:46:31 +01:00
.. _tutorial:
2024-10-14 14:05:23 +02:00
Tutorial with a real world sample
=====================================
2025-06-26 12:54:33 +02:00
Here is a fairly complete tutorial, it is a use case that comes from the real world.
2025-02-03 20:20:15 +01:00
At the end of the tutorial you will have a good understanding of rougail.
2024-10-14 14:05:23 +02:00
2025-06-26 12:54:33 +02:00
.. objectives:: Objectives
Configuring (the setting of) your favorite web browser.
2024-10-14 14:05:23 +02:00
This tutorial will show you an example of Rougail use based on the
2025-02-03 20:20:15 +01:00
*how to set a proxy* in the `Mozilla Firefox <https://www.mozilla.org/en-US/firefox/new/>`_ browser
2024-10-14 14:05:23 +02:00
use case.
2025-02-03 20:20:15 +01:00
More precisely, this tutorial aims at reproducing :term:`variable`\ s behind this Mozilla Firefox settings page:
2024-10-14 14:05:23 +02:00
2024-10-21 18:28:34 +02:00
.. image:: images/firefox.png
2025-06-26 12:54:33 +02:00
We'll call the variables **configuration options** since that's what the variables represent in this use case.
2025-02-03 20:20:15 +01:00
.. attention:: We are not coding a firefox plugin here.
2024-10-14 14:05:23 +02:00
We are just going to handle some of the firefox configuration settings
2025-11-05 15:16:45 +01:00
with Rougail. We are just validating them.
The configuration option values entered by the user have to be:
- validated
- consitent
- conform
2024-10-14 14:05:23 +02:00
2025-06-26 12:54:33 +02:00
Let's dive into this **configuration options validation** use case.
2025-11-05 15:16:45 +01:00
Presentation of the firefox configuration options
--------------------------------------------------
2024-10-14 14:05:23 +02:00
2025-11-05 15:16:45 +01:00
At first glance we can see that we have a selection of five configuration options that we need to fill in, they are highlighted here in this screenshot:
2025-02-03 20:20:15 +01:00
2025-11-05 15:16:45 +01:00
.. image:: images/firefox_01.png
2025-09-16 18:51:35 +02:00
2025-11-05 15:16:45 +01:00
We'll learn in this tutorial how to set the values of the configuration options in a clean way with the Rougail library.
2024-10-14 14:05:23 +02:00
2025-11-05 15:16:45 +01:00
.. prerequisites:: Important advice
2024-10-14 14:05:23 +02:00
2025-11-05 15:16:45 +01:00
It is advisable to follow this tutorial with the help of the corresponding :tutorial:`Rougail git repository tutorial <>`.
If you use this rougail tutorial repository, you will have all the necessary files distributed in the correct tree structure.
2025-11-07 09:05:44 +01:00
::
git clone https://forge.cloud.silique.fr/stove/rougail-tutorials.git
2025-11-05 15:16:45 +01:00
Of course, you can also decide to start from scratch and copy/paste the tutorial files content.
2024-10-14 14:05:23 +02:00
.. toctree::
:titlesonly:
2025-11-05 15:16:45 +01:00
:caption: The firefox tutorial
2024-10-14 14:05:23 +02:00
2024-10-14 19:17:44 +02:00
preliminary
2025-11-22 12:24:54 +01:00
choice
2024-10-15 18:17:21 +02:00
proxymode
2025-02-21 17:31:26 +01:00
disabled
2025-05-14 13:17:08 +02:00
boolean
2025-07-28 14:49:01 +02:00
dynfam
2025-09-16 18:51:35 +02:00
calculation
2025-11-05 09:38:36 +01:00