Skip to content

Commit dba4c4f

Browse files
improve docs
1 parent 2c64ac7 commit dba4c4f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

build/generate-docs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type JsonSdkSupport = {
2020
type JsonObject = {
2121
required?: boolean;
2222
units?: string;
23-
default?: string | number | boolean;
23+
default?: string | number | boolean | {};
2424
type: string;
2525
doc: string;
2626
requires?: any[];
@@ -227,7 +227,7 @@ function convertPropertyToMarkdown(key: string, value: JsonObject, keyPrefix = '
227227
markdown += `Units in ${value.units}. `;
228228
}
229229
if (value.default !== undefined) {
230-
markdown += `Defaults to \`${value.default}\`. `;
230+
markdown += `Defaults to \`${JSON.stringify(value.default)}\`. `;
231231
}
232232
if (value.requires) {
233233
markdown += requiresToMarkdown(value.requires);

src/reference/v8.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"state": {
101101
"type": "*",
102102
"default": {},
103-
"doc": "The initial state of the style. This object is a set of key-value pairs. The state key must be a string. The value can be an expression or primitive type. State values can be retrieved with the [`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression.",
103+
"doc": "The initial state of the style. This object is a set of key-value pairs. The state key must be a string. The value can be an expression or primitive type. State values can be retrieved with the [`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression.\n\nThis property is required if any layer uses the `global-state` expression.",
104104
"example": {
105105
"mode": "light",
106106
"prioritizedPoiCategories": ["food", "drink"]
@@ -3303,7 +3303,7 @@
33033303
}
33043304
},
33053305
"global-state": {
3306-
"doc": "Retrieves a property value from the global state. Returns null if the requested property is missing.\n\n - [Setting global state](https://maplibre.org/maplibre-gl-js/docs/examples/global-state/)",
3306+
"doc": "Retrieves a property value from the [state](https://maplibre.org/maplibre-style-spec/root/#state) property. Default values must be defined in the `state` property.\n\n - [Setting global state](https://maplibre.org/maplibre-gl-js/docs/examples/global-state/)",
33073307
"group": "Lookup",
33083308
"example": {
33093309
"syntax": {

0 commit comments

Comments
 (0)