Skip to content

Commit

Permalink
Remove top of file table of contents in documentation (#1270)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDancingCode authored and lovell committed Jun 24, 2018
1 parent 76c41ea commit 9c20ae3
Show file tree
Hide file tree
Showing 10 changed files with 261 additions and 703 deletions.
53 changes: 13 additions & 40 deletions docs/api-channel.md
@@ -1,23 +1,12 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [extractChannel][1]
- [Parameters][2]
- [Examples][3]
- [joinChannel][4]
- [Parameters][5]
- [bandbool][6]
- [Parameters][7]
- [Examples][8]

## extractChannel

Extract a single channel from a multi-channel image.

### Parameters

- `channel` **([Number][9] \| [String][10])** zero-indexed band number to extract, or `red`, `green` or `blue` as alternative to `0`, `1` or `2` respectively.
- `channel` **([Number][1] \| [String][2])** zero-indexed band number to extract, or `red`, `green` or `blue` as alternative to `0`, `1` or `2` respectively.

### Examples

Expand All @@ -30,7 +19,7 @@ sharp(input)
});
```

- Throws **[Error][11]** Invalid channel
- Throws **[Error][3]** Invalid channel

Returns **Sharp**

Expand All @@ -49,11 +38,11 @@ For raw pixel input, the `options` object should contain a `raw` attribute, whic

### Parameters

- `images` **([Array][12]&lt;([String][10] \| [Buffer][13])> | [String][10] \| [Buffer][13])** one or more images (file paths, Buffers).
- `options` **[Object][14]** image options, see `sharp()` constructor.
- `images` **([Array][4]&lt;([String][2] \| [Buffer][5])> | [String][2] \| [Buffer][5])** one or more images (file paths, Buffers).
- `options` **[Object][6]** image options, see `sharp()` constructor.


- Throws **[Error][11]** Invalid parameters
- Throws **[Error][3]** Invalid parameters

Returns **Sharp**

Expand All @@ -63,7 +52,7 @@ Perform a bitwise boolean operation on all input image channels (bands) to produ

### Parameters

- `boolOp` **[String][10]** one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively.
- `boolOp` **[String][2]** one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively.

### Examples

Expand All @@ -77,34 +66,18 @@ sharp('3-channel-rgb-input.png')
});
```

- Throws **[Error][11]** Invalid parameters
- Throws **[Error][3]** Invalid parameters

Returns **Sharp**

[1]: #extractchannel

[2]: #parameters

[3]: #examples

[4]: #joinchannel

[5]: #parameters-1

[6]: #bandbool

[7]: #parameters-2

[8]: #examples-1

