Add wikiIndex creation script

This commit is contained in:
Pieter Vander Vennet 2020-09-17 19:06:32 +02:00
parent 1c31f83f37
commit a6cc01982f
2 changed files with 244 additions and 2 deletions

View file

@ -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!")
console.log("All done!");

202
wikiIndex Normal file
View file

@ -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 <b>ghost bike</b> 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
|
}}