rougail-output-doc/tests/docs/base/60_6family_dynamic_sub_dynamic.md
2024-08-05 14:38:59 +02:00

15 KiB

Table of Contents

dictionaries/rougail/00-base.yml

---
version: '1.1'
var:  # A suffix variable
  - val1
  - val2
dyn{{ suffix }}:
  description: A dynamic family
  type: dynamic
  dynamic:
    type: variable
    variable: _.var
  var:
    description: A dynamic variable
    multi: true
    default:
      type: jinja
      jinja: |
        {% for val in __.var %}
        t{{ val }}
        {% endfor %}        
      description: add 't' to each var value
  dyn_{{ suffix }}:
    description: a Second dynamic variable
    type: dynamic
    dynamic:
      type: variable
      variable: rougail.dyn{{ suffix }}.var
    var:
      description: A variable dynamic
      default:
        type: suffix
    var_suffix:
      description: suffix from first family
      default:
        type: suffix
        suffix: 0
    var_suffixes:
      description: merge suffixes
      default:
        type: jinja
        jinja: |
          {{ s1 }}-{{ s2 }}          
        params:
          s1:
            type: suffix
            suffix: 0
          s2:
            type: suffix
            suffix: 1
        description: join suffix 1 et suffix 2

Variables for "rougail"

Variable                                                                                                   Description                                                                                               
rougail.var
string standard mandatory unique multiple
A suffix variable.
Default:
- val1
- val2

A dynamic family

standard

This family builds families dynamically.

Suffixes: the value of the variable "rougail.var".

Variable                                                                                                   Description                                                                                               
rougail.dynval1.var ou rougail.dynval2.var
string standard mandatory unique multiple
A dynamic variable.
Default: add 't' to each var value.

a Second dynamic variable

standard

This family builds families dynamically.

Suffixes: the value of the variable "rougail.dyn{{ suffix }}.var".

Variable                                                                                                   Description                                                                                               
rougail.dynval1.dyn_tval1.var, rougail.dynval1.dyn_tval2.var, rougail.dynval2.dyn_tval1.var ou rougail.dynval2.dyn_tval2.var
string standard mandatory
A variable dynamic.
Default: value of the suffix.
rougail.dynval1.dyn_tval1.var_suffix, rougail.dynval1.dyn_tval2.var_suffix, rougail.dynval2.dyn_tval1.var_suffix ou rougail.dynval2.dyn_tval2.var_suffix
string standard mandatory
Suffix from first family.
Default: value of the suffix.
rougail.dynval1.dyn_tval1.var_suffixes, rougail.dynval1.dyn_tval2.var_suffixes, rougail.dynval2.dyn_tval1.var_suffixes ou rougail.dynval2.dyn_tval2.var_suffixes
string standard mandatory
Merge suffixes.
Default: join suffix 1 et suffix 2.

Example with all variables modifiable

---
rougail:
  var:
    - val1
    - val2
  dynval1:
    var:
      - tval1
      - tval2
    dyn_tval1:
      var: tval1
      var_suffix: val1
      var_suffixes: val1-tval1
    dyn_tval2:
      var: tval2
      var_suffix: val1
      var_suffixes: val1-tval2
  dynval2:
    var:
      - tval1
      - tval2
    dyn_tval1:
      var: tval1
      var_suffix: val2
      var_suffixes: val2-tval1
    dyn_tval2:
      var: tval2
      var_suffix: val2
      var_suffixes: val2-tval2