From eccc2473d27f97996a7d213e9f16f37a3db27b66 Mon Sep 17 00:00:00 2001 From: VALADI K JAGANATHAN Date: Fri, 17 Nov 2023 12:45:32 +0530 Subject: [PATCH] Update readme.md --- images/readme.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/images/readme.md b/images/readme.md index e7e73a9..d6c38b4 100644 --- a/images/readme.md +++ b/images/readme.md @@ -1 +1,34 @@ -All images of nodes and work related info on effeciency nodes here ! +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); + +const ROOT_DIR = './Portrait Repository/FE10 Mugs (Radiant Dawn)/'; +const README_FILENAME = 'README.md'; +const NB_IMAGES_PER_LINE = 4; +let nbImages = 0; +let mdContent = ''; + +fs.readdirSync(ROOT_DIR).forEach((image) => { + if (image !== README_FILENAME) { + if (!(nbImages % NB_IMAGES_PER_LINE)) { + if (nbImages > 0) { + mdContent += ` +`; + } + mdContent += ` +`; + } + nbImages++; + mdContent += ` + +`; + } +}); +mdContent += ` +
+
+${image} +
`; + +fs.writeFileSync(path.join(ROOT_DIR, README_FILENAME), mdContent);