Docs: finish creating the overview of all online services

This commit is contained in:
Pieter Vander Vennet 2025-06-29 22:42:28 +02:00
parent e9209f6b7c
commit 2361fe5e83
17 changed files with 177 additions and 94 deletions

View file

@ -543,10 +543,14 @@ export class GenerateDocs extends Script {
const sources = await new SourceOverview().getOverview()
const md = [
"# Overview of used online services",
"This document list all the hosts that MapComplete might contact via 'fetch'-requests for various API services. We do our best to use FLOSS- and/or self-hostable services as much as possible.",
"Some of the core services (especially Panoramax and MapLibre) could be selfhosted, but MapComplete has no support for a user to configure a different host. Right now, the userbase is relatively small and there is little demand to make this configurable, but the technical cost for this is quite high. Someone who wishes to use a different service, is able to build a fork.",
"One service that is hard to replace, is [*Mapillary*](https://wiki.openstreetmap.org/wiki/Mapillary). It contains a vast trove of streetview data, but cannot be selfhosted and is currently owned by Meta Inc. We use this to find nearby images of features, but promote the use of [Panoramax](https://wiki.openstreetmap.org/wiki/Panoramax) instead (both by uploading contributions to our panoramax-instance and by lobbying in the community for this)"
]
const serverInfos = <ServerSourceInfo[]>sources.filter(s => typeof s !== "string")
const serverInfosDupl = <ServerSourceInfo[]>sources.filter(s => typeof s !== "string")
.filter(item => typeof item === "string" || item.url.startsWith("https://") || item.url.startsWith("pmtiles://"))
const serverInfos = Utils.DedupOnId(serverInfosDupl, item => item.url)
const titles = Utils.Dedup(Utils.NoEmpty(serverInfos.map(s => s.category)))
titles.sort()
@ -571,6 +575,7 @@ export class GenerateDocs extends Script {
].join("\n\n"),
}
const seenUrls = new Set<string>()
for (const title of titles) {
md.push("## " + title)
const items = serverInfos.filter(info => info.category.toLowerCase() === title.toLowerCase())
@ -610,6 +615,7 @@ export class GenerateDocs extends Script {
sourceAvailable = "source available"
}
}
seenUrls.add(item.url)
return [
item.url,
identicalDescription ? "" : item.description,
@ -631,7 +637,7 @@ export class GenerateDocs extends Script {
}
md.push("## No category")
const urls: string[] = <string[]>sources.filter(s => typeof s === "string")
const urls: string[] = <string[]>sources.filter(s => typeof s === "string" && !seenUrls.has(s))
md.push(urls.length + " items")
md.push(MarkdownUtils.list(urls))