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") )