Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion build_docs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,23 @@ sub check_kibana_links {
# ${baseUrl}guide/en/elasticsearch/reference/${urlVersion}/modules-scripting-expression.html
# ${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}
# ${ELASTIC_DOCS}search-aggregations-bucket-datehistogram-aggregation.html
# ${ELASTICSEARCH_DOCS}update-transform.html
# ${KIBANA_DOCS}canvas.html`
Comment thread
lcawl marked this conversation as resolved.
Outdated
# ${PLUGIN_DOCS}repository-s3.html

my $extractor = sub {
my $contents = shift;
return sub {
while ( $contents =~ m!`(\$\{(?:baseUrl|ELASTIC.+)\}[^`]+)`!g ) {
while ( $contents =~ m!`(\$\{(?:baseUrl|ELASTIC.+|KIBANA.+|PLUGIN.+)\}[^`]+)`!g ) {
Comment thread
lcawl marked this conversation as resolved.
Outdated
my $path = $1;
$path =~ s/\$\{(?:DOC_LINK_VERSION|urlVersion)\}/$branch/;
# In older versions, the variable `${ELASTIC_DOCS}` referred to
# the Elasticsearch Guide. In newer branches, the
# variable is called `${ELASTICSEARCH_DOCS}`
$path =~ s!\$\{ELASTIC_DOCS\}!en/elasticsearch/reference/$branch/!;
$path =~ s!\$\{ELASTICSEARCH_DOCS\}!en/elasticsearch/reference/$branch/!;
$path =~ s!\$\{KIBANA_DOCS\}!en/kibana/$branch/!;
$path =~ s!\$\{PLUGIN_DOCS\}!en/elasticsearch/plugins/$branch/!;
# Replace the "https://www.elastic.co/guide/" URL prefix so that
# it becomes a file path in the built docs.
$path =~ s!\$\{(?:baseUrl|ELASTIC_WEBSITE_URL)\}guide/!!;
Expand Down