mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 02:30:12 +02:00
Docs: ensure all functions include method signature #3777
This commit is contained in:
parent
9c7713ed54
commit
67e927bdb6
@ -1,4 +1,6 @@
|
||||
## removeAlpha
|
||||
> removeAlpha() ⇒ <code>Sharp</code>
|
||||
|
||||
Remove alpha channel, if any. This is a no-op if the image does not have an alpha channel.
|
||||
|
||||
See also [flatten](/api-operation#flatten).
|
||||
@ -15,6 +17,8 @@ sharp('rgba.png')
|
||||
|
||||
|
||||
## ensureAlpha
|
||||
> ensureAlpha([alpha]) ⇒ <code>Sharp</code>
|
||||
|
||||
Ensure the output image has an alpha transparency channel.
|
||||
If missing, the added alpha channel will have the specified
|
||||
transparency level, defaulting to fully-opaque (1).
|
||||
@ -48,6 +52,8 @@ const rgba = await sharp(rgb)
|
||||
|
||||
|
||||
## extractChannel
|
||||
> extractChannel(channel) ⇒ <code>Sharp</code>
|
||||
|
||||
Extract a single channel from a multi-channel image.
|
||||
|
||||
|
||||
@ -78,6 +84,8 @@ const [red1, red2, ...] = await sharp(input)
|
||||
|
||||
|
||||
## joinChannel
|
||||
> joinChannel(images, options) ⇒ <code>Sharp</code>
|
||||
|
||||
Join one or more channels to the image.
|
||||
The meaning of the added channels depends on the output colourspace, set with `toColourspace()`.
|
||||
By default the output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.
|
||||
@ -102,6 +110,8 @@ For raw pixel input, the `options` object should contain a `raw` attribute, whic
|
||||
|
||||
|
||||
## bandbool
|
||||
> bandbool(boolOp) ⇒ <code>Sharp</code>
|
||||
|
||||
Perform a bitwise boolean operation on all input image channels (bands) to produce a single channel output image.
|
||||
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
## tint
|
||||
> tint(rgb) ⇒ <code>Sharp</code>
|
||||
|
||||
Tint the image using the provided chroma while preserving the image luminance.
|
||||
An alpha channel may be present and will be unchanged by the operation.
|
||||
|
||||
@ -21,6 +23,8 @@ const output = await sharp(input)
|
||||
|
||||
|
||||
## greyscale
|
||||
> greyscale([greyscale]) ⇒ <code>Sharp</code>
|
||||
|
||||
Convert to 8-bit greyscale; 256 shades of grey.
|
||||
This is a linear operation. If the input image is in a non-linear colour space such as sRGB, use `gamma()` with `greyscale()` for the best results.
|
||||
By default the output image will be web-friendly sRGB and contain three (identical) color channels.
|
||||
@ -41,6 +45,8 @@ const output = await sharp(input).greyscale().toBuffer();
|
||||
|
||||
|
||||
## grayscale
|
||||
> grayscale([grayscale]) ⇒ <code>Sharp</code>
|
||||
|
||||
Alternative spelling of `greyscale`.
|
||||
|
||||
|
||||
@ -52,6 +58,8 @@ Alternative spelling of `greyscale`.
|
||||
|
||||
|
||||
## pipelineColourspace
|
||||
> pipelineColourspace([colourspace]) ⇒ <code>Sharp</code>
|
||||
|
||||
Set the pipeline colourspace.
|
||||
|
||||
The input image will be converted to the provided colourspace at the start of the pipeline.
|
||||
@ -82,6 +90,8 @@ await sharp(input)
|
||||
|
||||
|
||||
## pipelineColorspace
|
||||
> pipelineColorspace([colorspace]) ⇒ <code>Sharp</code>
|
||||
|
||||
Alternative spelling of `pipelineColourspace`.
|
||||
|
||||
|
||||
@ -97,6 +107,8 @@ Alternative spelling of `pipelineColourspace`.
|
||||
|
||||
|
||||
## toColourspace
|
||||
> toColourspace([colourspace]) ⇒ <code>Sharp</code>
|
||||
|
||||
Set the output colourspace.
|
||||
By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.
|
||||
|
||||
@ -120,6 +132,8 @@ await sharp(input)
|
||||
|
||||
|
||||
## toColorspace
|
||||
> toColorspace([colorspace]) ⇒ <code>Sharp</code>
|
||||
|
||||
Alternative spelling of `toColourspace`.
|
||||
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
## composite
|
||||
> composite(images) ⇒ <code>Sharp</code>
|
||||
|
||||
Composite image(s) over the processed (resized, extracted etc.) image.
|
||||
|
||||
The images to composite must be the same size or smaller than the processed image.
|
||||
|
@ -1,9 +1,13 @@
|
||||
## Sharp
|
||||
> Sharp
|
||||
|
||||
|
||||
**Emits**: <code>Sharp#event:info</code>, <code>Sharp#event:warning</code>
|
||||
<a name="new_Sharp_new"></a>
|
||||
|
||||
### new
|
||||
> new Sharp([input], [options])
|
||||
|
||||
Constructor factory to create an instance of `sharp`, to which further methods are chained.
|
||||
|
||||
JPEG, PNG, WebP, GIF, AVIF or TIFF format image data can be streamed out from this object.
|
||||
@ -159,6 +163,8 @@ await sharp({
|
||||
|
||||
|
||||
## clone
|
||||
> clone() ⇒ [<code>Sharp</code>](#Sharp)
|
||||
|
||||
Take a "snapshot" of the Sharp instance, returning a new instance.
|
||||
Cloned instances inherit the input of their parent instance.
|
||||
This allows multiple output Streams and therefore multiple processing pipelines to share a single input Stream.
|
||||
|
@ -1,4 +1,6 @@
|
||||
## metadata
|
||||
> metadata([callback]) ⇒ <code>Promise.<Object></code> \| <code>Sharp</code>
|
||||
|
||||
Fast access to (uncached) image metadata without decoding any compressed pixel data.
|
||||
|
||||
This is read from the header of the input image.
|
||||
@ -81,6 +83,8 @@ function getNormalSize({ width, height, orientation }) {
|
||||
|
||||
|
||||
## stats
|
||||
> stats([callback]) ⇒ <code>Promise.<Object></code>
|
||||
|
||||
Access to pixel-derived image statistics for every channel in the image.
|
||||
A `Promise` is returned when `callback` is not provided.
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
## rotate
|
||||
> rotate([angle], [options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Rotate the output image by either an explicit angle
|
||||
or auto-orient based on the EXIF `Orientation` tag.
|
||||
|
||||
@ -57,6 +59,8 @@ const resizeThenRotate = await sharp(input)
|
||||
|
||||
|
||||
## flip
|
||||
> flip([flip]) ⇒ <code>Sharp</code>
|
||||
|
||||
Mirror the image vertically (up-down) about the x-axis.
|
||||
This always occurs before rotation, if any.
|
||||
|
||||
@ -75,6 +79,8 @@ const output = await sharp(input).flip().toBuffer();
|
||||
|
||||
|
||||
## flop
|
||||
> flop([flop]) ⇒ <code>Sharp</code>
|
||||
|
||||
Mirror the image horizontally (left-right) about the y-axis.
|
||||
This always occurs before rotation, if any.
|
||||
|
||||
@ -91,6 +97,8 @@ const output = await sharp(input).flop().toBuffer();
|
||||
|
||||
|
||||
## affine
|
||||
> affine(matrix, [options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Perform an affine transform on an image. This operation will always occur after resizing, extraction and rotation, if any.
|
||||
|
||||
You must provide an array of length 4 or a 2x2 affine transformation matrix.
|
||||
@ -142,6 +150,8 @@ inputStream
|
||||
|
||||
|
||||
## sharpen
|
||||
> sharpen([options], [flat], [jagged]) ⇒ <code>Sharp</code>
|
||||
|
||||
Sharpen the image.
|
||||
|
||||
When used without parameters, performs a fast, mild sharpen of the output image.
|
||||
@ -193,6 +203,8 @@ const data = await sharp(input)
|
||||
|
||||
|
||||
## median
|
||||
> median([size]) ⇒ <code>Sharp</code>
|
||||
|
||||
Apply median filter.
|
||||
When used without parameters the default window is 3x3.
|
||||
|
||||
@ -217,6 +229,8 @@ const output = await sharp(input).median(5).toBuffer();
|
||||
|
||||
|
||||
## blur
|
||||
> blur([sigma]) ⇒ <code>Sharp</code>
|
||||
|
||||
Blur the image.
|
||||
|
||||
When used without parameters, performs a fast 3x3 box blur (equivalent to a box linear filter).
|
||||
@ -248,6 +262,8 @@ const gaussianBlurred = await sharp(input)
|
||||
|
||||
|
||||
## flatten
|
||||
> flatten([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Merge alpha transparency channel, if any, with a background, then remove the alpha channel.
|
||||
|
||||
See also [removeAlpha](/api-channel#removealpha).
|
||||
@ -268,6 +284,8 @@ await sharp(rgbaInput)
|
||||
|
||||
|
||||
## unflatten
|
||||
> unflatten()
|
||||
|
||||
Ensure the image has an alpha channel
|
||||
with all white pixel values made fully transparent.
|
||||
|
||||
@ -293,6 +311,8 @@ await sharp(rgbInput)
|
||||
|
||||
|
||||
## gamma
|
||||
> gamma([gamma], [gammaOut]) ⇒ <code>Sharp</code>
|
||||
|
||||
Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of `1/gamma`
|
||||
then increasing the encoding (brighten) post-resize at a factor of `gamma`.
|
||||
This can improve the perceived brightness of a resized image in non-linear colour spaces.
|
||||
@ -315,6 +335,8 @@ Supply a second argument to use a different output gamma value, otherwise the fi
|
||||
|
||||
|
||||
## negate
|
||||
> negate([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Produce the "negative" of the image.
|
||||
|
||||
|
||||
@ -339,6 +361,8 @@ const output = await sharp(input)
|
||||
|
||||
|
||||
## normalise
|
||||
> normalise([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Enhance output image contrast by stretching its luminance to cover a full dynamic range.
|
||||
|
||||
Uses a histogram-based approach, taking a default range of 1% to 99% to reduce sensitivity to noise at the extremes.
|
||||
@ -369,6 +393,8 @@ const output = await sharp(input)
|
||||
|
||||
|
||||
## normalize
|
||||
> normalize([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Alternative spelling of normalise.
|
||||
|
||||
|
||||
@ -388,6 +414,8 @@ const output = await sharp(input)
|
||||
|
||||
|
||||
## clahe
|
||||
> clahe(options) ⇒ <code>Sharp</code>
|
||||
|
||||
Perform contrast limiting adaptive histogram equalization
|
||||
[CLAHE](https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE).
|
||||
|
||||
@ -419,6 +447,8 @@ const output = await sharp(input)
|
||||
|
||||
|
||||
## convolve
|
||||
> convolve(kernel) ⇒ <code>Sharp</code>
|
||||
|
||||
Convolve the image with the specified kernel.
|
||||
|
||||
|
||||
@ -453,6 +483,8 @@ sharp(input)
|
||||
|
||||
|
||||
## threshold
|
||||
> threshold([threshold], [options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Any pixel value greater than or equal to the threshold value will be set to 255, otherwise it will be set to 0.
|
||||
|
||||
|
||||
@ -471,6 +503,8 @@ Any pixel value greater than or equal to the threshold value will be set to 255,
|
||||
|
||||
|
||||
## boolean
|
||||
> boolean(operand, operator, [options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Perform a bitwise boolean operation with operand image.
|
||||
|
||||
This operation creates an output image where each pixel is the result of
|
||||
@ -495,6 +529,8 @@ the selected bitwise boolean `operation` between the corresponding pixels of the
|
||||
|
||||
|
||||
## linear
|
||||
> linear([a], [b]) ⇒ <code>Sharp</code>
|
||||
|
||||
Apply the linear formula `a` * input + `b` to the image to adjust image levels.
|
||||
|
||||
When a single number is provided, it will be used for all image channels.
|
||||
@ -529,6 +565,8 @@ await sharp(rgbInput)
|
||||
|
||||
|
||||
## recomb
|
||||
> recomb(inputMatrix) ⇒ <code>Sharp</code>
|
||||
|
||||
Recombine the image with the specified matrix.
|
||||
|
||||
|
||||
@ -559,6 +597,8 @@ sharp(input)
|
||||
|
||||
|
||||
## modulate
|
||||
> modulate([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Transforms the image using brightness, saturation, hue rotation, and lightness.
|
||||
Brightness and lightness both operate on luminance, with the difference being that
|
||||
brightness is multiplicative whereas lightness is additive.
|
||||
|
@ -1,4 +1,6 @@
|
||||
## toFile
|
||||
> toFile(fileOut, [callback]) ⇒ <code>Promise.<Object></code>
|
||||
|
||||
Write output image data to a file.
|
||||
|
||||
If an explicit output format is not selected, it will be inferred from the extension,
|
||||
@ -39,6 +41,8 @@ sharp(input)
|
||||
|
||||
|
||||
## toBuffer
|
||||
> toBuffer([options], [callback]) ⇒ <code>Promise.<Buffer></code>
|
||||
|
||||
Write output to a Buffer.
|
||||
JPEG, PNG, WebP, AVIF, TIFF, GIF and raw pixel data output are supported.
|
||||
|
||||
@ -108,6 +112,8 @@ await sharp(pixelArray, { raw: { width, height, channels } })
|
||||
|
||||
|
||||
## withMetadata
|
||||
> withMetadata([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Include all metadata (EXIF, XMP, IPTC) from the input image in the output image.
|
||||
This will also convert to and add a web-friendly sRGB ICC profile if appropriate,
|
||||
unless a custom output profile is provided.
|
||||
@ -167,6 +173,8 @@ const data = await sharp(input)
|
||||
|
||||
|
||||
## toFormat
|
||||
> toFormat(format, options) ⇒ <code>Sharp</code>
|
||||
|
||||
Force output to a given format.
|
||||
|
||||
|
||||
@ -190,6 +198,8 @@ const data = await sharp(input)
|
||||
|
||||
|
||||
## jpeg
|
||||
> jpeg([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use these JPEG options for output image.
|
||||
|
||||
|
||||
@ -235,6 +245,8 @@ const data = await sharp(input)
|
||||
|
||||
|
||||
## png
|
||||
> png([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use these PNG options for output image.
|
||||
|
||||
By default, PNG output is full colour at 8 or 16 bits per pixel.
|
||||
@ -278,6 +290,8 @@ const data = await sharp(input)
|
||||
|
||||
|
||||
## webp
|
||||
> webp([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use these WebP options for output image.
|
||||
|
||||
|
||||
@ -319,6 +333,8 @@ const outputWebp = await sharp(inputWebp, { animated: true })
|
||||
|
||||
|
||||
## gif
|
||||
> gif([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use these GIF options for the output image.
|
||||
|
||||
The first entry in the palette is reserved for transparency.
|
||||
@ -378,6 +394,8 @@ await sharp('in.gif', { animated: true })
|
||||
|
||||
|
||||
## jp2
|
||||
> jp2([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use these JP2 options for output image.
|
||||
|
||||
Requires libvips compiled with support for OpenJPEG.
|
||||
@ -420,6 +438,8 @@ const data = await sharp(input)
|
||||
|
||||
|
||||
## tiff
|
||||
> tiff([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use these TIFF options for output image.
|
||||
|
||||
The `density` can be set in pixels/inch via [withMetadata](#withmetadata)
|
||||
@ -461,6 +481,8 @@ sharp('input.svg')
|
||||
|
||||
|
||||
## avif
|
||||
> avif([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use these AVIF options for output image.
|
||||
|
||||
Whilst it is possible to create AVIF images smaller than 16x16 pixels,
|
||||
@ -498,6 +520,8 @@ const data = await sharp(input)
|
||||
|
||||
|
||||
## heif
|
||||
> heif([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use these HEIF options for output image.
|
||||
|
||||
Support for patent-encumbered HEIC images using `hevc` compression requires the use of a
|
||||
@ -528,6 +552,8 @@ const data = await sharp(input)
|
||||
|
||||
|
||||
## jxl
|
||||
> jxl([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use these JPEG-XL (JXL) options for output image.
|
||||
|
||||
This feature is experimental, please do not use in production systems.
|
||||
@ -557,6 +583,8 @@ Image metadata (EXIF, XMP) is unsupported.
|
||||
|
||||
|
||||
## raw
|
||||
> raw([options])
|
||||
|
||||
Force output to be raw, uncompressed pixel data.
|
||||
Pixel ordering is left-to-right, top-to-bottom, without padding.
|
||||
Channel ordering will be RGB or RGBA for non-greyscale colourspaces.
|
||||
@ -592,6 +620,8 @@ const data = await sharp('input.png')
|
||||
|
||||
|
||||
## tile
|
||||
> tile([options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Use tile-based deep zoom (image pyramid) output.
|
||||
|
||||
Set the format and options for tile images via the `toFormat`, `jpeg`, `png` or `webp` functions.
|
||||
@ -653,6 +683,8 @@ readableStream
|
||||
|
||||
|
||||
## timeout
|
||||
> timeout(options) ⇒ <code>Sharp</code>
|
||||
|
||||
Set a timeout for processing, in seconds.
|
||||
Use a value of zero to continue processing indefinitely, the default behaviour.
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
## resize
|
||||
> resize([width], [height], [options]) ⇒ <code>Sharp</code>
|
||||
|
||||
Resize image to `width`, `height` or `width x height`.
|
||||
|
||||
When both a `width` and `height` are provided, the possible methods by which the image should **fit** these are:
|
||||
@ -146,6 +148,8 @@ const scaleByHalf = await sharp(input)
|
||||
|
||||
|
||||
## extend
|
||||
> extend(extend) ⇒ <code>Sharp</code>
|
||||
|
||||
Extend / pad / extrude one or more edges of the image with either
|
||||
the provided background colour or pixels derived from the image.
|
||||
This operation will always occur after resizing and extraction, if any.
|
||||
@ -204,6 +208,8 @@ sharp(input)
|
||||
|
||||
|
||||
## extract
|
||||
> extract(options) ⇒ <code>Sharp</code>
|
||||
|
||||
Extract/crop a region of the image.
|
||||
|
||||
- Use `extract` before `resize` for pre-resize extraction.
|
||||
@ -245,6 +251,8 @@ sharp(input)
|
||||
|
||||
|
||||
## trim
|
||||
> trim(trim) ⇒ <code>Sharp</code>
|
||||
|
||||
Trim pixels from all edges that contain values similar to the given background colour, which defaults to that of the top-left pixel.
|
||||
|
||||
Images with an alpha channel will use the combined bounding box of alpha and non-alpha channels.
|
||||
|
@ -1,4 +1,6 @@
|
||||
## versions
|
||||
> versions
|
||||
|
||||
An Object containing the version numbers of sharp, libvips and its dependencies.
|
||||
|
||||
|
||||
@ -9,6 +11,8 @@ console.log(sharp.versions);
|
||||
|
||||
|
||||
## interpolators
|
||||
> interpolators : <code>enum</code>
|
||||
|
||||
An Object containing the available interpolators and their proper values
|
||||
|
||||
|
||||
@ -27,6 +31,8 @@ An Object containing the available interpolators and their proper values
|
||||
|
||||
|
||||
## format
|
||||
> format ⇒ <code>Object</code>
|
||||
|
||||
An Object containing nested boolean values representing the available input and output formats/methods.
|
||||
|
||||
|
||||
@ -37,6 +43,8 @@ console.log(sharp.format);
|
||||
|
||||
|
||||
## vendor
|
||||
> vendor
|
||||
|
||||
An Object containing the platform and architecture
|
||||
of the current and installed vendored binaries.
|
||||
|
||||
@ -48,6 +56,8 @@ console.log(sharp.vendor);
|
||||
|
||||
|
||||
## queue
|
||||
> queue
|
||||
|
||||
An EventEmitter that emits a `change` event when a task is either:
|
||||
- queued, waiting for _libuv_ to provide a worker thread
|
||||
- complete
|
||||
@ -62,6 +72,8 @@ sharp.queue.on('change', function(queueLength) {
|
||||
|
||||
|
||||
## cache
|
||||
> cache([options]) ⇒ <code>Object</code>
|
||||
|
||||
Gets or, when options are provided, sets the limits of _libvips'_ operation cache.
|
||||
Existing entries in the cache will be trimmed after any change in limits.
|
||||
This method always returns cache statistics,
|
||||
@ -89,6 +101,8 @@ sharp.cache(false);
|
||||
|
||||
|
||||
## concurrency
|
||||
> concurrency([concurrency]) ⇒ <code>number</code>
|
||||
|
||||
Gets or, when a concurrency is provided, sets
|
||||
the maximum number of threads _libvips_ should use to process _each image_.
|
||||
These are from a thread pool managed by glib,
|
||||
@ -132,6 +146,8 @@ sharp.concurrency(0); // 4
|
||||
|
||||
|
||||
## counters
|
||||
> counters() ⇒ <code>Object</code>
|
||||
|
||||
Provides access to internal task counters.
|
||||
- queue is the number of tasks this module has queued waiting for _libuv_ to provide a worker thread from its pool.
|
||||
- process is the number of resize tasks currently being processed.
|
||||
@ -144,6 +160,8 @@ const counters = sharp.counters(); // { queue: 2, process: 4 }
|
||||
|
||||
|
||||
## simd
|
||||
> simd([simd]) ⇒ <code>boolean</code>
|
||||
|
||||
Get and set use of SIMD vector unit instructions.
|
||||
Requires libvips to have been compiled with liborc support.
|
||||
|
||||
@ -169,6 +187,8 @@ const simd = sharp.simd(false);
|
||||
|
||||
|
||||
## block
|
||||
> block(options)
|
||||
|
||||
Block libvips operations at runtime.
|
||||
|
||||
This is in addition to the `VIPS_BLOCK_UNTRUSTED` environment variable,
|
||||
@ -191,6 +211,8 @@ sharp.block({
|
||||
|
||||
|
||||
## unblock
|
||||
> unblock(options)
|
||||
|
||||
Unblock libvips operations at runtime.
|
||||
|
||||
This is useful for defining a list of allowed operations.
|
||||
|
@ -29,7 +29,7 @@ const jsdoc2md = require('jsdoc-to-markdown');
|
||||
});
|
||||
|
||||
const cleanMarkdown = markdown
|
||||
.replace(/(## [A-Za-z0-9]+)[^\n]*/g, '$1') // simplify headings to match those of documentationjs, ensures existing URLs work
|
||||
.replace(/(## )([A-Za-z0-9]+)([^\n]*)/g, '$1$2\n> $2$3\n') // simplify headings to match those of documentationjs, ensures existing URLs work
|
||||
.replace(/<a name="[A-Za-z0-9+]+"><\/a>/g, '') // remove anchors, let docute add these (at markdown to HTML render time)
|
||||
.replace(/\*\*Kind\*\*: global[^\n]+/g, '') // remove all "global" Kind labels (requires JSDoc refactoring)
|
||||
.trim();
|
||||
|
@ -40,7 +40,7 @@ for (const match of matches) {
|
||||
].forEach((section) => {
|
||||
const contents = fs.readFileSync(path.join(__dirname, '..', `api-${section}.md`), 'utf8');
|
||||
const matches = contents.matchAll(
|
||||
/## (?<title>[A-Za-z]+)\n(?<firstparagraph>.+?)\n\n.+?(?<parameters>\| Param .+?\n\n)?\*\*Example/gs
|
||||
/## (?<title>[A-Za-z]+)\n[^\n]+\n(?<firstparagraph>.+?)\n\n.+?(?<parameters>\| Param .+?\n\n)?\*\*Example/gs
|
||||
);
|
||||
for (const match of matches) {
|
||||
const { title, firstparagraph, parameters } = match.groups;
|
||||
|
Loading…
x
Reference in New Issue
Block a user