diff --git a/UI/QueryParameterDocumentation.ts b/UI/QueryParameterDocumentation.ts index 017ac5b77..8158dab7d 100644 --- a/UI/QueryParameterDocumentation.ts +++ b/UI/QueryParameterDocumentation.ts @@ -4,6 +4,8 @@ import Title from "./Base/Title"; import List from "./Base/List"; import Translations from "./i18n/Translations"; import {QueryParameters} from "../Logic/Web/QueryParameters"; +import FeatureSwitchState from "../Logic/State/FeatureSwitchState"; +import LayoutConfig from "../Models/ThemeConfig/LayoutConfig"; export default class QueryParameterDocumentation { @@ -24,6 +26,37 @@ export default class QueryParameterDocumentation { "Finally, the URL-hash is the part after the `#`. It is `node/1234` in this case." ]) + public static UrlParamDocs(): object{ + const dummyLayout = new LayoutConfig({ + id: ">theme<", + maintainer: "pietervdvn", + version: "0", + title: {en:""}, + description: "A theme to generate docs with", + socialImage: "./assets/SocialImage.png", + startLat: 0, + startLon: 0, + startZoom: 0, + icon: undefined, + layers: [ + { + name: "", + id: "<layer>", + source: { + osmTags: "id~*" + }, + mapRendering: null, + } + ] + + }) + + new FeatureSwitchState(dummyLayout) + + QueryParameters.GetQueryParameter("layer-<layer-id>", "true", "Wether or not the layer with id is shown") + return QueryParameters.documentation + } + public static GenerateQueryParameterDocs(): BaseUIElement { const docs: (string | BaseUIElement)[] = [...QueryParameterDocumentation.QueryParamDocsIntro]; for (const key in QueryParameters.documentation) { diff --git a/scripts/generateDocs.ts b/scripts/generateDocs.ts index de9a995c9..a4e03cc7f 100644 --- a/scripts/generateDocs.ts +++ b/scripts/generateDocs.ts @@ -128,34 +128,6 @@ Minimap.createMiniMap = _ => { } -const dummyLayout = new LayoutConfig({ - id: ">theme<", - maintainer: "pietervdvn", - version: "0", - title: {en:""}, - description: "A theme to generate docs with", - socialImage: "./assets/SocialImage.png", - startLat: 0, - startLon: 0, - startZoom: 0, - icon: undefined, - layers: [ - { - name: "", - id: "<layer>", - source: { - osmTags: "id~*" - }, - mapRendering: null, - } - ] - -}) - -new FeatureSwitchState(dummyLayout) - -QueryParameters.GetQueryParameter("layer-<layer-id>", "true", "Wether or not the layer with id is shown") - WriteFile("./Docs/URL_Parameters.md", QueryParameterDocumentation.GenerateQueryParameterDocs(), ["Logic/Web/QueryParameters.ts", "UI/QueryParameterDocumentation.ts"]) console.log("Generated docs")