mirror of
https://github.com/CIMEngine/MapList.git
synced 2024-11-21 19:26:22 +03:00
add external support
This commit is contained in:
parent
21492b5ed9
commit
7bb8c0ad32
2 changed files with 19 additions and 11 deletions
|
@ -1,7 +1,6 @@
|
||||||
# CIM Engine map list
|
# CIMEngine map list
|
||||||
|
|
||||||
1. Political Map of the World ([worldMap](https://cimengine.github.io/map/?id=worldMap))
|
1. Political Map of the World ([worldMap](https://cimengine.github.io/map/?id=worldMap))
|
||||||
2. Virtual Governments - Map of Virtual Countries from OOVC organisation. ([vgovernments](https://cimengine.github.io/map/?id=vgovernments))
|
2. Virtual Governments - Map of Virtual Countries from OOVC organisation. ([vgovernments](https://cimengine.github.io/map/?id=vgovernments))
|
||||||
3. International Virtual Countries - Map of International Virtual Countries (League of Virtual Nations). ([ivc](https://cimengine.github.io/map/?id=ivc))
|
3. International Virtual Countries - Map of International Virtual Countries (League of Virtual Nations). ([ivc](https://cimengine.github.io/map/?id=ivc))
|
||||||
4. Political Map of Dusiburg - Политическая карта Дусибурской Республики ([dusiburg](https://cimengine.github.io/map/?id=dusiburg))
|
4. Political Map of Dusiburg - Политическая карта Дусибурской Республики ([dusiburg](https://cimengine.github.io/map/?id=dusiburg))
|
||||||
5. `OVN` map - Map of Virtual Countries ([movc](https://cimengine.github.io/map/?id=movc))
|
|
||||||
|
|
19
index.js
19
index.js
|
@ -1,15 +1,24 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const index = JSON.parse(fs.readFileSync("./index.json", "utf-8"));
|
async function run() {
|
||||||
|
const index = JSON.parse(fs.readFileSync("./index.json", "utf-8"));
|
||||||
|
|
||||||
let readme = "# CIM Engine map list\n\n";
|
let readme = "# CIMEngine map list\n\n";
|
||||||
|
|
||||||
let k = 1;
|
let k = 1;
|
||||||
for (let id in index) {
|
for (let id in index) {
|
||||||
let item = index[id];
|
let item = index[id];
|
||||||
|
|
||||||
|
if (item.external) {
|
||||||
|
item = await (await fetch(item.external)).json();
|
||||||
|
}
|
||||||
|
|
||||||
readme += `${k++}. ${item.name} ${
|
readme += `${k++}. ${item.name} ${
|
||||||
item.description ? `- ${item.description}` : ""
|
item.description ? `- ${item.description}` : ""
|
||||||
} ([${id}](https://cimengine.github.io/map/?id=${id}))\n`;
|
} ([${id}](https://cimengine.github.io/map/?id=${id}))\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync("./README.md", readme);
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync("./README.md", readme);
|
run();
|
||||||
|
|
Loading…
Add table
Reference in a new issue