[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error

[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[13]: https://nodejs.org/api/buffer.html
[5]: https://nodejs.org/api/buffer.html

[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
71 changes: 16 additions & 55 deletions docs/api-colour.md
@@ -1,20 +1,5 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [background][1]
- [Parameters][2]
- [tint][3]
- [Parameters][4]
- [greyscale][5]
- [Parameters][6]
- [grayscale][7]
- [Parameters][8]
- [toColourspace][9]
- [Parameters][10]
- [toColorspace][11]
- [Parameters][12]

## background

Set the background for the `embed`, `flatten` and `extend` operations.
Expand All @@ -26,10 +11,10 @@ The alpha value is a float between `0` (transparent) and `1` (opaque).

### Parameters

- `rgba` **([String][13] \| [Object][14])** parsed by the [color][15] module to extract values for red, green, blue and alpha.
- `rgba` **([String][1] \| [Object][2])** parsed by the [color][3] module to extract values for red, green, blue and alpha.


- Throws **[Error][16]** Invalid parameter
- Throws **[Error][4]** Invalid parameter

Returns **Sharp**

Expand All @@ -40,10 +25,10 @@ An alpha channel may be present and will be unchanged by the operation.

### Parameters

- `rgb` **([String][13] \| [Object][14])** parsed by the [color][15] module to extract chroma values.
- `rgb` **([String][1] \| [Object][2])** parsed by the [color][3] module to extract chroma values.


- Throws **[Error][16]** Invalid parameter
- Throws **[Error][4]** Invalid parameter

Returns **Sharp**

Expand All @@ -58,7 +43,7 @@ An alpha channel may be present, and will be unchanged by the operation.

### Parameters

- `greyscale` **[Boolean][17]** (optional, default `true`)
- `greyscale` **[Boolean][5]** (optional, default `true`)

Returns **Sharp**

Expand All @@ -68,7 +53,7 @@ Alternative spelling of `greyscale`.

### Parameters

- `grayscale` **[Boolean][17]** (optional, default `true`)
- `grayscale` **[Boolean][5]** (optional, default `true`)

Returns **Sharp**

Expand All @@ -79,10 +64,10 @@ By default output image will be web-friendly sRGB, with additional channels inte

### Parameters

- `colourspace` **[String][13]?** output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...][18]
- `colourspace` **[String][1]?** output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...][6]


- Throws **[Error][16]** Invalid parameters
- Throws **[Error][4]** Invalid parameters

Returns **Sharp**

Expand All @@ -92,45 +77,21 @@ Alternative spelling of `toColourspace`.

### Parameters

- `colorspace` **[String][13]?** output colorspace.
- `colorspace` **[String][1]?** output colorspace.


- Throws **[Error][16]** Invalid parameters
- Throws **[Error][4]** Invalid parameters

Returns **Sharp**

[1]: #background

[2]: #parameters

[3]: #tint

[4]: #parameters-1

[5]: #greyscale

[6]: #parameters-2

[7]: #grayscale

[8]: #parameters-3

[9]: #tocolourspace

[10]: #parameters-4

[11]: #tocolorspace

[12]: #parameters-5

[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[15]: https://www.npmjs.org/package/color
[3]: https://www.npmjs.org/package/color

[16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error

[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

[18]: https://github.com/jcupitt/libvips/blob/master/libvips/iofuncs/enumtypes.c#L568
[6]: https://github.com/jcupitt/libvips/blob/master/libvips/iofuncs/enumtypes.c#L568
62 changes: 25 additions & 37 deletions docs/api-composite.md
@@ -1,11 +1,5 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [overlayWith][1]
- [Parameters][2]
- [Examples][3]

## overlayWith

Overlay (composite) an image over the processed (resized, extracted etc.) image.
Expand All @@ -17,23 +11,23 @@ If the overlay image contains an alpha channel then composition with premultipli

### Parameters

- `overlay` **([Buffer][4] \| [String][5])** Buffer containing image data or String containing the path to an image file.
- `options` **[Object][6]?**
- `options.gravity` **[String][5]** gravity at which to place the overlay. (optional, default `'centre'`)
- `options.top` **[Number][7]?** the pixel offset from the top edge.
- `options.left` **[Number][7]?** the pixel offset from the left edge.
- `options.tile` **[Boolean][8]** set to true to repeat the overlay image across the entire image with the given `gravity`. (optional, default `false`)
- `options.cutout` **[Boolean][8]** set to true to apply only the alpha channel of the overlay image to the input image, giving the appearance of one image being cut out of another. (optional, default `false`)
- `options.density` **[Number][7]** integral number representing the DPI for vector overlay image. (optional, default `72`)
- `options.raw` **[Object][6]?** describes overlay when using raw pixel data.
- `options.raw.width` **[Number][7]?**
- `options.raw.height` **[Number][7]?**
- `options.raw.channels` **[Number][7]?**
- `options.create` **[Object][6]?** describes a blank overlay to be created.
- `options.create.width` **[Number][7]?**
- `options.create.height` **[Number][7]?**
- `options.create.channels` **[Number][7]?** 3-4
- `options.create.background` **([String][5] \| [Object][6])?** parsed by the [color][9] module to extract values for red, green, blue and alpha.
- `overlay` **([Buffer][1] \| [String][2])** Buffer containing image data or String containing the path to an image file.
- `options` **[Object][3]?**
- `options.gravity` **[String][2]** gravity at which to place the overlay. (optional, default `'centre'`)
- `options.top` **[Number][4]?** the pixel offset from the top edge.
- `options.left` **[Number][4]?** the pixel offset from the left edge.
- `options.tile` **[Boolean][5]** set to true to repeat the overlay image across the entire image with the given `gravity`. (optional, default `false`)
- `options.cutout` **[Boolean][5]** set to true to apply only the alpha channel of the overlay image to the input image, giving the appearance of one image being cut out of another. (optional, default `false`)
- `options.density` **[Number][4]** integral number representing the DPI for vector overlay image. (optional, default `72`)
- `options.raw` **[Object][3]?** describes overlay when using raw pixel data.
- `options.raw.width` **[Number][4]?**
- `options.raw.height` **[Number][4]?**
- `options.raw.channels` **[Number][4]?**
- `options.create` **[Object][3]?** describes a blank overlay to be created.
- `options.create.width` **[Number][4]?**
- `options.create.height` **[Number][4]?**
- `options.create.channels` **[Number][4]?** 3-4
- `options.create.background` **([String][2] \| [Object][3])?** parsed by the [color][6] module to extract values for red, green, blue and alpha.

### Examples

Expand All @@ -56,26 +50,20 @@ sharp('input.png')
});
```

- Throws **[Error][10]** Invalid parameters
- Throws **[Error][7]** Invalid parameters

Returns **Sharp**

[1]: #overlaywith

[2]: #parameters

[3]: #examples

[4]: https://nodejs.org/api/buffer.html
[1]: https://nodejs.org/api/buffer.html

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

[9]: https://www.npmjs.org/package/color
[6]: https://www.npmjs.org/package/color

[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error

0 comments on commit 9c20ae3

Please sign in to comment.