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