From c9c5597058147cfc35eb455b281ca539ffbd3e49 Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Mon, 28 Oct 2024 08:32:02 +0100 Subject: [PATCH] docs: fix table generation (#479) --- docs/MapView.md | 10 ++-------- docs/ShapeSource.md | 5 +---- scripts/utils/template-globals.js | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/docs/MapView.md b/docs/MapView.md index ccabf6b2f..46d531f19 100644 --- a/docs/MapView.md +++ b/docs/MapView.md @@ -16,16 +16,10 @@ | pitchEnabled | `boolean` | `true` | `false` | Enable/Disable pitch on map | | rotateEnabled | `boolean` | `true` | `false` | Enable/Disable rotation on map | | attributionEnabled | `boolean` | `true` | `false` | Enable/Disable attribution on map.

This must be enabled for Mapbox-hosted tiles and styles. Please refer to the Mapbox Terms of Service.
Other providers do not require this. | -| attributionPosition | `\| { top?: number; left?: number } -\| { top?: number; right?: number } -\| { bottom?: number; left?: number } -\| { bottom?: number; right?: number }` | `none` | `false` | Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map | +| attributionPosition | `{ top?: number; left?: number } \| { top?: number; right?: number } \| { bottom?: number; left?: number } \| { bottom?: number; right?: number }` | `none` | `false` | Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map | | tintColor | `string \| unknown[]` | `none` | `false` | MapView's tintColor | | logoEnabled | `boolean` | `false` | `false` | Enable/Disable the logo on the map. | -| logoPosition | `\| { top?: number; left?: number } -\| { top?: number; right?: number } -\| { bottom?: number; left?: number } -\| { bottom?: number; right?: number }` | `none` | `false` | Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map | +| logoPosition | `{ top?: number; left?: number } \| { top?: number; right?: number } \| { bottom?: number; left?: number } \| { bottom?: number; right?: number }` | `none` | `false` | Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map | | compassEnabled | `boolean` | `none` | `false` | Enable/Disable the compass from appearing on the map | | compassViewPosition | `number` | `none` | `false` | Change corner of map the compass starts at. 0: TopLeft, 1: TopRight, 2: BottomLeft, 3: BottomRight | | compassViewMargins | `object` | `none` | `false` | Add margins to the compass with x and y values | diff --git a/docs/ShapeSource.md b/docs/ShapeSource.md index 7d63215a9..7a82db8fc 100644 --- a/docs/ShapeSource.md +++ b/docs/ShapeSource.md @@ -7,10 +7,7 @@ | ---- | :--: | :-----: | :------: | :----------: | | id | `string` | `MapLibreGL.StyleSource.DefaultSourceID` | `false` | A string that uniquely identifies the source. | | url | `string` | `none` | `false` | An HTTP(S) URL, absolute file URL, or local file URL relative to the current application’s resource bundle. | -| shape | `\| GeoJSON.GeometryCollection -\| GeoJSON.Feature -\| GeoJSON.FeatureCollection -\| GeoJSON.Geometry` | `none` | `false` | The contents of the source. A shape can represent a GeoJSON geometry, a feature, or a feature colllection. | +| shape | `GeoJSON.GeometryCollection \| GeoJSON.Feature \| GeoJSON.FeatureCollection \| GeoJSON.Geometry` | `none` | `false` | The contents of the source. A shape can represent a GeoJSON geometry, a feature, or a feature colllection. | | cluster | `boolean` | `none` | `false` | Enables clustering on the source for point shapes. | | clusterRadius | `number` | `none` | `false` | Specifies the radius of each cluster if clustering is enabled.
A value of 512 produces a radius equal to the width of a tile.
The default value is 50. | | clusterMaxZoomLevel | `number` | `none` | `false` | Specifies the maximum zoom level at which to cluster points if clustering is enabled.
Defaults to one zoom level less than the value of maxZoomLevel so that, at the maximum zoom level,
the shapes are not clustered. | diff --git a/scripts/utils/template-globals.js b/scripts/utils/template-globals.js index cff5c1259..46259ecf7 100644 --- a/scripts/utils/template-globals.js +++ b/scripts/utils/template-globals.js @@ -451,7 +451,7 @@ function _propMarkdownTableRows(props, prefix = "") { const { description = "" } = prop; let result = `| ${prefix}${ prop.name - } | \`${type}\` | \`${defaultValue}\` | \`${ + } | \`${type.replace(/^\\\| /, "").replace(/\n/g, " ")}\` | \`${defaultValue}\` | \`${ prop.required }\` | ${replaceNewLine(description)} |`; if (type === "shape") {