forked from MapComplete/MapComplete
		
	Documentation update
This commit is contained in:
		
							parent
							
								
									2b02991780
								
							
						
					
					
						commit
						ac201afb40
					
				
					 4 changed files with 36 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -40,6 +40,13 @@ The surface area of the feature, in square meters and in hectare. Not set on poi
 | 
			
		|||
The total length of a feature in meters (and in kilometers, rounded to one decimal for '_length:km'). For a surface, the length of the perimeter
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Theme-defined keys 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
If 'units' is defined in the layoutConfig, then this metatagger will rewrite the specified keys to have the canonical form (e.g. `1meter` will be rewritten to `1m`)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### _country 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
 | 
			
		||||
### Special tag renderings 
 | 
			
		||||
 | 
			
		||||
 In a tagrendering, some special values are substituted by an advanced UI-element. This allows advanced features and visualizations to be reused by custom themes or even to query third-party API's. General usage is <b>{func_name()}</b> or <b>{func_name(arg, someotherarg)}</b>. Note that you <i>do not</i> need to use quotes around your arguments, the comma is enough to seperate them. This also implies you cannot use a comma in your args 
 | 
			
		||||
 In a tagrendering, some special values are substituted by an advanced UI-element. This allows advanced features and visualizations to be reused by custom themes or even to query third-party API's. General usage is `{func_name()}`, `{func_name(arg, someotherarg)}` or `{func_name(args):cssStyle}`. Note that you _do not_fcs need to use quotes around your arguments, the comma is enough to seperate them. This also implies you cannot use a comma in your args 
 | 
			
		||||
### all_tags 
 | 
			
		||||
 | 
			
		||||
 Prints all key-value pairs of the object - used for debugging 
 | 
			
		||||
| 
						 | 
				
			
			@ -36,6 +36,18 @@ image-key | image | Image tag to add the URL to (or image-tag:0, image-tag:1 whe
 | 
			
		|||
#### Example usage 
 | 
			
		||||
 | 
			
		||||
 {image_upload(image)} 
 | 
			
		||||
### minimap 
 | 
			
		||||
 | 
			
		||||
 A small map showing the selected feature. Note that no styling is applied, wrap this in a div 
 | 
			
		||||
 | 
			
		||||
name | default | description
 | 
			
		||||
------ | --------- | -------------
 | 
			
		||||
zoomlevel | 18 | The zoomlevel: the higher, the more zoomed in with 1 being the entire world and 19 being really close
 | 
			
		||||
idKey | id | (Matches all resting arguments) This argument should be the key of a property of the feature. The corresponding value is interpreted as either the id or the a list of ID's. The features with these ID's will be shown on this minimap.
 | 
			
		||||
 
 | 
			
		||||
#### Example usage 
 | 
			
		||||
 | 
			
		||||
 `{minimap()}`, `{minimap(17, id, _list_of_embedded_feature_ids_calculated_by_calculated_tag):height:10rem; border: 2px solid black}` 
 | 
			
		||||
### reviews 
 | 
			
		||||
 | 
			
		||||
 Adds an overview of the mangrove-reviews of this object. Mangrove.Reviews needs - in order to identify the reviewed object - a coordinate and a name. By default, the name of the object is given, but this can be overwritten 
 | 
			
		||||
| 
						 | 
				
			
			@ -81,7 +93,7 @@ name | default | description
 | 
			
		|||
key | undefined | The key to be read and to generate a histogram from
 | 
			
		||||
title |  | The text to put above the given values column
 | 
			
		||||
countHeader |  | The text to put above the counts
 | 
			
		||||
colors | undefined | (Matches all resting arguments - optional) Matches a regex onto a color value, e.g. `3[a-zA-Z+-]*:#33cc33`
 | 
			
		||||
colors* | undefined | (Matches all resting arguments - optional) Matches a regex onto a color value, e.g. `3[a-zA-Z+-]*:#33cc33`
 | 
			
		||||
 
 | 
			
		||||
#### Example usage 
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -96,4 +108,15 @@ url | undefined | The url to share (default: current URL)
 | 
			
		|||
 
 | 
			
		||||
#### Example usage 
 | 
			
		||||
 | 
			
		||||
 {share_link()} to share the current page, {share_link(<some_url>)} to share the given url Generated from UI/SpecialVisualisations.ts
 | 
			
		||||
 {share_link()} to share the current page, {share_link(<some_url>)} to share the given url 
 | 
			
		||||
### canonical 
 | 
			
		||||
 | 
			
		||||
 Converts a short, canonical value into the long, translated text 
 | 
			
		||||
 | 
			
		||||
name | default | description
 | 
			
		||||
------ | --------- | -------------
 | 
			
		||||
key | undefined | The key of the tag to give the canonical text for
 | 
			
		||||
 
 | 
			
		||||
#### Example usage 
 | 
			
		||||
 | 
			
		||||
 {canonical(length)} will give 42 metre (in french) Generated from UI/SpecialVisualisations.ts
 | 
			
		||||
| 
						 | 
				
			
			@ -79,7 +79,7 @@ export default class SimpleMetaTagger {
 | 
			
		|||
    private static canonicalize = new SimpleMetaTagger(
 | 
			
		||||
        {
 | 
			
		||||
            doc: "If 'units' is defined in the layoutConfig, then this metatagger will rewrite the specified keys to have the canonical form (e.g. `1meter` will be rewritten to `1m`)",
 | 
			
		||||
            keys: []
 | 
			
		||||
            keys: ["Theme-defined keys"],
 | 
			
		||||
 | 
			
		||||
        },
 | 
			
		||||
        (feature => {
 | 
			
		||||
| 
						 | 
				
			
			@ -405,7 +405,7 @@ export default class SimpleMetaTagger {
 | 
			
		|||
        this._f = f;
 | 
			
		||||
        this.includesDates = docs.includesDates ?? false;
 | 
			
		||||
        for (const key of docs.keys) {
 | 
			
		||||
            if (!key.startsWith('_')) {
 | 
			
		||||
            if (!key.startsWith('_') && key.toLowerCase().indexOf("theme") < 0) {
 | 
			
		||||
                throw `Incorrect metakey ${key}: it should start with underscore (_)`
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -392,7 +392,7 @@ export default class SpecialVisualizations {
 | 
			
		|||
        return new Combine([
 | 
			
		||||
                new Title("Special tag renderings", 3),
 | 
			
		||||
                "In a tagrendering, some special values are substituted by an advanced UI-element. This allows advanced features and visualizations to be reused by custom themes or even to query third-party API's.",
 | 
			
		||||
                "General usage is <b>{func_name()}</b>, <b>{func_name(arg, someotherarg)}</b> or <b>{func_name(args):cssStyle}</b>. Note that you <i>do not</i> need to use quotes around your arguments, the comma is enough to seperate them. This also implies you cannot use a comma in your args",
 | 
			
		||||
                "General usage is `{func_name()}`, `{func_name(arg, someotherarg)}` or `{func_name(args):cssStyle}`. Note that you _do not_fcs need to use quotes around your arguments, the comma is enough to seperate them. This also implies you cannot use a comma in your args",
 | 
			
		||||
                ...helpTexts
 | 
			
		||||
            ]
 | 
			
		||||
        );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue