Add doc generation

This commit is contained in:
Pieter Vander Vennet 2021-03-24 02:01:04 +01:00
parent a13d282494
commit 0491b52642
7 changed files with 87 additions and 36 deletions

View file

@ -54,8 +54,8 @@ export default class LayerConfig {
tagRenderings: TagRenderingConfig [];
constructor(json: LayerConfigJson,
official: boolean= true,
context?: string) {
context?: string,
official: boolean = true,) {
context = context + "." + json.id;
const self = this;
this.id = json.id;
@ -92,7 +92,9 @@ export default class LayerConfig {
this.calculatedTags = undefined;
if (json.calculatedTags !== undefined) {
console.warn("Unofficial theme with custom javascript! This is a security risk")
if (!official) {
console.warn(`Unofficial theme ${this.id} with custom javascript! This is a security risk`)
}
this.calculatedTags = [];
for (const key in json.calculatedTags) {
this.calculatedTags.push([key, json.calculatedTags[key]])
@ -212,11 +214,11 @@ export default class LayerConfig {
}
public CustomCodeSnippets(): string[]{
if(this.calculatedTags === undefined){
public CustomCodeSnippets(): string[] {
if (this.calculatedTags === undefined) {
return []
}
return this.calculatedTags.map(code => code[1]);
}

View file

@ -106,7 +106,7 @@ export default class LayoutConfig {
}
// @ts-ignore
return new LayerConfig(layer, official,`${this.id}.layers[${i}]`)
return new LayerConfig(layer,`${this.id}.layers[${i}]`, official)
});
// ALl the layers are constructed, let them share tags in now!