From 762eaeb09f75bf7d8e93f777aa760898439fdfde Mon Sep 17 00:00:00 2001 From: Artemy Date: Sun, 11 Jun 2023 09:31:32 +0300 Subject: [PATCH] feat: index and readme generator --- README.md | 6 ++++++ index.js | 14 ++++++++++++++ index.json | 13 +++++++++++++ package.json | 24 ++++++++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 README.md create mode 100644 index.js create mode 100644 index.json create mode 100644 package.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..4a602d6 --- /dev/null +++ b/README.md @@ -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)) + diff --git a/index.js b/index.js new file mode 100644 index 0000000..648df51 --- /dev/null +++ b/index.js @@ -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); diff --git a/index.json b/index.json new file mode 100644 index 0000000..2ef1e6a --- /dev/null +++ b/index.json @@ -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" + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b6a1786 --- /dev/null +++ b/package.json @@ -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" +}