From a6cc01982f6980b103471139f2922caa8b5f0bee Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 17 Sep 2020 19:06:32 +0200 Subject: [PATCH] Add wikiIndex creation script --- createLayouts.ts | 44 ++++++++++- wikiIndex | 202 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 wikiIndex diff --git a/createLayouts.ts b/createLayouts.ts index 194590cea..97e1cb4d1 100644 --- a/createLayouts.ts +++ b/createLayouts.ts @@ -70,6 +70,41 @@ function validate(layout: Layout) { } +function generateWikiEntry(layout: Layout){ + if(layout.hideFromOverview){ + return ""; + } + let image = "MapComplete_Screenshot.png"; + if(layout.socialImage){ + // image = layout.socialImage; + } + + + if(!image.startsWith("http")){ + // image = "https://pietervdvn.github.io/MapComplete/"+image + } + + return `{{Software +|name = ${layout.id} +|author = ${layout.maintainer ?? "MapComplete builtin"} +|web = https://pietervdvn.github.io/MapComplete/${layout.id}.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = ${layout.supportedLanguages.join(";")} +|genre = display;editor +|screenshot = ${image} +|description = A MapComplete theme: ${Translations.W(layout.description)?.InnerRender() ?? ""} +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}}` +} + const alreadyWritten = [] function createIcon(iconPath: string, size: number) { @@ -183,6 +218,9 @@ function createLandingPage(layout: Layout) { const blacklist = ["", "test", ".", "..", "manifest", "index", "land", "preferences", "account", "openstreetmap"] const all = AllKnownLayouts.allSets; + +let wikiPage = ""; + for (const layoutName in all) { if (blacklist.indexOf(layoutName.toLowerCase()) >= 0) { console.log(`Skipping a layout with name${layoutName}, it is on the blacklist`); @@ -205,8 +243,10 @@ for (const layoutName in all) { console.log("Generating html-file for ", layout.id) writeFile(enc(layout.id) + ".html", landing, err) console.log("done") + + wikiPage += "\n\n"+generateWikiEntry(layout); } - +writeFile("wikiIndex", wikiPage, (err) => {err ?? console.log("Could not save wikiindex", err)}); console.log("Counting all translations") Translations.CountTranslations(); -console.log("All done!") \ No newline at end of file +console.log("All done!"); \ No newline at end of file diff --git a/wikiIndex b/wikiIndex new file mode 100644 index 000000000..1038378c8 --- /dev/null +++ b/wikiIndex @@ -0,0 +1,202 @@ + + +{{Software +|name = personal +|author = MapComplete builtin +|web = https://pietervdvn.github.io/MapComplete/personal.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = en +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} + +{{Software +|name = buurtnatuur +|author = +|web = https://pietervdvn.github.io/MapComplete/buurtnatuur.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = nl +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: Met deze tool kan je natuur in je buurt in kaart brengen en meer informatie geven over je favoriete plekje +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} + +{{Software +|name = bookcases +|author = MapComplete +|web = https://pietervdvn.github.io/MapComplete/bookcases.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = en;nl +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: A public bookcase is a small streetside cabinet, box, old phone boot or some other objects where books are stored +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} + +{{Software +|name = aed +|author = MapComplete +|web = https://pietervdvn.github.io/MapComplete/aed.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = en;fr;nl +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: On this map, one can find and mark nearby defibrillators +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} + +{{Software +|name = toilets +|author = MapComplete +|web = https://pietervdvn.github.io/MapComplete/toilets.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = en +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: A map of public toilets +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} + +{{Software +|name = artworks +|author = MapComplete +|web = https://pietervdvn.github.io/MapComplete/artworks.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = en;nl;fr +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: Welcome to Open Artwork Map, a map of statues, busts, grafittis, +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} + +{{Software +|name = fietsstraten +|author = MapComlete +|web = https://pietervdvn.github.io/MapComplete/fietsstraten.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = nl +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: Een kaart met alle gekende fietsstraten +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} + +{{Software +|name = ghostbikes +|author = MapComplete +|web = https://pietervdvn.github.io/MapComplete/ghostbikes.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = en;nl +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: A ghost bike is a memorial for a cyclist who died in a traffic accident, in the form of a white bicycle placed permanently near the accident location +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} + +{{Software +|name = cyclofix +|author = MapComplete +|web = https://pietervdvn.github.io/MapComplete/cyclofix.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = en;nl;fr;gl;de +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: The goal of this map is to present cyclists with an easy-to-use solution to find the appropriate infrastructure for their needs +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} + +{{Software +|name = metamap +|author = MapComplete builtin +|web = https://pietervdvn.github.io/MapComplete/metamap.html +|repo = https://github.com/pietervdvn/MapComplete +|platform = web +|code = Typescript;HTML;CSS +|languages = en +|genre = display;editor +|screenshot = MapComplete_Screenshot.png +|description = A MapComplete theme: +|map = yes +|findLocation = yes +|findNearbyPOI = yes +|addPOI = yes +|editPOI = yes +|editTags = yes +| +}} +