From 3299d39772153dd8ae11c4b01861b147c14bc467 Mon Sep 17 00:00:00 2001 From: MeowcaTheoRange <58280776+MeowcaTheoRange@users.noreply.github.com> Date: Sun, 29 May 2022 20:18:57 -0500 Subject: [PATCH] Update converter.js --- code/converter.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/converter.js b/code/converter.js index 2534b52..9547ee5 100644 --- a/code/converter.js +++ b/code/converter.js @@ -3,7 +3,9 @@ var path = process.argv[2] console.log(path); var json = JSON.parse(fs.readFileSync(path + "/story/database.json", { encoding: "utf8" })); +var artjson = JSON.parse(fs.readFileSync(path + "/art/data.json", { encoding: "utf8" })); var fullMd = ""; +var artMd = "# Art Of The Dizzy AU\n\n"; json.forEach((v, i) => { var mdTemp = `# ${v.scene}\n`; @@ -30,5 +32,9 @@ json.forEach((v, i) => { fullMd += mdTemp + "\n\n"; fs.writeFileSync(`${path}/story/human-readable/${v.id}.md`, mdTemp, {encoding: "utf8"}); }) +artjson.forEach((v, i) => { + artMd += `# ${v.title}\n${v.description}\n\n![](${v.image})\n\nCredit: \`${v.credit}\`\n\n`; +}) fs.writeFileSync(`${path}/story/human-readable.md`, fullMd, {encoding: "utf8"}); +fs.writeFileSync(`${path}/art.md`, artMd, {encoding: "utf8"}); fs.writeFileSync(`${path}/index.md`, "# The full, unbroken story of the Dizzy AU.\n[See it on GitHub Pages.](https://meowcatheorange.github.io/Dizzy-AU/index)\n\n" + fullMd, {encoding: "utf8"});