2023-07-17 22:04:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  BaseUIElement  from  "../src/UI/BaseUIElement"  
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  existsSync ,  mkdirSync ,  readFileSync ,  writeFileSync  }  from  "fs"  
						 
					
						
							
								
									
										
										
										
											2023-07-17 22:04:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  AllKnownLayouts  }  from  "../src/Customizations/AllKnownLayouts"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  SimpleMetaTaggers  from  "../src/Logic/SimpleMetaTagger"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  SpecialVisualizations  from  "../src/UI/SpecialVisualizations"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  {  ExtraFunctions  }  from  "../src/Logic/ExtraFunctions"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  QueryParameterDocumentation  from  "../src/UI/QueryParameterDocumentation"  
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  ScriptUtils  from  "./ScriptUtils"  
						 
					
						
							
								
									
										
										
										
											2023-07-17 22:04:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  Translations  from  "../src/UI/i18n/Translations"  
						 
					
						
							
								
									
										
										
										
											2023-07-20 13:28:38 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  themeOverview  from  "../src/assets/generated/theme_overview.json"  
						 
					
						
							
								
									
										
										
										
											2024-10-17 04:06:03 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  ThemeConfig  from  "../src/Models/ThemeConfig/ThemeConfig"  
						 
					
						
							
								
									
										
										
										
											2025-01-11 01:18:56 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  bookcases  from  "../public/assets/generated/themes/bookcases.json"  
						 
					
						
							
								
									
										
										
										
											2023-02-08 01:14:21 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  fakedom  from  "fake-dom"  
						 
					
						
							
								
									
										
										
										
											2025-05-04 03:01:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  unit  from  "../public/assets/generated/layers/unit.json"  
						 
					
						
							
								
									
										
										
										
											2023-07-17 22:04:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  Hotkeys  from  "../src/UI/Base/Hotkeys"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  {  QueryParameters  }  from  "../src/Logic/Web/QueryParameters"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  Constants  from  "../src/Models/Constants"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  LayerConfig  from  "../src/Models/ThemeConfig/LayerConfig"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  DependencyCalculator  from  "../src/Models/ThemeConfig/DependencyCalculator"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  {  AllSharedLayers  }  from  "../src/Customizations/AllSharedLayers"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  ThemeViewState  from  "../src/Models/ThemeViewState"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  Validators  from  "../src/UI/InputElement/Validators"  
						 
					
						
							
								
									
										
										
										
											2025-05-04 03:01:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  questions  from  "../public/assets/generated/layers/questions.json"  
						 
					
						
							
								
									
										
										
										
											2023-07-20 13:28:38 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  LayerConfigJson  }  from  "../src/Models/ThemeConfig/Json/LayerConfigJson"  
						 
					
						
							
								
									
										
										
										
											2023-07-28 00:29:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  Utils  }  from  "../src/Utils"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  {  TagUtils  }  from  "../src/Logic/Tags/TagUtils"  
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  Script  from  "./Script"  
						 
					
						
							
								
									
										
										
										
											2024-03-13 00:01:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  Changes  }  from  "../src/Logic/Osm/Changes"  
						 
					
						
							
								
									
										
										
										
											2024-04-28 03:48:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  TableOfContents  from  "../src/UI/Base/TableOfContents"  
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  MarkdownUtils  from  "../src/Utils/MarkdownUtils"  
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  parse  as  parse_html  }  from  "node-html-parser"  
						 
					
						
							
								
									
										
										
										
											2024-08-25 01:43:08 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  AvailableRasterLayers  }  from  "../src/Models/RasterLayers"  
						 
					
						
							
								
									
										
										
										
											2025-01-28 15:42:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  ImmutableStore  }  from  "../src/Logic/UIEventSource"  
						 
					
						
							
								
									
										
										
										
											2025-04-08 02:48:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  *  as  unitUsage  from  "../Docs/Schemas/UnitConfigJson.schema.json"  
						 
					
						
							
								
									
										
										
										
											2025-05-04 03:01:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  ThemeConfigJson  }  from  "../src/Models/ThemeConfig/Json/ThemeConfigJson"  
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/ * *  
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Converts  a  markdown - file  into  a  . json  file ,  which  a  walkthrough / slideshow  element  can  use 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  These  are  used  in  the  studio 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 * / 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  ToSlideshowJson  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  readonly  _source : string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  readonly  _target : string 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    constructor ( source : string ,  target : string )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . _source  =  source 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . _target  =  target 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  convert() { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  lines  =  readFileSync ( this . _source ,  "utf8" ) . split ( "\n" ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  sections : string [ ] [ ]  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        let  currentSection : string [ ]  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( let  line  of  lines )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( line . trim ( ) . startsWith ( "# " ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                sections . push ( currentSection ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                currentSection  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            line  =  line . replace ( 'src="../../public/' ,  'src="./' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            line  =  line . replace ( 'src="../../' ,  'src="./' ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            currentSection . push ( line ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        sections . push ( currentSection ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        writeFileSync ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . _target , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            JSON . stringify ( { 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                sections : sections.map ( ( s )  = >  s . join ( "\n" ) ) . filter ( ( s )  = >  s . length  >  0 ) , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/ * *  
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Generates  a  wiki  page  with  the  theme  overview 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  The  wikitable  should  be  updated  regularly  as  some  tools  show  an  overview  of  apps  based  on  the  wiki . 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 * / 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  WikiPageGenerator  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  readonly  _target : string 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    constructor ( target : string  =  "Docs/wikiIndex.txt" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . _target  =  target 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    generate() { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        let  wikiPage  = 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            '{|class="wikitable sortable"\n'  + 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "! Name, link !! Genre !! Covered region !! Language !! Description !! Free materials !! Image\n"  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "|-" 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-10-01 16:47:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  ( const  layout  of  themeOverview . themes )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( layout . hideFromOverview )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            wikiPage  +=  "\n"  +  this . generateWikiEntryFor ( layout ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        wikiPage  +=  "\n|}" 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        writeFileSync ( this . _target ,  wikiPage ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-02 05:20:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    private  generateWikiEntryFor ( layout :  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-02 13:47:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        hideFromOverview : boolean 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        id : string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        shortDescription : any 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } ) :  string  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( layout . hideFromOverview )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-02 13:47:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  "" 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-01-11 01:32:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  languagesInDescr  =  Array . from ( Object . keys ( layout . shortDescription ) ) . filter ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ( k )  = >  k  !==  "_context" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-02 13:47:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  languages  =  languagesInDescr . map ( ( ln )  = >  ` {{#language: ${ ln } |en}} ` ) . join ( ", " ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  auth  =  "Yes" 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  ` {{service_item
 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-23 18:33:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								| name =  [ https : //mapcomplete.org/${layout.id} ${layout.id}]
  
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								| region =  Worldwide  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| lang =  $ { languages }  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| descr =  A  MapComplete  theme : $ { Translations . T ( layout . shortDescription )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . textFor ( "en" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            . replace ( "<a href='" ,  "[[" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-02 13:47:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . replace ( /'>.*<\/a>/ ,  "]]" ) } 
							 
						 
					
						
							
								
									
										
										
										
											2023-08-23 18:33:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								| material =  { { yes | [ https : //mapcomplete.org/ ${auth}]}}
  
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								| image =  MapComplete_Screenshot . png  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								| genre =  POI ,  editor ,  $ { layout . id }  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								} } ` 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  class  GenerateDocs  extends  Script  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    constructor ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        super ( "Generates various documentation files" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    async  main ( args : string [ ] )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        console . log ( "Starting documentation generation..." ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ScriptUtils . fixUtils ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-29 20:37:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( "./Docs/SpecialRenderings.md" ,  SpecialVisualizations . HelpMessage ( ) ,  [ 
							 
						 
					
						
							
								
									
										
										
										
											2025-02-10 02:04:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "src/UI/SpecialVisualizations.ts" , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-29 20:37:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( ! existsSync ( "./Docs/Themes" ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            mkdirSync ( "./Docs/Themes" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( "./Docs/Tags_format.md" ,  TagUtils . generateDocs ( ) ,  [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "src/Logic/Tags/TagUtils.ts" , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        new  ToSlideshowJson ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "./Docs/Studio/Introduction.md" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "./src/assets/studio_introduction.json" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) . convert ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        new  ToSlideshowJson ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "./Docs/Studio/TagRenderingIntro.md" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "./src/assets/studio_tagrenderings_intro.json" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) . convert ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . generateHotkeyDocs ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . generateBuiltinIndex ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . generateQueryParameterDocs ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . generateBuiltinQuestions ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . generateOverviewsForAllSingleLayer ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . generateLayerOverviewText ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . generateBuiltinUnits ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        Array . from ( AllKnownLayouts . allKnownLayouts . values ( ) ) . map ( ( theme )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . generateForTheme ( theme ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ScriptUtils . erasableLog ( "Written docs for theme" ,  theme . id ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "./Docs/CalculatedTags.md" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            [ "# Metatags" ,  SimpleMetaTaggers . HelpText ( ) ,  ExtraFunctions . HelpText ( ) ] . join ( "\n" ) , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-29 20:37:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            [ "src/Logic/SimpleMetaTagger.ts" ,  "src/Logic/ExtraFunctions.ts" ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            {  noTableOfContents : false  } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( "./Docs/SpecialInputElements.md" ,  Validators . HelpText ( ) ,  [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "src/UI/InputElement/Validators.ts" , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( "./Docs/ChangesetMeta.md" ,  Changes . getDocs ( ) ,  [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-03-13 00:01:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "src/Logic/Osm/Changes.ts" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "src/Logic/Osm/ChangesetHandler.ts" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-03-13 00:01:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-25 01:43:08 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  eli  =  await  AvailableRasterLayers . editorLayerIndex ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "./Docs/ELI-overview.md" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-25 01:43:08 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                "# Layers in the Editor Layer Index" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                "This table gives a summary of ids, names and other metainformation. [See the online, interactive map here](https://osmlab.github.io/editor-layer-index/) or [visit the repository](https://github.com/osmlab/editor-layer-index)" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                MarkdownUtils . table ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    [ "id" ,  "name" ,  "category" ,  "Best" ,  "attribution" ] , 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    eli . map ( ( f )  = >  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        f . properties . id , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        f . properties . name , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        f . properties . category , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        f . properties . best  ?  "⭐"  :  "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        f . properties . attribution ? . html  ? ?  f . properties . attribution ? . text , 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-25 01:43:08 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] . join ( "\n\n" ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ "./public/assets/data/editor-layer-index.json" ] 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-25 01:43:08 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        new  WikiPageGenerator ( ) . generate ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        console . log ( "Generated docs" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-28 03:48:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    private  WriteMarkdownFile ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        filename : string , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        markdown : string , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        autogenSource : string [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        options ? :  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-29 20:37:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            noTableOfContents? : boolean 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-28 03:48:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) :  void  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  ( const  source  of  autogenSource )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( source . indexOf ( "*" )  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( ! existsSync ( source ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                throw  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    "While creating a documentation file and checking that the generation sources are properly linked: source file "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    source  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " was not found. Typo?" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-27 22:03:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-28 03:48:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        let  md  =  markdown 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( options ? . noTableOfContents  !==  false )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-16 16:06:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            md  =  TableOfContents . insertTocIntoMd ( md ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-28 03:48:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-25 01:47:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        md  =  md . replace ( /\n\n\n+/g ,  "\n\n" ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( ! md . endsWith ( "\n" ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            md  +=  "\n" 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-24 21:41:04 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  warnAutomated  = 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-28 03:48:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "[//]: # (WARNING: this file is automatically generated. Please find the sources at the bottom and edit those sources)\n\n" 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-07 18:51:50 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  generatedFrom  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "This document is autogenerated from" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            autogenSource 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-28 15:42:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                . map ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ( s )  = > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        ` [ ${ s } ](https://source.mapcomplete.org/MapComplete/MapComplete/src/branch/develop/ ${ s } ) ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                . join ( ", " ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] . join ( " " ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        writeFileSync ( filename ,  warnAutomated  +  md  +  "\n\n"  +  generatedFrom  +  "\n" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-06 16:12:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  generateHotkeyDocs() { 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-04 03:01:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        new  ThemeViewState ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            new  ThemeConfig ( < ThemeConfigJson > ( < unknown > bookcases ) ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            new  ImmutableStore ( new  Set ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( "./Docs/Hotkeys.md" ,  Hotkeys . generateDocumentation ( ) ,  [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "src/UI/Base/Hotkeys.ts" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-06 16:12:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-30 21:38:50 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    private  generateBuiltinUnits() { 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-04 03:01:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  layer  =  new  LayerConfig ( < LayerConfigJson > ( < unknown > unit ) ,  "units" ,  true ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-08 02:48:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  els : string [ ]  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "# Units" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "## How to use" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            unitUsage . description , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "Units " , 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-15 18:18:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "## "  +  layer . id , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  ( const  unit  of  layer . units )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            els . push ( "### "  +  unit . quantity ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-20 00:34:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            const  defaultUnit  =  unit . getDefaultDenomination ( ( )  = >  undefined ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            for  ( const  denomination  of  unit . denominations )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                els . push ( "#### "  +  denomination . canonical ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-20 00:34:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( denomination . validator )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    els . push ( ` Validator is * ${ denomination . validator . name } * ` ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( denomination . factorToCanonical )  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-04 00:21:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    els . push ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        ` 1 ${ denomination . canonical }  =  ${ denomination . factorToCanonical } ${ defaultUnit . canonical } ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-20 00:34:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( denomination . useIfNoUnitGiven  ===  true )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    els . push ( "*Default denomination*" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                }  else  if  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    denomination . useIfNoUnitGiven  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    denomination . useIfNoUnitGiven . length  >  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    els . push ( "Default denomination in the following countries:" ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    els . push ( MarkdownUtils . list ( denomination . useIfNoUnitGiven ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( denomination . prefix )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    els . push ( "Prefixed" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( denomination . alternativeDenominations . length  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    els . push ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        "Alternative denominations:" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        MarkdownUtils . list ( denomination . alternativeDenominations ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-04-08 02:48:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( "./Docs/builtin_units.md" ,  els . join ( "\n\n" ) ,  [ 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-15 18:18:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ` assets/layers/unit/unit.json ` , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ` src/Models/ThemeConfig/Json/UnitConfigJson.ts ` , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-15 03:15:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    / * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  Generates  documentation  for  the  all  the  individual  layers . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  Inline  layers  are  included  ( if  the  theme  is  public ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  generateOverviewsForAllSingleLayer ( ) :  void  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  allLayers : LayerConfig [ ]  =  Array . from ( AllSharedLayers . sharedLayers . values ( ) ) . filter ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ( layer )  = >  layer [ "source" ]  !==  null 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  builtinLayerIds : Set < string >  =  new  Set < string > ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        allLayers . forEach ( ( l )  = >  builtinLayerIds . add ( l . id ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  inlineLayers  =  new  Map < string ,  string > ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  layout  of  Array . from ( AllKnownLayouts . allKnownLayouts . values ( ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( layout . hideFromOverview )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  layer  of  layout . layers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( layer . source  ===  null )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( builtinLayerIds . has ( layer . id ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( layer . source . geojsonSource  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // Not an OSM-source
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                allLayers . push ( layer ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                builtinLayerIds . add ( layer . id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                inlineLayers . set ( layer . id ,  layout . id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-29 02:45:59 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  themesPerLayer  =  new  Map < string ,  string [ ] > ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  layout  of  Array . from ( AllKnownLayouts . allKnownLayouts . values ( ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  layer  of  layout . layers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( ! builtinLayerIds . has ( layer . id ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // This is an inline layer
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( ! themesPerLayer . has ( layer . id ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    themesPerLayer . set ( layer . id ,  [ ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-29 02:45:59 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                themesPerLayer . get ( layer . id ) . push ( layout . id ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-29 02:45:59 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Determine the cross-dependencies
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  layerIsNeededBy : Map < string ,  string [ ] >  =  new  Map < string ,  string [ ] > ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  layer  of  allLayers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  dep  of  DependencyCalculator . getLayerDependencies ( layer ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  dependency  =  dep . neededLayer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( ! layerIsNeededBy . has ( dependency ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    layerIsNeededBy . set ( dependency ,  [ ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                layerIsNeededBy . get ( dependency ) . push ( layer . id ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-29 02:45:59 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        allLayers . forEach ( ( layer )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-02-10 02:13:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            const  element  =  layer . generateDocumentation ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-13 02:39:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    usedInThemes : themesPerLayer.get ( layer . id ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    layerIsNeededBy : layerIsNeededBy , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    dependencies : DependencyCalculator.getLayerDependencies ( layer ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  inlineSource  =  inlineLayers . get ( layer . id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ScriptUtils . erasableLog ( "Exporting layer documentation for" ,  layer . id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( ! existsSync ( "./Docs/Layers" ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                mkdirSync ( "./Docs/Layers" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            let  source : string  =  ` assets/layers/ ${ layer . id } / ${ layer . id } .json ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( inlineSource  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                source  =  ` assets/themes/ ${ inlineSource } / ${ inlineSource } .json ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . WriteMarkdownFile ( "./Docs/Layers/"  +  layer . id  +  ".md" ,  element ,  [ source ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-29 02:45:59 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    / * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *   Generate  the  builtinIndex  which  shows  interlayer  dependencies 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  @private 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  generateBuiltinIndex() { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  layers  =  ScriptUtils . getLayerFiles ( ) . map ( ( f )  = >  f . parsed ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  builtinsPerLayer  =  new  Map < string ,  string [ ] > ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  layersUsingBuiltin  =  new  Map < string  /* Builtin */ ,  string [ ] > ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  layer  of  layers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( layer . tagRenderings  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  usedBuiltins : string [ ]  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  tagRendering  of  layer . tagRenderings )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( typeof  tagRendering  ===  "string" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    usedBuiltins . push ( tagRendering ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( tagRendering [ "builtin" ]  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  builtins  =  tagRendering [ "builtin" ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( typeof  builtins  ===  "string" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        usedBuiltins . push ( builtins ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        usedBuiltins . push ( . . . builtins ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  usedBuiltin  of  usedBuiltins )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  usingLayers  =  layersUsingBuiltin . get ( usedBuiltin ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( usingLayers  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    layersUsingBuiltin . set ( usedBuiltin ,  [ layer . id ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    usingLayers . push ( layer . id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            builtinsPerLayer . set ( layer . id ,  usedBuiltins ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-16 16:06:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        let  docs  =  ` 
 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-28 03:48:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            #  Index  of  builtin  TagRenderings 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # #  Existing  builtin  tagrenderings 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ` 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  [ builtin ,  usedByLayers ]  of  Array . from ( layersUsingBuiltin . entries ( ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            docs  +=  ` 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # # #  $ { builtin } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-16 16:06:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            $ { usedByLayers . map ( ( item )  = >  " - "  +  item ) . join ( "\n" ) } 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-28 03:48:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ` 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( "./Docs/BuiltinIndex.md" ,  docs ,  [ "assets/layers/*.json" ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  generateQueryParameterDocs() { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( fakedom  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            throw  "FakeDom not initialized" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        QueryParameters . GetQueryParameter ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "mode" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "map" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "The mode the application starts in, e.g. 'map', 'dashboard' or 'statistics'" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "./Docs/URL_Parameters.md" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            QueryParameterDocumentation . GenerateQueryParameterDocs ( ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ "src/Logic/Web/QueryParameters.ts" ,  "src/UI/QueryParameterDocumentation.ts" ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  generateBuiltinQuestions() { 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-04 03:01:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  qLayer  =  new  LayerConfig ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            < LayerConfigJson > ( < unknown > questions ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "questions.json" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-13 02:39:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  reusedTagRenderings  =  DependencyCalculator . tagRenderingImportedBy ( qLayer ,  Array . from ( AllSharedLayers . sharedLayers . values ( ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  docs  =  qLayer . generateDocumentation ( {  reusedTagRenderings  } ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "./Docs/BuiltinQuestions.md" , 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-13 02:39:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            docs , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            [ "assets/layers/questions/questions.json" ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-10-17 04:06:03 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    private  generateForTheme ( theme : ThemeConfig ) :  void  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-13 02:39:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  allLayers  =  AllSharedLayers . sharedLayers 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  layersToShow  =  theme . layers . filter ( 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ( l )  = >  l . id  !==  "favourite"  &&  Constants . added_by_default . indexOf ( < any > l . id )  <  0 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  layersToInline  =  layersToShow . filter ( ( l )  = >  ! allLayers . has ( l . id ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  el  =  [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                "##" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                theme . title , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                "(" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ` [ ${ theme . id } ](https://mapcomplete.org/ ${ theme . id } ) ` , 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ")" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ] . join ( " " ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "_This document details some technical information about this MapComplete theme, mostly about the attributes used in the theme. Various links point toward more information about the attributes, e.g. to the OpenStreetMap-wiki, to TagInfo or tools creating statistics_" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "The theme introduction reads:\n" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "> "  +  parse_html ( theme . description . textFor ( "en" ) ) . textContent . replace ( /\n/g ,  "  " ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "" , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "This theme contains the following layers:" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            MarkdownUtils . list ( 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                layersToShow . map ( ( l )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( allLayers . has ( l . id ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        return  ` [ ${ l . id } ](../Layers/ ${ l . id } .md) ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  ` [ ${ l . id }  (defined in this theme)](# ${ l . id . trim ( ) . replace ( / /g ,  "-" ) } ) ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "Available languages:" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            MarkdownUtils . list ( theme . language . filter ( ( ln )  = >  ln  !==  "_context" ) ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "# Layers defined in this theme configuration file" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "These layers can not be reused in different themes." , 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-13 02:39:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . . . layersToInline . map ( ( l )  = >  l . generateDocumentation ( {  usedInThemes : null  } ) ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] . join ( "\n" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "./Docs/Themes/"  +  theme . id  +  ".md" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            el , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ ` assets/themes/ ${ theme . id } / ${ theme . id } .json ` ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            {  noTableOfContents : true  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    / * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  Generates  the  documentation  for  the  layers  overview  page 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  @constructor 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  generateLayerOverviewText ( ) :  BaseUIElement  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  id  of  Constants . priviliged_layers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( ! AllSharedLayers . sharedLayers . has ( id ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                console . error ( "Priviliged layer definition not found: "  +  id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                return  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  allLayers : LayerConfig [ ]  =  Array . from ( AllSharedLayers . sharedLayers . values ( ) ) . filter ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ( layer )  = >  layer [ "source" ]  ===  null 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  builtinLayerIds : Set < string >  =  new  Set < string > ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        allLayers . forEach ( ( l )  = >  builtinLayerIds . add ( l . id ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  themesPerLayer  =  new  Map < string ,  string [ ] > ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  layout  of  Array . from ( AllKnownLayouts . allKnownLayouts . values ( ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  layer  of  layout . layers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( ! builtinLayerIds . has ( layer . id ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( ! themesPerLayer . has ( layer . id ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    themesPerLayer . set ( layer . id ,  [ ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                themesPerLayer . get ( layer . id ) . push ( layout . id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Determine the cross-dependencies
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  layerIsNeededBy : Map < string ,  string [ ] >  =  new  Map < string ,  string [ ] > ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  layer  of  allLayers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  dep  of  DependencyCalculator . getLayerDependencies ( layer ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  dependency  =  dep . neededLayer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( ! layerIsNeededBy . has ( dependency ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    layerIsNeededBy . set ( dependency ,  [ ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                layerIsNeededBy . get ( dependency ) . push ( layer . id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  el  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "# Special and other useful layers" , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "MapComplete has a few data layers available in the theme which have special properties through builtin-hooks. Furthermore, there are some normal layers (which are built from normal Theme-config files) but are so general that they get a mention here." , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "# Priviliged layers" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            MarkdownUtils . list ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                Constants . priviliged_layers . map ( ( id )  = >  "["  +  id  +  "](#"  +  id  +  ")" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ) , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . . . Utils . NoNull ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                Constants . priviliged_layers . map ( ( id )  = >  AllSharedLayers . sharedLayers . get ( id ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ) . map ( ( l )  = > 
							 
						 
					
						
							
								
									
										
										
										
											2025-02-10 02:13:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                l . generateDocumentation ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-13 02:39:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        usedInThemes : themesPerLayer.get ( l . id ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        layerIsNeededBy : layerIsNeededBy , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        dependencies : DependencyCalculator.getLayerDependencies ( l ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        addedByDefault : Constants.added_by_default.indexOf ( < any > l . id )  >=  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        canBeIncluded : Constants.no_include.indexOf ( < any > l . id )  <  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "# Normal layers" , 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "The following layers are included in MapComplete:" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            MarkdownUtils . list ( 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                Array . from ( AllSharedLayers . sharedLayers . keys ( ) ) . map ( 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ( id )  = >  ` [ ${ id } ](./Layers/ ${ id } .md) ` 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] . join ( "\n\n" ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . WriteMarkdownFile ( "./Docs/BuiltinLayers.md" ,  el ,  [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-02 12:48:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "src/Customizations/AllKnownLayouts.ts" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-15 03:15:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2023-10-24 21:41:04 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-12 03:46:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								new  GenerateDocs ( ) . run ( )