forked from MapComplete/MapComplete
Docs: add 'used in layers'-information for builtingQuestions + various small refactorings
This commit is contained in:
parent
2545982dbd
commit
bc2ea7841f
9 changed files with 83 additions and 47 deletions
|
|
@ -439,15 +439,15 @@ export default class LayerConfig extends WithContextLoader {
|
|||
}
|
||||
|
||||
public generateDocumentation(
|
||||
usedInThemes: string[],
|
||||
layerIsNeededBy?: Map<string, string[]>,
|
||||
dependencies: {
|
||||
context?: string
|
||||
reason: string
|
||||
neededLayer: string
|
||||
}[] = [],
|
||||
addedByDefault = false,
|
||||
canBeIncluded = true
|
||||
{ usedInThemes = [], layerIsNeededBy, dependencies = [], addedByDefault = false, canBeIncluded = true, lang = "en", reusedTagRenderings }: {
|
||||
usedInThemes?: string[],
|
||||
layerIsNeededBy?: Map<string, string[]>,
|
||||
dependencies?: { context?: string; reason: string; neededLayer: string }[],
|
||||
addedByDefault?: boolean,
|
||||
canBeIncluded?: boolean,
|
||||
reusedTagRenderings?: Map<string, {layer: string}[]>,
|
||||
lang?: string
|
||||
}
|
||||
): string {
|
||||
const extraProps: string[] = []
|
||||
extraProps.push("This layer is shown at zoomlevel **" + this.minzoom + "** and higher")
|
||||
|
|
@ -669,7 +669,7 @@ export default class LayerConfig extends WithContextLoader {
|
|||
this.generateDocumentationQuickTable(),
|
||||
...this.tagRenderings
|
||||
.filter((tr) => tr.labels.indexOf("ignore_docs") < 0)
|
||||
.map((tr) => tr.GenerateDocumentation()),
|
||||
.map((tr) => tr.generateDocumentation(lang, reusedTagRenderings?.get(tr.id)?.map(l => l.layer))),
|
||||
...filterDocs,
|
||||
].join("\n\n")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue