From 8a601aa24acac4814f2200a0735ab75011c0aadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrication=20du=20Num=C3=A9rique?= Date: Wed, 28 May 2025 21:13:50 +0200 Subject: [PATCH] =?UTF-8?q?Derni=C3=A8res=20modifications?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- batch_ia/status.json | 2 +- batch_ia/utils/sections.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/batch_ia/status.json b/batch_ia/status.json index 9e26dfe..0967ef4 100644 --- a/batch_ia/status.json +++ b/batch_ia/status.json @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/batch_ia/utils/sections.py b/batch_ia/utils/sections.py index 74bdf73..8cc8b12 100644 --- a/batch_ia/utils/sections.py +++ b/batch_ia/utils/sections.py @@ -701,6 +701,9 @@ def generate_critical_paths_section(data, results): return "\n".join(template) +def slugify(text): + return re.sub(r'\W+', '-', text.strip()).strip('-').lower() + def generate_report(data, results, config): """ Génère le rapport complet structuré selon les spécifications. @@ -742,7 +745,8 @@ def generate_report(data, results, config): # Pour chaque mot-clé, écrire un fichier individuel for mot_cle, contenu in chemins_critiques_sections.items(): print(mot_cle) - suffixe = f" - chemins critiques {mot_cle}" + mot_cle_slug = slugify(mot_cle) + suffixe = f" - chemins critiques {mot_cle_slug}" fichier_personnalise = TEMPLATE_PATH.with_name( TEMPLATE_PATH.name.replace(".md", f"{suffixe}.md") )