Update converter.js
This commit is contained in:
parent
7735f057ef
commit
e3cded50c3
1 changed files with 3 additions and 0 deletions
|
@ -3,6 +3,7 @@ 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 fullMd = "";
|
||||||
|
|
||||||
json.forEach((v, i) => {
|
json.forEach((v, i) => {
|
||||||
var mdTemp = `# ${v.scene}\n`;
|
var mdTemp = `# ${v.scene}\n`;
|
||||||
|
@ -26,5 +27,7 @@ json.forEach((v, i) => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
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"});
|
||||||
})
|
})
|
||||||
|
fs.writeFileSync(`${path}/story/human-readable.md`, fullMd, {encoding: "utf8"});
|
||||||
|
|
Loading…
Reference in a new issue