Documentation Formatting

This commit is contained in:
pietervdvn 2021-10-29 03:59:28 +02:00
parent 219f477748
commit 28429df819
2 changed files with 16 additions and 7 deletions

View file

@ -42,7 +42,10 @@ removePostfixes | remove these snippets of text from the end of the passed strin
### Example usage
The following is the 'freeform'-part of a layer config which will trigger a search for the wikidata item corresponding with the name of the selected feature. It will also remove '-street', '-square', ... if found at the end of the name```"freeform": {
The following is the 'freeform'-part of a layer config which will trigger a search for the wikidata item corresponding with the name of the selected feature. It will also remove '-street', '-square', ... if found at the end of the name
```
"freeform": {
"key": "name:etymology:wikidata",
"type": "wikidata",
"helperArgs": [
@ -57,7 +60,8 @@ removePostfixes | remove these snippets of text from the end of the passed strin
]
}
]
},```
}
```
## int
@ -113,6 +117,7 @@ postfix | Piece of text that will always be added to the end of the generated op
To add a conditional (based on time) access restriction:
```
"freeform": {
"key": "access:conditional",
"type": "opening_hours",
@ -122,7 +127,7 @@ postfix | Piece of text that will always be added to the end of the generated op
"postfix":")"
}
]
},```
}```
*Don't forget to pass these in the rendering as well*: `{opening_hours_table(opening_hours,yes @ &LPARENS, &RPARENS )`

View file

@ -55,7 +55,10 @@ class WikidataTextField implements TextFieldDef {
)])
]]),
new Title("Example usage"),
"The following is the 'freeform'-part of a layer config which will trigger a search for the wikidata item corresponding with the name of the selected feature. It will also remove '-street', '-square', ... if found at the end of the name```" + `"freeform": {
`The following is the 'freeform'-part of a layer config which will trigger a search for the wikidata item corresponding with the name of the selected feature. It will also remove '-street', '-square', ... if found at the end of the name
\`\`\`
"freeform": {
"key": "name:etymology:wikidata",
"type": "wikidata",
"helperArgs": [
@ -70,7 +73,8 @@ class WikidataTextField implements TextFieldDef {
]
}
]
},` + "```"
}
\`\`\``
]).AsMarkdown()
@ -149,7 +153,7 @@ class OpeningHoursTextField implements TextFieldDef {
]
]),
new Title("Example usage"),
"To add a conditional (based on time) access restriction:\n\n```" + `
"To add a conditional (based on time) access restriction:\n\n```\n" + `
"freeform": {
"key": "access:conditional",
"type": "opening_hours",
@ -159,7 +163,7 @@ class OpeningHoursTextField implements TextFieldDef {
"postfix":")"
}
]
},` + "```\n\n*Don't forget to pass these in the rendering as well*: `{opening_hours_table(opening_hours,yes @ &LPARENS, &RPARENS )`"]).AsMarkdown()
}` + "```\n\n*Don't forget to pass these in the rendering as well*: `{opening_hours_table(opening_hours,yes @ &LPARENS, &RPARENS )`"]).AsMarkdown()
isValid() {