feat: index and readme generator

This commit is contained in:
Artemy 2023-06-11 09:31:32 +03:00
parent b4ba48ccb2
commit 762eaeb09f
4 changed files with 57 additions and 0 deletions

6
README.md Normal file
View file

@ -0,0 +1,6 @@
# CIM Engine map list
## Political Map of the World ([worldMap](https://cimengine.github.io/map/?id=worldMap))
## ERTH2 - Map of the Virtual States of the ERTH2 Universe ([movc](https://cimengine.github.io/map/?id=movc))

14
index.js Normal file
View file

@ -0,0 +1,14 @@
const fs = require("fs");
const index = JSON.parse(fs.readFileSync("./index.json", "utf-8"));
let readme = "# CIM Engine map list\n\n";
for (let id in index) {
let item = index[id];
readme += `## ${item.name} ${
item.description ? `- ${item.description}` : ""
} ([${id}](https://cimengine.github.io/map/?id=${id}))\n\n`;
}
fs.writeFileSync("./README.md", readme);

13
index.json Normal file
View file

@ -0,0 +1,13 @@
{
"worldMap": {
"name": "Political Map of the World",
"geoURL": "https://raw.githubusercontent.com/CIMEngine/WorldMap/main/map/geo.geojson",
"countryInfoURL": "https://raw.githubusercontent.com/CIMEngine/WorldMap/main/map/src/countries.json"
},
"movc": {
"name": "ERTH2",
"description": "Map of the Virtual States of the ERTH2 Universe",
"geoURL": "https://erth2.github.io/movc/geo/geo.geojson",
"countryInfoURL": "https://erth2.github.io/movc/geo/src/countries.json"
}
}

24
package.json Normal file
View file

@ -0,0 +1,24 @@
{
"name": "maplist",
"version": "1.0.0",
"description": "List of maps build on CIMEngine",
"main": "index.js",
"scripts": {
"build": "node index"
},
"repository": {
"type": "git",
"url": "git+https://github.com/CIMEngine/MapList.git"
},
"keywords": [
"list",
"map",
"geojson"
],
"author": "artegoser",
"license": "MIT",
"bugs": {
"url": "https://github.com/CIMEngine/MapList/issues"
},
"homepage": "https://github.com/CIMEngine/MapList#readme"
}