mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Docs: ensure ops without examples are indexed
This commit is contained in:
parent
dc53f1baff
commit
35e8c8b25e
File diff suppressed because one or more lines are too long
@ -37,14 +37,14 @@ for (const match of matches) {
|
|||||||
].forEach((section) => {
|
].forEach((section) => {
|
||||||
const contents = fs.readFileSync(path.join(__dirname, '..', `api-${section}.md`), 'utf8');
|
const contents = fs.readFileSync(path.join(__dirname, '..', `api-${section}.md`), 'utf8');
|
||||||
const matches = contents.matchAll(
|
const matches = contents.matchAll(
|
||||||
/\n## (?<title>[A-Za-z]+)\n\n(?<firstparagraph>.+?)\n\n(?<parameters>### Parameters*.+?)#/gs
|
/\n## (?<title>[A-Za-z]+)\n\n(?<firstparagraph>.+?)\n\n(?<parameters>### Parameters.+?Returns)?/gs
|
||||||
);
|
);
|
||||||
for (const match of matches) {
|
for (const match of matches) {
|
||||||
const { title, firstparagraph, parameters } = match.groups;
|
const { title, firstparagraph, parameters } = match.groups;
|
||||||
const description = firstparagraph.startsWith('###')
|
const description = firstparagraph.startsWith('###')
|
||||||
? 'Constructor'
|
? 'Constructor'
|
||||||
: extractDescription(firstparagraph);
|
: extractDescription(firstparagraph);
|
||||||
const parameterNames = extractParameters(parameters);
|
const parameterNames = parameters ? extractParameters(parameters) : '';
|
||||||
|
|
||||||
searchIndex.push({
|
searchIndex.push({
|
||||||
t: title,
|
t: title,
|
||||||
|
@ -17,6 +17,7 @@ module.exports = [
|
|||||||
'before',
|
'before',
|
||||||
'both',
|
'both',
|
||||||
'call',
|
'call',
|
||||||
|
'callback',
|
||||||
'can',
|
'can',
|
||||||
'containing',
|
'containing',
|
||||||
'default',
|
'default',
|
||||||
@ -26,6 +27,7 @@ module.exports = [
|
|||||||
'ensure',
|
'ensure',
|
||||||
'etc',
|
'etc',
|
||||||
'every',
|
'every',
|
||||||
|
'except',
|
||||||
'for',
|
'for',
|
||||||
'from',
|
'from',
|
||||||
'get',
|
'get',
|
||||||
@ -49,12 +51,16 @@ module.exports = [
|
|||||||
'occur',
|
'occur',
|
||||||
'occurs',
|
'occurs',
|
||||||
'options',
|
'options',
|
||||||
|
'other',
|
||||||
|
'out',
|
||||||
'over',
|
'over',
|
||||||
'perform',
|
'perform',
|
||||||
'performs',
|
'performs',
|
||||||
'provide',
|
'provide',
|
||||||
'provided',
|
'provided',
|
||||||
'ready',
|
'ready',
|
||||||
|
'requires',
|
||||||
|
'returned',
|
||||||
'same',
|
'same',
|
||||||
'see',
|
'see',
|
||||||
'set',
|
'set',
|
||||||
@ -67,9 +73,11 @@ module.exports = [
|
|||||||
'supported',
|
'supported',
|
||||||
'sure',
|
'sure',
|
||||||
'take',
|
'take',
|
||||||
|
'than',
|
||||||
'that',
|
'that',
|
||||||
'the',
|
'the',
|
||||||
'their',
|
'their',
|
||||||
|
'then',
|
||||||
'there',
|
'there',
|
||||||
'therefore',
|
'therefore',
|
||||||
'these',
|
'these',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user