From 0b9575c77c38cea86ffdd8e57e2d4314b4a95483 Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Thu, 5 Dec 2024 08:14:44 +0100 Subject: [PATCH] Add front matter with IDs --- ...i_textes_by_textes_modificateurs_to_git_markdown.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scripts/export_legi_textes_by_textes_modificateurs_to_git_markdown.ts b/src/scripts/export_legi_textes_by_textes_modificateurs_to_git_markdown.ts index a17949e..d036662 100644 --- a/src/scripts/export_legi_textes_by_textes_modificateurs_to_git_markdown.ts +++ b/src/scripts/export_legi_textes_by_textes_modificateurs_to_git_markdown.ts @@ -413,6 +413,7 @@ async function exportLegiTexteToMarkdown( async function generateGitDirectory( context: Context, depth: number, + id: string, title: string, liensArticles: LegiSectionTaLienArt[] | undefined, liensSectionTa: LegiSectionTaLienSectionTa[] | undefined, @@ -455,6 +456,10 @@ async function generateGitDirectory( await fs.writeFile( path.join(context.targetDir, articleRepositoryRelativeFilePath), dedent` + --- + ID: ${articleId} + --- + ###### ${articleTitle} ${article.BLOC_TEXTUEL?.CONTENU} @@ -510,6 +515,10 @@ async function generateGitDirectory( await fs.writeFile( path.join(context.targetDir, readmeRepositoryRelativeFilePath), dedent` + --- + ID: ${id} + --- + ${"#".repeat(Math.min(depth, 6))} ${title} ${readmeLinks.map(({ href, title }) => `- [${title}](${href})`).join("\n")} @@ -541,6 +550,7 @@ async function generateGitDirectory( await generateGitDirectory( context, depth + 1, + sectionTaId, sectionTaTitle, sectionTa?.STRUCTURE_TA?.LIEN_ART, sectionTa?.STRUCTURE_TA?.LIEN_SECTION_TA,