Update converter.js
This commit is contained in:
parent
9161c3d6a6
commit
3299d39772
1 changed files with 6 additions and 0 deletions
|
@ -3,7 +3,9 @@ var path = process.argv[2]
|
||||||
console.log(path);
|
console.log(path);
|
||||||
|
|
||||||
var json = JSON.parse(fs.readFileSync(path + "/story/database.json", { encoding: "utf8" }));
|
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 fullMd = "";
|
||||||
|
var artMd = "# Art Of The Dizzy AU\n\n";
|
||||||
|
|
||||||
json.forEach((v, i) => {
|
json.forEach((v, i) => {
|
||||||
var mdTemp = `# ${v.scene}\n`;
|
var mdTemp = `# ${v.scene}\n`;
|
||||||
|
@ -30,5 +32,9 @@ json.forEach((v, i) => {
|
||||||
fullMd += mdTemp + "\n\n";
|
fullMd += mdTemp + "\n\n";
|
||||||
fs.writeFileSync(`${path}/story/human-readable/${v.id}.md`, mdTemp, {encoding: "utf8"});
|
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}/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"});
|
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"});
|
||||||
|
|
Loading…
Reference in a new issue