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) => {
|
||||
const contents = fs.readFileSync(path.join(__dirname, '..', `api-${section}.md`), 'utf8');
|
||||
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) {
|
||||
const { title, firstparagraph, parameters } = match.groups;
|
||||
const description = firstparagraph.startsWith('###')
|
||||
? 'Constructor'
|
||||
: extractDescription(firstparagraph);
|
||||
const parameterNames = extractParameters(parameters);
|
||||
const parameterNames = parameters ? extractParameters(parameters) : '';
|
||||
|
||||
searchIndex.push({
|
||||
t: title,
|
||||
|
@ -17,6 +17,7 @@ module.exports = [
|
||||
'before',
|
||||
'both',
|
||||
'call',
|
||||
'callback',
|
||||
'can',
|
||||
'containing',
|
||||
'default',
|
||||
@ -26,6 +27,7 @@ module.exports = [
|
||||
'ensure',
|
||||
'etc',
|
||||
'every',
|
||||
'except',
|
||||
'for',
|
||||
'from',
|
||||
'get',
|
||||
@ -49,12 +51,16 @@ module.exports = [
|
||||
'occur',
|
||||
'occurs',
|
||||
'options',
|
||||
'other',
|
||||
'out',
|
||||
'over',
|
||||
'perform',
|
||||
'performs',
|
||||
'provide',
|
||||
'provided',
|
||||
'ready',
|
||||
'requires',
|
||||
'returned',
|
||||
'same',
|
||||
'see',
|
||||
'set',
|
||||
@ -67,9 +73,11 @@ module.exports = [
|
||||
'supported',
|
||||
'sure',
|
||||
'take',
|
||||
'than',
|
||||
'that',
|
||||
'the',
|
||||
'their',
|
||||
'then',
|
||||
'there',
|
||||
'therefore',
|
||||
'these',
|
||||
|
Loading…
x
Reference in New Issue
Block a user