From 96d516fd132aa245863896c221f9d42cd9c38138 Mon Sep 17 00:00:00 2001 From: Nekori Date: Mon, 26 Apr 2021 13:11:30 +0200 Subject: [PATCH] Formatage des descriptions en HTML --- html/export_yaml_to_html.py | 58 ++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/html/export_yaml_to_html.py b/html/export_yaml_to_html.py index b8a2913..7370405 100644 --- a/html/export_yaml_to_html.py +++ b/html/export_yaml_to_html.py @@ -135,10 +135,10 @@ template = env.from_string(""" {% if rename[categorie] %}{{rename[categorie]}}{% else %}{{categorie.capitalize()}}{% endif %} {#- Gestion des tableaux #} - {% if categorie == "motscles" -%} + {% if categorie == "motscles" -%}
{% for mot in valeur %}{{mot}}{% endfor %}
{#- Gestion des saes #} - {% elif categorie == "sae" or categorie == "ressources" %} + {% elif categorie == "sae" or categorie == "ressources" -%}
{% for val in valeur %}{{val}}{% endfor %}
{#- Gestion des ACS #} {% elif categorie == "acs" -%} @@ -155,7 +155,7 @@ template = env.from_string(""" {%- else %}{{valeur}}{% endif %} {#- Gestion des autres catégories #} {% else -%} - {{valeur}} +
{{valeur}}
{%- endif -%} @@ -238,6 +238,44 @@ def motscles(mc): motscles.append(mot) return motscles +def formatHTML(string): + """ Retourne un string avec les balises