diff --git a/docs/library.rst b/docs/library.rst index 8f643a7a3..c64df73f0 100644 --- a/docs/library.rst +++ b/docs/library.rst @@ -3,7 +3,8 @@ Rougail is a configuration management library that allows you to load variables in a simple and convenient way. -In the following examples, we will use a specific configuration of Rougail. You will find all the options to :doc:`customize the directories structure used `. +In the following examples, we will use a specific configuration of Rougail. +You will find all the configuraiton options in :doc:`configuration`. To load the configuration you must import the `RougailConfig` class and set the `dictionaries_dir` values: @@ -31,16 +32,16 @@ Here is a first :file:`dict/00-base.yml` dictionary: Then, let's create the :term:`Tiramisu` objects via the following script: -.. code-block:: python +.. code-block:: python :caption: the `script.py` file content - + from rougail import Rougail, RougailConfig RougailConfig['dictionaries_dir'] = ['dict'] rougail = Rougail() config = rougail.get_config() print(config.value.get()) - + Let's execute `script.py`: .. code-block:: bash @@ -76,9 +77,9 @@ Then let's create an extra :term:`dictionary` :file:`extras/00-base.yml`: Then, let's create the :term:`Tiramisu` objects via the following :file:`script.py` script: -.. code-block:: python - :caption: the :file:`script.py` file content - +.. code-block:: python + :caption: the :file:`script.py` file content + from rougail import Rougail, RougailConfig RougailConfig['dictionaries_dir'] = ['dict'] @@ -105,21 +106,21 @@ We create the complementary :term:`dictionary` named :file:`dict/01-function.yml version: '1.0' my_variable_jinja: type: "string" - default: + default: type: jinja jinja: "{{ return_no() }}" Then let's define the :func:`return_no` function in :file:`functions.py`: -.. code-block:: python +.. code-block:: python :caption: the :file:`functions.py` content - + def return_no(): return 'no' Then, let's create the :term:`Tiramisu` objects via the following script: -.. code-block:: python +.. code-block:: python :caption: the `script.py` file content from rougail import Rougail, RougailConfig