Skip to content

Commit

Permalink
Add script to verify links in docs (#2822)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Mar 21, 2019
1 parent 27a083a commit a219ac2
Show file tree
Hide file tree
Showing 33 changed files with 106 additions and 50 deletions.
2 changes: 1 addition & 1 deletion docs/api-reference/attribute-manager.md
Expand Up @@ -141,4 +141,4 @@ Notes:

## Source

[modules/core/src/core/lib/attribute-manager.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/attribute-manager.js)
[modules/core/src/lib/attribute-manager.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/attribute-manager.js)
2 changes: 1 addition & 1 deletion docs/api-reference/composite-layer.md
Expand Up @@ -198,4 +198,4 @@ Constructor for this sublayer. The base class implementation checks if `type` is

## Source

[modules/core/src/core/lib/composite-layer.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/composite-layer.js)
[modules/core/src/lib/composite-layer.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/composite-layer.js)
2 changes: 1 addition & 1 deletion docs/api-reference/controller.md
Expand Up @@ -157,4 +157,4 @@ Additionally, event objects for different event types contain a subset of the fo

## Source

[modules/core/src/core/controllers/controller.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/controllers/controller.js)
[modules/core/src/controllers/controller.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/controllers/controller.js)
2 changes: 1 addition & 1 deletion docs/api-reference/deck.md
Expand Up @@ -374,4 +374,4 @@ Notes:

## Source

[modules/core/src/core/lib/deck.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/deck.js)
[modules/core/src/lib/deck.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/deck.js)
2 changes: 1 addition & 1 deletion docs/api-reference/first-person-view.md
Expand Up @@ -56,4 +56,4 @@ Inherits all [View methods](/docs/api-reference/viewport.md#methods).

## Source

[modules/core/src/core/views/first-person-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/first-person-view.js)
[modules/core/src/views/first-person-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/first-person-view.js)
4 changes: 2 additions & 2 deletions docs/api-reference/internal/layer-manager.md
@@ -1,6 +1,6 @@
# LayerManager Class (Internal)

> The `LayerManager` class is an internal class that apps normally would not want to use. It was initially exposed primarily to enable deck.gl to be used without React, however as of deck.gl v5.0 you are more likely to want to use the new `Deck` class (or the [`DeckGL`](/docs/api-reference/deckgl.md) React Component). Those classes create a `LayerManager` under the hood to handle layer management, and you do not need to use this class directly.
> The `LayerManager` class is an internal class that apps normally would not want to use. It was initially exposed primarily to enable deck.gl to be used without React, however as of deck.gl v5.0 you are more likely to want to use the new `Deck` class (or the [`DeckGL`](/docs/api-reference/react/deckgl.md) React Component). Those classes create a `LayerManager` under the hood to handle layer management, and you do not need to use this class directly.
The `LayerManager` class handles updates, drawing and picking for a set of layers.

Expand Down Expand Up @@ -161,4 +161,4 @@ Parameters:

## Source

[modules/core/src/core/lib/layer-manager.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/layer-manager.js)
[modules/core/src/lib/layer-manager.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/layer-manager.js)
2 changes: 1 addition & 1 deletion docs/api-reference/layer.md
Expand Up @@ -580,4 +580,4 @@ Returns:

## Source

[modules/core/src/core/lib/layer.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/layer.js)
[modules/core/src/lib/layer.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/layer.js)
2 changes: 1 addition & 1 deletion docs/api-reference/map-controller.md
Expand Up @@ -40,4 +40,4 @@ For a list of supported options, see [Controller](/docs/api-reference/controller

## Source

[modules/core/src/core/controllers/map-controller.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/controllers/map-controller.js)
[modules/core/src/controllers/map-controller.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/controllers/map-controller.js)
2 changes: 1 addition & 1 deletion docs/api-reference/orbit-view.md
Expand Up @@ -41,4 +41,4 @@ Inherits all [View methods](/docs/api-reference/view.md#methods).

## Source

[modules/core/src/core/views/orbit-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/orbit-view.js)
[modules/core/src/views/orbit-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/orbit-view.js)
2 changes: 1 addition & 1 deletion docs/api-reference/orthographic-view.md
Expand Up @@ -44,4 +44,4 @@ Inherits all [View methods](/docs/api-reference/view.md#methods).

## Source

[modules/core/src/core/views/orthographic-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/orthographic-view.js)
[modules/core/src/views/orthographic-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/orthographic-view.js)
2 changes: 1 addition & 1 deletion docs/api-reference/perspective-view.md
Expand Up @@ -38,4 +38,4 @@ Inherits all [View methods](/docs/api-reference/view.md#methods).

## Source

[modules/core/src/core/views/perspective-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/perspective-view.js)
[modules/core/src/views/perspective-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/perspective-view.js)
4 changes: 2 additions & 2 deletions docs/api-reference/standalone/deckgl.md
@@ -1,6 +1,6 @@
# DeckGL (Scripting Interface)

`DeckGL` extends the core [Deck](/docs/api-reference/deck.md) class with some additional features such as Mapbox integration. It offers a convenient way to use deck.gl in prototype environments such as [Codepen](https://codepen.io), [JSFiddle](https://jsfiddle.net) and [Observable](https://www.obervablehq.com).
`DeckGL` extends the core [Deck](/docs/api-reference/deck.md) class with some additional features such as Mapbox integration. It offers a convenient way to use deck.gl in prototype environments such as [Codepen](https://codepen.io), [JSFiddle](https://jsfiddle.net) and [Observable](https://obervablehq.com).

Make sure to read the [Using deck.gl Scripting API](/docs/get-started/using-standalone.md) article.

Expand Down Expand Up @@ -82,4 +82,4 @@ Returns the mapbox-gl [Map](https://www.mapbox.com/mapbox-gl-js/api/#map) instan

## Source

[modules/lite/src/deckgl.js](https://github.com/uber/deck.gl/blob/master/modules/lite/src/deckgl.js)
[modules/main/bundle.js](https://github.com/uber/deck.gl/blob/master/modules/main/bundle.js)
2 changes: 1 addition & 1 deletion docs/api-reference/third-person-view.md
Expand Up @@ -66,4 +66,4 @@ Inherits all [View methods](/docs/api-reference/view.md#methods).

## Source

[modules/core/src/core/views/third-person-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/third-person-view.js)
[modules/core/src/views/third-person-view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/third-person-view.js)
2 changes: 1 addition & 1 deletion docs/api-reference/view.md
Expand Up @@ -226,4 +226,4 @@ A projection matrix depends on the aspect ratio and needs to be recalculated whe

## Source

[modules/core/src/core/views/view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/view.js)
[modules/core/src/views/view.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/views/view.js)
2 changes: 1 addition & 1 deletion docs/api-reference/viewport.md
Expand Up @@ -153,4 +153,4 @@ Returns:

## Source

[modules/core/src/core/viewports/viewport.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/viewports/viewport.js)
[modules/core/src/viewports/viewport.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/viewports/viewport.js)
2 changes: 1 addition & 1 deletion docs/api-reference/web-mercator-viewport.md
Expand Up @@ -145,4 +145,4 @@ Returns:

## Source

[modules/core/src/core/viewports/web-mercator-viewport.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/viewports/web-mercator-viewport.js)
[modules/core/src/viewports/web-mercator-viewport.js](https://github.com/uber/deck.gl/blob/master/modules/core/src/viewports/web-mercator-viewport.js)
2 changes: 1 addition & 1 deletion docs/developer-guide/primitive-layers.md
Expand Up @@ -81,7 +81,7 @@ A choice to make is whether your WebGL primitives (draw calls) should be instanc
}
```
It is sometimes desirable to have a single layer render using multiple geometry primitives (e.g both circles and lines, or triangles and textured meshes etc), rather than creating separate layers. The custom [AxesLayer example](https://github.com/uber/deck.gl/tree/5.2-release/examples/plot/plot-layer/axes-layer.js) uses this technique to share attributes between grids and labels.
It is sometimes desirable to have a single layer render using multiple geometry primitives (e.g both circles and lines, or triangles and textured meshes etc), rather than creating separate layers. The custom [AxesLayer example](https://github.com/uber/deck.gl/tree/master/examples/website/plot/plot-layer/axes-layer.js) uses this technique to share attributes between grids and labels.
#### Defining Attributes
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/testing/testing.md
Expand Up @@ -10,7 +10,7 @@

## Using probe.gl BrowserTestDriver

Helper class primarily intended for automating browser tests from Node.js shell scripts. A `RenderTestDriver` starts a Chrome browser instance and a server and opens a page with a URL that loads a script from the server. The script that runs in the browser is expected to be using the [`RenderTest`](/docs/api-reference/test-utils/render-test.md) class.
Helper class primarily intended for automating browser tests from Node.js shell scripts. A `BrowserTestDriver` starts a Chrome browser instance and a server and opens a page with a URL that loads a script from the server. The script that runs in the browser is expected to be using the [`SnapshotTestRunner`](/docs/api-reference/test-utils/snapshot-test-runner.md) class.

For details on how the automation works, see the [probe.gl](https://uber-web.github.io/probe.gl/#/documentation) [`BrowserDriver`](https://uber-web.github.io/probe.gl/#/documentation/api-reference-testing/browserdriver) class.

Expand Down
2 changes: 1 addition & 1 deletion docs/effects/lighting-effect.md
Expand Up @@ -101,7 +101,7 @@ Array of point light source which emits from a point in all directions.

* Only one ambient light is supported.
* Point light position uses the same coordinate system as view state.
* To enable lighting on a layer, it is required that both the [effects prop of Deck](/docs/api-reference/deck.md?section=effects) and the material prop of the layer are specified. Refer to each layer's documentation to see if the lighting effect is supported.
* To enable lighting on a layer, it is required that both the [effects prop of Deck](/docs/api-reference/deck.md#effects) and the material prop of the layer are specified. Refer to each layer's documentation to see if the lighting effect is supported.
* [GeoJsonLayer](/docs/layers/geojson-layer.md)
* [HexagonLayer](/docs/layers/hexagon-layer.md)
* [ColumnLayer](/docs/layers/column-layer.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/using-standalone.md
Expand Up @@ -41,7 +41,7 @@ const deckgl = new Deck({

## Using the Scripting API

deck.gl also offers a standalone bundled version of the library - a native JavaScript scripting interface like that of d3.js. You can now use deck.gl in prototype environments such as [Codepen](https://codepen.io), [JSFiddle](https://jsfiddle.net) and [Observable](https://www.obervablehq.com). This effort aims to make it easier for designers, creative coders and data scientists everywhere to leverage WebGL for interactive visualizations.
deck.gl also offers a standalone bundled version of the library - a native JavaScript scripting interface like that of d3.js. You can now use deck.gl in prototype environments such as [Codepen](https://codepen.io), [JSFiddle](https://jsfiddle.net) and [Observable](https://obervablehq.com). This effort aims to make it easier for designers, creative coders and data scientists everywhere to leverage WebGL for interactive visualizations.

To use deck.gl in a scripting environment, include the standalone version in a `script` tag:

Expand Down
25 changes: 7 additions & 18 deletions docs/layers/README.md
Expand Up @@ -8,7 +8,7 @@ All deck.gl layers inherit from the [`Layer`](/docs/api-reference/layer.md) base

## Core Layers

The [Core Layers](/docs/layers/scatterplot-layer.md) are a group of geospatial visualization focused layers, intended to represent a small set of widely applicable data visualization building blocks.
The [Core Layers](https://www.npmjs.com/package/@deck.gl/layers) are a group of generic-purpose layers, intended to represent the building blocks for all data visualizations.

The core layers are the most stable and supported deck.gl layers.

Expand All @@ -17,25 +17,14 @@ Some notable features of the core deck.gl layers
* **64-bit Mode** Most core Layers support a 64 bit mode that can be used to achieve higher precision, particularly under high zoom levels (> 1.000.000x) at the cost of sacrificing some performance and memory. Layers that have a 64 bit counterpart are marked with a "64-bit" tag.
* **Extrusions** Some of the Core layers support extrusions and heights (aka "elevations") enabling applications to show a "2.5D" view of their data when using the map in perspective mode. The layers that support extrusions are marked with an "Extrusion" tag.

## Deprecated Layers
## Aggregation Layers

These are layers from an older releases that now have better counterparts. They should not be used in new applications as they may be removed in future deck.gl releases.
The [Aggregation Layers](https://www.npmjs.com/package/@deck.gl/aggregation-layers) are layers that aggregate the input data and visualize them in alternative representations, such as grid and hexagon binning, contour, and heatmap.

## Experimental Layers
## Geo Layers

deck.gl provides a number of experimental layers in the [@deck.gl/experimental-layers](https://github.com/uber/deck.gl/tree/master/modules/experimental-layers) module. These layers are being actively developed and subject to major changes. Their documentations can be found along with the source code, but not hosted on the official documentation website.
The [Geo Layers](https://www.npmjs.com/package/@deck.gl/geo-layers) collects layers that specifically target geospatial visualization use cases, including support for map tiles, popular geospatial indexing systems, GIS formats, etc.

The experimental layers may graduate to core layers in a later release.

To use one of the experimental layers, install the module:

```bash
npm install @deck.gl/experimental-layers
```

Then import in code:

```js
import {MeshLayer} from '@deck.gl/experimental-layers'
```
## Mesh Layers

The [Mesh Layers](https://www.npmjs.com/package/@deck.gl/mesh-layers) visualize 3D models, with experimental support for scenegraph in the glTF format.
2 changes: 1 addition & 1 deletion docs/layers/arc-layer.md
Expand Up @@ -138,4 +138,4 @@ In degrees, can be positive or negative (`-90 to +90`).

## Source

[arc-layer](https://github.com/uber/deck.gl/tree/master/modules/layers/src/arc-layer)
[modules/layers/src/arc-layer](https://github.com/uber/deck.gl/tree/master/modules/layers/src/arc-layer)
4 changes: 4 additions & 0 deletions docs/layers/bitmap-layer.md
Expand Up @@ -62,3 +62,7 @@ The color to use for transparent pixels, in `[r, g, b, a]`. Each component is in

The color to tint the bitmap by, in `[r, g, b]`. Each component is in the `[0, 255]` range.


## Source

[modules/layers/src/bitmap-layer](https://github.com/uber/deck.gl/tree/master/modules/layers/src/bitmap-layer)
2 changes: 1 addition & 1 deletion docs/layers/contour-layer.md
Expand Up @@ -111,4 +111,4 @@ Method called to retrieve weight of each point. By default each point will use a

## Source

[/contour-layer](https://github.com/uber/deck.gl/tree/master/modules/layers/src/contour-layer)
[modules/aggregation-layers/src/contour-layer](https://github.com/uber/deck.gl/tree/master/modules/aggregation-layers/src/contour-layer)
2 changes: 1 addition & 1 deletion docs/layers/gpu-grid-layer.md
Expand Up @@ -105,4 +105,4 @@ Method called to retrieve the position of each point.

## Source

[modules/experimental-layers/src/gpu-grid-layer](https://github.com/uber/deck.gl/tree/master/modules/experimental-layers/src/gpu-grid-layer)
[modules/aggregation-layers/src/gpu-grid-layer](https://github.com/uber/deck.gl/tree/master/modules/aggregation-layers/src/gpu-grid-layer)
2 changes: 1 addition & 1 deletion docs/layers/grid-cell-layer.md
Expand Up @@ -114,5 +114,5 @@ The elevation of each cell in meters.

## Source

[modules/layers/src/grid-cell-layer](https://github.com/uber/deck.gl/tree/master/modules/layers/src/grid-cell-layer)
[modules/layers/src/grid-cell-layer](https://github.com/uber/deck.gl/tree/master/modules/layers/src/column-layer/grid-cell-layer.js)

2 changes: 1 addition & 1 deletion docs/layers/grid-layer.md
Expand Up @@ -216,4 +216,4 @@ The GridLayer renders the following sublayers:

## Source

[modules/layers/src/grid-layer](https://github.com/uber/deck.gl/tree/master/modules/layers/src/grid-layer)
[modules/aggregation-layers/src/grid-layer](https://github.com/uber/deck.gl/tree/master/modules/aggregation-layers/src/grid-layer)
2 changes: 1 addition & 1 deletion docs/layers/h3-cluster-layer.md
Expand Up @@ -60,7 +60,7 @@ const App = ({data, viewport}) => {

## Properties

Inherits from all [Base Layer](/docs/api-reference/layer.md), [CompositeLayer](/docs/api-reference/composite-layer.md), and [PolygonLayer](/docs/api-reference/polygon-layer.md) properties, plus the following:
Inherits from all [Base Layer](/docs/api-reference/layer.md), [CompositeLayer](/docs/api-reference/composite-layer.md), and [PolygonLayer](/docs/layers/polygon-layer.md) properties, plus the following:

### Data Accessors

Expand Down
2 changes: 1 addition & 1 deletion docs/layers/hexagon-layer.md
Expand Up @@ -242,4 +242,4 @@ The HexagonLayer renders the following sublayers:

## Source

[modules/layers/src/hexagon-layer](https://github.com/uber/deck.gl/tree/master/modules/layers/src/hexagon-layer)
[modules/aggregation-layers/src/hexagon-layer](https://github.com/uber/deck.gl/tree/master/modules/aggregation-layers/src/hexagon-layer)
2 changes: 1 addition & 1 deletion docs/layers/s2-layer.md
Expand Up @@ -82,5 +82,5 @@ Check [S2 Cell](http://s2geometry.io/devguide/s2cell_hierarchy) for more details

## Source

[modules/s2-layers/src/s2-layer](https://github.com/uber/deck.gl/tree/master/modules/s2-layers/src/s2-layer)
[modules/geo-layers/src/s2-layer](https://github.com/uber/deck.gl/tree/master/modules/geo-layers/src/s2-layer)

2 changes: 1 addition & 1 deletion docs/layers/screen-grid-layer.md
Expand Up @@ -128,4 +128,4 @@ Method called to retrieve the weight of each object.

## Source

[modules/layers/src/screen-grid-layer](https://github.com/uber/deck.gl/tree/master/modules/layers/src/screen-grid-layer)
[modules/aggregation-layers/src/screen-grid-layer](https://github.com/uber/deck.gl/tree/master/modules/aggregation-layers/src/screen-grid-layer)
7 changes: 6 additions & 1 deletion docs/layers/trips-layer.md
Expand Up @@ -4,7 +4,7 @@ This layer renders animated paths that represent vehicle trips.

import TripsLayer from './trips-layer';

Inherits from all [Base Layer](/docs/layers/base-layer.md) properties.
Inherits from all [Base Layer](/docs/api-reference/layer.md) properties.

##### `getPath` (Function, optional)

Expand Down Expand Up @@ -34,3 +34,8 @@ This value is used with the timestamps from `getPath` to determine where the veh
- Default: `120`

How long it takes for a path to completely fade out.


# Source

[modules/geo-layers/src/trips-layer](https://github.com/uber/deck.gl/tree/master/modules/geo-layers/src/trips-layer)
58 changes: 58 additions & 0 deletions scripts/verify-doc-links.sh
@@ -0,0 +1,58 @@
#!/bin/bash

set -e

PWD=`pwd`
GOOD_LINKS=()
BAD_LINKS=()

verify_local_file() {
# echo "${PWD}${1}"
if [ -e "${PWD}${1}" ]; then
GOOD_LINKS+=("$1")
echo -e "\033[92mok\033[0m $1"
else
BAD_LINKS+=("$1")
echo -e "\033[91mmissing\033[0m $1"
fi
}

verify_url() {
if curl -L --output /dev/null --silent --head --fail $1; then
GOOD_LINKS+=("$1")
echo -e "\033[92mok\033[0m $1"
else
BAD_LINKS+=("$1")
echo -e "\033[91mmissing\033[0m $1"
fi
}

echo -e "\033[93mGathering links in docs...\033[0m"
FILES=`find docs | grep .md$`

for f in ${FILES[@]};
do
echo -e "\033[1m$f\033[0m"
# Get all the URLs out of markdown links in the form of [alt text](url)
LINKS=`grep -o -E "\[.*?\]\(.+?\)" "${f}" | sed -e 's/\[.*\](\(.*\))/\1/' | sed -e 's/#[^#]*$//'`

for link in ${LINKS[@]};
do
if [[ $link =~ ^/ ]]; then
verify_local_file $link
fi

if [[ $link =~ ^http ]]; then
verify_url $link
fi
done

echo
done

if [ -z "${BAD_LINKS}" ]; then
echo -e "\033[92mAll links ok\033[0m $1"
else
echo -e "\033[91mFound ${#BAD_LINKS[@]} bad links!\033[0m $1"
exit 1
fi

0 comments on commit a219ac2

Please sign in to comment.