{# Renders an ODCS v3.2.0 context block: a plain string, or instructions, verifiedStatements and constraints. #} {% macro render_context(context) -%} {% if context is string %}
{{ context }}
{% else %} {% set instructions = context.instructions if context.instructions is defined and context.instructions else none %} {% set statements = context.verifiedStatements if context.verifiedStatements is defined and context.verifiedStatements else [] %} {% set constraints = context.constraints if context.constraints is defined and context.constraints else [] %} {% if instructions %}
Instructions
{{ instructions }}
{% endif %} {% if statements|length > 0 %}
Verified statements
{% endif %} {% if constraints|length > 0 %}
Constraints
{% endif %} {% endif %} {%- endmacro %} {# Renders a synonyms list as "Synonyms: a, b (fr-FR)" #} {% macro render_synonyms(synonyms) -%} {% if synonyms and synonyms is sequence and synonyms is not string and synonyms|length > 0 %}
Synonyms: {% for synonym in synonyms %} {% if synonym is string %} {{ synonym }}{% if not loop.last %},{% endif %} {% elif synonym.synonym is defined and synonym.synonym %} {{ synonym.synonym }}{% if synonym.locale is defined and synonym.locale %} ({{ synonym.locale }}){% endif %}{% if not loop.last %},{% endif %} {% endif %} {% endfor %}
{% endif %} {%- endmacro %}