Graciously handle multiple entries in wikidata for fetching images and showing articles, verious bug fixes

This commit is contained in:
Pieter Vander Vennet 2021-10-07 22:06:47 +02:00
parent 8d52ef1106
commit a996ba2a7c
14 changed files with 231 additions and 90 deletions

View file

@ -100,7 +100,16 @@ export default class SpecialVisualizations {
],
example: "`{wikipedia()}` is a basic example, `{wikipedia(name:etymology:wikidata)}` to show the wikipedia page of whom the feature was named after. Also remember that these can be styled, e.g. `{wikipedia():max-height: 10rem}` to limit the height",
constr: (_, tagsSource, args) =>
new WikipediaBox( tagsSource.map(tags => tags[args[0]]))
new VariableUiElement(
tagsSource.map(tags => tags[args[0]])
.map(wikidata => {
const wikidatas : string[] =
Utils.NoEmpty(wikidata?.split(";")?.map(wd => wd.trim()) ?? [])
return new WikipediaBox(wikidatas)
})
)
},
{
funcName: "minimap",