forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
a190597905
commit
087e639020
382 changed files with 29496 additions and 2675 deletions
|
|
@ -140,11 +140,14 @@ export class GenerateDocs extends Script {
|
|||
console.log("Starting documentation generation...")
|
||||
ScriptUtils.fixUtils()
|
||||
|
||||
this.WriteMarkdownFile("./Docs/SpecialRenderings.md", SpecialVisualizations.HelpMessage(), [
|
||||
"src/UI/SpecialVisualizations.ts",
|
||||
], {
|
||||
tocMaxDepth: 3
|
||||
})
|
||||
this.WriteMarkdownFile(
|
||||
"./Docs/SpecialRenderings.md",
|
||||
SpecialVisualizations.HelpMessage(),
|
||||
["src/UI/SpecialVisualizations.ts"],
|
||||
{
|
||||
tocMaxDepth: 3,
|
||||
}
|
||||
)
|
||||
|
||||
if (!existsSync("./Docs/Themes")) {
|
||||
mkdirSync("./Docs/Themes")
|
||||
|
|
@ -221,7 +224,7 @@ export class GenerateDocs extends Script {
|
|||
markdown: string,
|
||||
autogenSource: string[],
|
||||
options?: {
|
||||
noTableOfContents?: boolean,
|
||||
noTableOfContents?: boolean
|
||||
tocMaxDepth?: number
|
||||
}
|
||||
): void {
|
||||
|
|
@ -545,13 +548,21 @@ export class GenerateDocs extends Script {
|
|||
"# 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)"
|
||||
"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 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)))
|
||||
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()
|
||||
|
||||
function getHost(item: ServerSourceInfo) {
|
||||
|
|
@ -565,20 +576,24 @@ export class GenerateDocs extends Script {
|
|||
}
|
||||
|
||||
const categoryExplanation: Record<ServerSourceInfo["category"], string> = {
|
||||
core: ["Core features are always active and will be contacted as soon as you visit any map",
|
||||
core: [
|
||||
"Core features are always active and will be contacted as soon as you visit any map",
|
||||
"### About displayed images",
|
||||
"MapComplete will read the 'image' attribute from OpenStreetMap-data when a POI is opened and will attempt to display this image (and thus download it). Those 'images' can be spread all over the internet and thus leak the IP address of the visitor",
|
||||
].join("\n\n"),
|
||||
feature: "These are only enabled for certain maps or certain features",
|
||||
maplayer: ["MapLayers are integrated from the [Editor Layer Index](https://github.com/osmlab/editor-layer-index). A map layer listed here will only be contacted if the user decides to use this map background. This list changes over time, as new background layers are published and old background layers go offline. For all map layers, we have permission to use them to improve OpenStreetMap",
|
||||
maplayer: [
|
||||
"MapLayers are integrated from the [Editor Layer Index](https://github.com/osmlab/editor-layer-index). A map layer listed here will only be contacted if the user decides to use this map background. This list changes over time, as new background layers are published and old background layers go offline. For all map layers, we have permission to use them to improve OpenStreetMap",
|
||||
"A full listing can be found in [ELI-overview](ELI-overview.md)",
|
||||
].join("\n\n"),
|
||||
}
|
||||
|
||||
const seenUrls = new Set<string>()
|
||||
const seenUrls = new Set<string>()
|
||||
for (const title of titles) {
|
||||
md.push("## " + title)
|
||||
const items = serverInfos.filter(info => info.category.toLowerCase() === title.toLowerCase())
|
||||
const items = serverInfos.filter(
|
||||
(info) => info.category.toLowerCase() === title.toLowerCase()
|
||||
)
|
||||
md.push(items.length + " items")
|
||||
md.push(categoryExplanation[title])
|
||||
|
||||
|
|
@ -591,14 +606,16 @@ const seenUrls = new Set<string>()
|
|||
|
||||
for (const host of hosts) {
|
||||
md.push("### " + host)
|
||||
const itemsForHost = items.filter(info => getHost(info) === host)
|
||||
const identicalDescription = itemsForHost.every(item => item.description === itemsForHost[0].description)
|
||||
const itemsForHost = items.filter((info) => getHost(info) === host)
|
||||
const identicalDescription = itemsForHost.every(
|
||||
(item) => item.description === itemsForHost[0].description
|
||||
)
|
||||
if (identicalDescription) {
|
||||
md.push(itemsForHost[0].description)
|
||||
}
|
||||
const table = MarkdownUtils.table(
|
||||
["source", "description", "license;selfhosting;more info"],
|
||||
itemsForHost.map(item => {
|
||||
itemsForHost.map((item) => {
|
||||
let selfHostable = ""
|
||||
if (item.selfhostable) {
|
||||
if (typeof item.selfhostable === "string") {
|
||||
|
|
@ -619,7 +636,8 @@ const seenUrls = new Set<string>()
|
|||
return [
|
||||
item.url,
|
||||
identicalDescription ? "" : item.description,
|
||||
Utils.NoEmpty([(item.openData ? "OpenData" : ""),
|
||||
Utils.NoEmpty([
|
||||
item.openData ? "OpenData" : "",
|
||||
sourceAvailable,
|
||||
selfHostable,
|
||||
item.moreInfo?.join(" , "),
|
||||
|
|
@ -628,20 +646,25 @@ const seenUrls = new Set<string>()
|
|||
}),
|
||||
{
|
||||
dropEmptyColumns: true,
|
||||
},
|
||||
}
|
||||
)
|
||||
md.push(table)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
md.push("## No category")
|
||||
const urls: string[] = <string[]>sources.filter(s => typeof s === "string" && !seenUrls.has(s))
|
||||
const urls: string[] = <string[]>(
|
||||
sources.filter((s) => typeof s === "string" && !seenUrls.has(s))
|
||||
)
|
||||
md.push(urls.length + " items")
|
||||
md.push(MarkdownUtils.list(urls))
|
||||
|
||||
this.WriteMarkdownFile("./Docs/OnlineServicesOverview.md", md.join("\n\n"), ["src/Models/SourceOverview.ts"], { tocMaxDepth: 2 })
|
||||
this.WriteMarkdownFile(
|
||||
"./Docs/OnlineServicesOverview.md",
|
||||
md.join("\n\n"),
|
||||
["src/Models/SourceOverview.ts"],
|
||||
{ tocMaxDepth: 2 }
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue