forked from MapComplete/MapComplete
		
	Improve documentation
This commit is contained in:
		
							parent
							
								
									c4712f6cc1
								
							
						
					
					
						commit
						c610cfc6e8
					
				
					 3 changed files with 17 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -14,6 +14,9 @@ export class FixedUiElement extends BaseUIElement {
 | 
			
		|||
 | 
			
		||||
    AsMarkdown(): string {
 | 
			
		||||
        if (this.HasClass("code")) {
 | 
			
		||||
            if (this.content.indexOf("\n") > 0 || this.HasClass("block")) {
 | 
			
		||||
                return "\n```\n" + this.content + "\n```\n"
 | 
			
		||||
            }
 | 
			
		||||
            return "`" + this.content + "`"
 | 
			
		||||
        }
 | 
			
		||||
        if (this.HasClass("font-bold")) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -644,7 +644,7 @@ export class ImportPointButton extends AbstractImportButton {
 | 
			
		|||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    name: "maproulette_id",
 | 
			
		||||
                    doc: "If given, the maproulette challenge will be marked as fixed",
 | 
			
		||||
                    doc: "The property name of the maproulette_id - this is probably `mr_taskId`. If given, the maproulette challenge will be marked as fixed. Only use this if part of a maproulette-layer.",
 | 
			
		||||
                },
 | 
			
		||||
            ],
 | 
			
		||||
            { showRemovedTags: false }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,6 @@ import WikipediaBox from "./Wikipedia/WikipediaBox"
 | 
			
		|||
import Wikidata, { WikidataResponse } from "../Logic/Web/Wikidata"
 | 
			
		||||
import { Translation } from "./i18n/Translation"
 | 
			
		||||
import Translations from "./i18n/Translations"
 | 
			
		||||
import MangroveReviews from "../Logic/Web/MangroveReviews"
 | 
			
		||||
import ReviewForm from "./Reviews/ReviewForm"
 | 
			
		||||
import ReviewElement from "./Reviews/ReviewElement"
 | 
			
		||||
import OpeningHoursVisualization from "./OpeningHours/OpeningHoursVisualization"
 | 
			
		||||
| 
						 | 
				
			
			@ -480,6 +479,10 @@ export default class SpecialVisualizations {
 | 
			
		|||
                args: [],
 | 
			
		||||
                constr(state, tagSource, argument, guistate) {
 | 
			
		||||
                    let parentId = tagSource.data.mr_challengeId
 | 
			
		||||
                    if (parentId === undefined) {
 | 
			
		||||
                        console.warn("Element ", tagSource.data.id, " has no mr_challengeId")
 | 
			
		||||
                        return undefined
 | 
			
		||||
                    }
 | 
			
		||||
                    let challenge = Stores.FromPromise(
 | 
			
		||||
                        Utils.downloadJsonCached(
 | 
			
		||||
                            `https://maproulette.org/api/v2/challenge/${parentId}`,
 | 
			
		||||
| 
						 | 
				
			
			@ -512,7 +515,7 @@ export default class SpecialVisualizations {
 | 
			
		|||
                        })
 | 
			
		||||
                    )
 | 
			
		||||
                },
 | 
			
		||||
                docs: "Show details of a MapRoulette task",
 | 
			
		||||
                docs: "Fetches the metadata of MapRoulette campaign that this task is part of and shows those details (namely `title`, `description` and `instruction`).\n\nThis reads the property `mr_challengeId` to detect the parent campaign.",
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                funcName: "statistics",
 | 
			
		||||
| 
						 | 
				
			
			@ -725,13 +728,6 @@ export default class SpecialVisualizations {
 | 
			
		|||
                            render: {
 | 
			
		||||
                                special: {
 | 
			
		||||
                                    type: "some_special_visualisation",
 | 
			
		||||
                                    before: {
 | 
			
		||||
                                        en: "Some text to prefix before the special element (e.g. a title)",
 | 
			
		||||
                                        nl: "Een tekst om voor het element te zetten (bv. een titel)",
 | 
			
		||||
                                    },
 | 
			
		||||
                                    after: {
 | 
			
		||||
                                        en: "Some text to put after the element, e.g. a footer",
 | 
			
		||||
                                    },
 | 
			
		||||
                                    argname: "some_arg",
 | 
			
		||||
                                    message: {
 | 
			
		||||
                                        en: "some other really long message",
 | 
			
		||||
| 
						 | 
				
			
			@ -739,12 +735,20 @@ export default class SpecialVisualizations {
 | 
			
		|||
                                    },
 | 
			
		||||
                                    other_arg_name: "more args",
 | 
			
		||||
                                },
 | 
			
		||||
                                before: {
 | 
			
		||||
                                    en: "Some text to prefix before the special element (e.g. a title)",
 | 
			
		||||
                                    nl: "Een tekst om voor het element te zetten (bv. een titel)",
 | 
			
		||||
                                },
 | 
			
		||||
                                after: {
 | 
			
		||||
                                    en: "Some text to put after the element, e.g. a footer",
 | 
			
		||||
                                },
 | 
			
		||||
                            },
 | 
			
		||||
                        },
 | 
			
		||||
                        null,
 | 
			
		||||
                        "  "
 | 
			
		||||
                    )
 | 
			
		||||
                ).SetClass("code"),
 | 
			
		||||
                'In other words: use `{ "before": ..., "after": ..., "special": {"type": ..., "argname": ...argvalue...}`. The args are in the `special` block; an argvalue can be a string, a translation or another value. (Refer to class `RewriteSpecial` in case of problems)',
 | 
			
		||||
            ]).SetClass("flex flex-col"),
 | 
			
		||||
            ...helpTexts,
 | 
			
		||||
        ]).SetClass("flex flex-col")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue