.. _tutorial:

Tutorial with a real world sample
=====================================

Here is a fairly complete tutorial, it is a use case that comes from the real world.
At the end of the tutorial you will have a good understanding of Rougail.

.. objectives:: Objectives

    Configuring (the setting of) your favorite web browser.

    This tutorial will show you an example of Rougail use based on the
    *how to set a proxy* in the `Mozilla Firefox <https://www.mozilla.org/en-US/firefox/new/>`_ browser
    use case.

More precisely, this tutorial aims at reproducing :term:`variable`\ s behind this Mozilla Firefox settings page:

.. image:: images/firefox.png

We'll call the variables **configuration options** since that's what the variables represent in this use case.

.. attention:: We are not coding a Firefox plugin here.
          We are just going to handle some of the Firefox configuration settings
          with Rougail. We are just validating them. 
          
          The configuration option values entered by the user have to be:

          - validated
          - consitent
          - conform

Let's dive into this **configuration options validation** use case.

.. prerequisites:: Important advice

   It is advisable to follow this tutorial with the help of the corresponding :tutorial:`Rougail git repository tutorial <src/branch/1.1>`.
   You can instead copy/paste or download the different file contents that are explained in this tutorial step and save the files to your computer.
   However, if you use the git Rougail tutorial repository, you will have all the necessary files distributed in the correct tree structure, 
   which is in our opinion much more practical.
   
   ::
   
       git clone -b 1.1 https://forge.cloud.silique.fr/stove/rougail-tutorials.git

.. toctree::
   :titlesonly:
   :caption: The Firefox tutorial

   preliminary
   choice
   family
   types
   calculated
   properties
   dynamic
   jinja
   customtype
   nullable
   webaddress
   multiple
   document
   practice1
   propertyerror
   modes
   practice2
   validators
   namespace
   sequence
   regexp
   auto_save
   underscore_parameter
   variable_propertyerror
   redefine
