forked from MapComplete/MapComplete
Docs: add source where URL-parameters are defined
This commit is contained in:
parent
bbccecae4b
commit
9dc3a239f6
4 changed files with 953 additions and 55 deletions
|
@ -4,6 +4,7 @@
|
|||
import { UIEventSource } from "../UIEventSource"
|
||||
import Hash from "./Hash"
|
||||
import { Utils } from "../../Utils"
|
||||
import doc = Mocha.reporters.doc
|
||||
|
||||
export class QueryParameters {
|
||||
static defaults: Record<string, string> = {}
|
||||
|
@ -21,6 +22,19 @@ export class QueryParameters {
|
|||
if (!this.initialized) {
|
||||
this.init()
|
||||
}
|
||||
|
||||
if (Utils.runningFromConsole) {
|
||||
const location = Utils.getLocationInCode(-1)
|
||||
|
||||
documentation +=
|
||||
"\n\nThis documentation is defined in the source code at [" +
|
||||
location.filename +
|
||||
"](" +
|
||||
location.markdownLocation +
|
||||
")" +
|
||||
"\n\n"
|
||||
}
|
||||
|
||||
QueryParameters.documentation.set(key, documentation)
|
||||
if (deflt !== undefined) {
|
||||
QueryParameters.defaults[key] = deflt
|
||||
|
@ -131,5 +145,4 @@ export class QueryParameters {
|
|||
QueryParameters._wasInitialized.clear()
|
||||
QueryParameters.order = []
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue