Skip to content

Commit 388c5e8

Browse files
author
spalger
committed
force replace a bad link in generated docs
1 parent a3d0999 commit 388c5e8

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

docs/api_methods.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3694,7 +3694,7 @@ client.indices.flushSynced([params, [callback]])
36943694

36953695
// no description
36963696

3697-
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-flush.html#synced-flush-api[the elasticsearch docs] for more information pertaining to this method.
3697+
Check the *<<api-conventions>>* and https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-synced-flush-api.html[the elasticsearch docs] for more information pertaining to this method.
36983698

36993699
// no examples
37003700

@@ -3717,7 +3717,7 @@ Options:::
37173717
`index`::
37183718
<<api-param-type-string,`String`>>, <<api-param-type-string-array,`String[]`>>, <<api-param-type-boolean,`Boolean`>> -- A comma-separated list of index names; use `_all` or empty string for all indices
37193719
`body`::
3720-
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-flush.html#synced-flush-api[the elasticsearch docs] for details about what can be specified here.
3720+
<<api-param-type-object,`Object`>>, <<api-param-type-json,`JSON`>> -- An optional request body, as either JSON or a JSON serializable object. See https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-synced-flush-api.html[the elasticsearch docs] for details about what can be specified here.
37213721

37223722
link:#[back to top]
37233723

scripts/generate/js_api.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,20 @@ module.exports = function(branch, done) {
188188
done();
189189
}
190190

191+
var patchBadLinks = {
192+
'https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-flush.html#synced-flush-api':
193+
'https://www.elastic.co/guide/en/elasticsearch/reference/7.4/indices-synced-flush-api.html',
194+
};
195+
191196
function writeMethodDocs(done) {
192197
var filename = fromRoot('docs/api_methods' + branchSuffix + '.asciidoc');
193-
fs.writeFile(filename, templates.apiMethods(docVars), function(err) {
198+
var content = templates.apiMethods(docVars);
199+
200+
for (const [bad, good] of Object.entries(patchBadLinks)) {
201+
content = content.split(bad).join(good);
202+
}
203+
204+
fs.writeFile(filename, content, function(err) {
194205
if (!err) {
195206
console.log(
196207
chalk.white.bold('wrote'),

0 commit comments

Comments
 (0)