From 9f1dbef6e3976247aa9b777ffb0a68c4ab82a8e3 Mon Sep 17 00:00:00 2001 From: Jordan Blasenhauer Date: Tue, 2 Jul 2024 15:06:40 +0200 Subject: [PATCH] better vue doc build --- docs/ui-components.md | 4 ++++ docs/vue2md.js | 24 +++++++++--------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/docs/ui-components.md b/docs/ui-components.md index 7fd7aae83..67b4c53ea 100644 --- a/docs/ui-components.md +++ b/docs/ui-components.md @@ -1,3 +1,7 @@ +# UI Components + +This page contains all the UI components used in the application. + ## Builder ### Bans.vue diff --git a/docs/vue2md.js b/docs/vue2md.js index 082686d58..fe41cc6ff 100644 --- a/docs/vue2md.js +++ b/docs/vue2md.js @@ -132,7 +132,7 @@ function mergeMd() { }); // Create the md file to merge - const merge = path.join(ouputFolder, finalFile); + const merge = path.join(finalFile); fs.writeFileSync(merge, "", "utf8"); // Append each file in order order.forEach((item) => { @@ -144,7 +144,7 @@ function mergeMd() { // Format merge file function formatMd() { // Create a md file to merge - const merge = path.join(ouputFolder, finalFile); + const merge = path.join(finalFile); // Get data from merge let data = fs.readFileSync(merge, "utf8"); @@ -221,25 +221,19 @@ function formatMd() { // Update the data with split data = dataSplit.join("\n"); + // Add title and description + const title = "# UI Components"; + const description = + "This page contains all the UI components used in the application."; + data = `${title}\n\n${description}\n\n${data}`; + fs.writeFileSync(merge, data, "utf8"); + fs.rmSync(ouputFolder, { recursive: true }); } -// Move final file to root with others pages -// And delete output folder -function moveMd() { - - fs.rename(`./output/${finalFile}`, `./${finalFile}`, function (err) { - if (err) throw err - }) - - // Delete output folder - fs.rmdirSync(ouputFolder, { recursive: true }); - -} vue2js(); js2md(); mergeMd(); formatMd(); -moveMd();