From d53bba52aee079f8e3de5b8e0db95ea1f131cebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20Gonz=C3=A1lez=20de=20la=20Herr=C3=A1n?= <25320357+eedugon@users.noreply.github.com> Date: Thu, 13 Mar 2025 11:46:15 +0100 Subject: [PATCH 01/29] bumping current docs to 8.18 --- conf.yaml | 4 ++-- shared/versions/stack/8.17.asciidoc | 2 +- shared/versions/stack/current.asciidoc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf.yaml b/conf.yaml index 0addf0cceb9af..bcb2aebaac3dd 100644 --- a/conf.yaml +++ b/conf.yaml @@ -80,8 +80,8 @@ contents_title: Elastic documentation # : & # The keys don't really matter, but by convention the are the same as the variable. variables: - stackcurrent: &stackcurrent 8.17 - stacklive: &stacklive [ 8.17, 7.17 ] + stackcurrent: &stackcurrent 8.18 + stacklive: &stacklive [ 8.18, 7.17 ] cloudSaasCurrent: &cloudSaasCurrent ms-121 diff --git a/shared/versions/stack/8.17.asciidoc b/shared/versions/stack/8.17.asciidoc index a17242cac2cc7..373dfaa9983a0 100644 --- a/shared/versions/stack/8.17.asciidoc +++ b/shared/versions/stack/8.17.asciidoc @@ -29,7 +29,7 @@ release-state can be: released | prerelease | unreleased ////////// is-current-version can be: true | false ////////// -:is-current-version: true +:is-current-version: false ////////// hide-xpack-tags defaults to "false" (they are shown unless set to "true") diff --git a/shared/versions/stack/current.asciidoc b/shared/versions/stack/current.asciidoc index 47861155ea01d..c4535f6891367 100644 --- a/shared/versions/stack/current.asciidoc +++ b/shared/versions/stack/current.asciidoc @@ -1 +1 @@ -include::8.17.asciidoc[] +include::8.18.asciidoc[] From bbac0c90c59ec14e8ad4a98a7ed089d5c3efb207 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Thu, 13 Mar 2025 11:14:27 -0500 Subject: [PATCH 02/29] Test wildcard pattern in `build_pr.sh` (part 2) (#3186) * try wrapping in quotes * Update .buildkite/scripts/build_pr.sh --- .buildkite/scripts/build_pr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/scripts/build_pr.sh b/.buildkite/scripts/build_pr.sh index 681e9a4b2ee1b..38f8f97be4a2d 100755 --- a/.buildkite/scripts/build_pr.sh +++ b/.buildkite/scripts/build_pr.sh @@ -68,7 +68,7 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then # test glob "ecs-logging") git fetch origin "$GITHUB_PR_TARGET_BRANCH" - docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/**/*.asciidoc) + docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "**/*.asciidoc") ;; # repositories with a docs dir From 831506e92529f90ec78334d929df598df3a37141 Mon Sep 17 00:00:00 2001 From: Kaarina Tungseth Date: Mon, 24 Mar 2025 08:29:35 -0500 Subject: [PATCH 03/29] Bump to 9.0.0-rc1 (#3177) --- shared/versions/stack/9.0.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/versions/stack/9.0.asciidoc b/shared/versions/stack/9.0.asciidoc index 565f378e55029..ea561edb83523 100644 --- a/shared/versions/stack/9.0.asciidoc +++ b/shared/versions/stack/9.0.asciidoc @@ -1,4 +1,4 @@ -:version: 9.0.0-beta1 +:version: 9.0.0-rc1 //// bare_version never includes -alpha or -beta //// From 7981e5e2e752dfde1121797baa073ea23ef19fc4 Mon Sep 17 00:00:00 2001 From: florent-leborgne Date: Mon, 24 Mar 2025 17:00:02 +0100 Subject: [PATCH 04/29] Make ms-122 current (#3191) --- conf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.yaml b/conf.yaml index bcb2aebaac3dd..b7fd4b641b556 100644 --- a/conf.yaml +++ b/conf.yaml @@ -83,7 +83,7 @@ variables: stackcurrent: &stackcurrent 8.18 stacklive: &stacklive [ 8.18, 7.17 ] - cloudSaasCurrent: &cloudSaasCurrent ms-121 + cloudSaasCurrent: &cloudSaasCurrent ms-122 mapCloudEceToClientsTeam: &mapCloudEceToClientsTeam ms-105: main From e0c07a2d28ee53463bac0f55964db5dc9e851eac Mon Sep 17 00:00:00 2001 From: natasha-moore-elastic <137783811+natasha-moore-elastic@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:58:41 +0000 Subject: [PATCH 05/29] Bump the docs version to 8.16.6 (#3188) --- shared/versions/stack/8.16.asciidoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared/versions/stack/8.16.asciidoc b/shared/versions/stack/8.16.asciidoc index a8354dcb02cf6..a7dfc886de234 100644 --- a/shared/versions/stack/8.16.asciidoc +++ b/shared/versions/stack/8.16.asciidoc @@ -1,12 +1,12 @@ -:version: 8.16.5 +:version: 8.16.6 //// bare_version never includes -alpha or -beta //// -:bare_version: 8.16.5 -:logstash_version: 8.16.5 -:elasticsearch_version: 8.16.5 -:kibana_version: 8.16.5 -:apm_server_version: 8.16.5 +:bare_version: 8.16.6 +:logstash_version: 8.16.6 +:elasticsearch_version: 8.16.6 +:kibana_version: 8.16.6 +:apm_server_version: 8.16.6 // branch is 8.16 instead of 8.x for long-term linking purposes :branch: 8.16 :minor-version: 8.16 From 956d2063a4c13c89d1ddbabdbcf32ca7fc1effeb Mon Sep 17 00:00:00 2001 From: natasha-moore-elastic <137783811+natasha-moore-elastic@users.noreply.github.com> Date: Tue, 25 Mar 2025 10:47:26 +0000 Subject: [PATCH 06/29] Bump the docs version to 8.17.4 (#3189) --- shared/versions/stack/8.17.asciidoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared/versions/stack/8.17.asciidoc b/shared/versions/stack/8.17.asciidoc index 373dfaa9983a0..bcdbd7f4aed4d 100644 --- a/shared/versions/stack/8.17.asciidoc +++ b/shared/versions/stack/8.17.asciidoc @@ -1,12 +1,12 @@ -:version: 8.17.3 +:version: 8.17.4 //// bare_version never includes -alpha or -beta //// -:bare_version: 8.17.3 -:logstash_version: 8.17.3 -:elasticsearch_version: 8.17.3 -:kibana_version: 8.17.3 -:apm_server_version: 8.17.3 +:bare_version: 8.17.4 +:logstash_version: 8.17.4 +:elasticsearch_version: 8.17.4 +:kibana_version: 8.17.4 +:apm_server_version: 8.17.4 // branch is 8.17 instead of 8.x for long-term linking purposes :branch: 8.17 :minor-version: 8.17 From 01997195bd1e1f5a8e4c6c8b326a9b921438dd83 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Wed, 26 Mar 2025 14:21:03 +0100 Subject: [PATCH 07/29] inject test --- template/template.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/template/template.js b/template/template.js index 27eccf6cb1e89..f140691b647f1 100644 --- a/template/template.js +++ b/template/template.js @@ -32,7 +32,7 @@ const readFile = promisify(fs.readFile); const stat = promisify(fs.stat); module.exports = templateSource => { - const apply = (rawItr, lang, initialJsState) => { + const apply = (rawItr, lang, initialJsState, currentPath, destPath) => { /* * We apply the template by walking a stream for the template and a stream * for the raw page in parallel. We do this instead of pulling everything @@ -108,6 +108,7 @@ module.exports = templateSource => { yield `lang="${lang}"`; yield* template.gather(""); await raw.dump(""); + yield `
Current path: ${currentPath}
Dest path: ${destPath}
`; yield* raw.gather(""); yield* template.gather(""); yield `
+
+ +
@@ -82,11 +85,6 @@
- -
- -
-
diff --git a/template/template.js b/template/template.js index 50f34f3f81972..58696fbe0b6d8 100644 --- a/template/template.js +++ b/template/template.js @@ -104,12 +104,10 @@ module.exports = templateSource => { const raw = await Gatherer('raw', rawItr); await raw.dump(""); yield* raw.gather(""); - yield* template.gather(""); - yield `lang="${lang}"`; - yield* template.gather(""); yield `
Dest path: ${destPath}
`; - + yield* template.gather(""); + yield `lang="${lang}"`; yield* template.gather(""); await raw.dump(""); yield* raw.gather(""); From 1a0ab2e4e1f087feec64b0e10413a3ec314de5cb Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 14:07:00 +0100 Subject: [PATCH 12/29] test --- resources/asciidoctor/lib/chunker/extension.rb | 9 +++++++++ template/template.js | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/resources/asciidoctor/lib/chunker/extension.rb b/resources/asciidoctor/lib/chunker/extension.rb index e10f3b8866645..5c879a7479b46 100644 --- a/resources/asciidoctor/lib/chunker/extension.rb +++ b/resources/asciidoctor/lib/chunker/extension.rb @@ -9,6 +9,7 @@ require_relative 'find_related' require_relative 'footnotes' require_relative 'nav' +require_relative 'url_to_v3' ## # HTML5 converter that chunks like docbook. @@ -49,6 +50,7 @@ def convert_document(doc) ) doc.attributes['next_section'] = find_next_in doc, 0 add_nav doc + add_url_to_v3 doc yield end @@ -81,6 +83,11 @@ def add_nav(doc) doc.blocks.append nav.footer end + def add_url_to_v3(doc) + url_to_v3 = UrlToV3.new doc + doc.blocks.insert 0, url_to_v3.header + end + def correct_xref(node) refid = node.attributes['refid'] return unless (ref = node.document.catalog[:refs][refid]) @@ -108,6 +115,8 @@ def form_section_into_page(doc, section, html) def add_subdoc_sections(doc, subdoc, html) nav = Nav.new subdoc + url_to_v3 = UrlToV3.new subdoc + subdoc << url_to_v3.header subdoc << nav.header subdoc << Asciidoctor::Block.new(subdoc, :pass, source: html) subdoc << footnotes(doc, subdoc) if doc.footnotes? diff --git a/template/template.js b/template/template.js index 58696fbe0b6d8..d02cec2e27aab 100644 --- a/template/template.js +++ b/template/template.js @@ -104,8 +104,6 @@ module.exports = templateSource => { const raw = await Gatherer('raw', rawItr); await raw.dump(""); yield* raw.gather(""); - yield* template.gather(""); - yield `
Dest path: ${destPath}
`; yield* template.gather(""); yield `lang="${lang}"`; yield* template.gather(""); From 66a7aca8fd5f9702bd8ceb278fe915c7d8d71abe Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 14:07:22 +0100 Subject: [PATCH 13/29] ok --- .../asciidoctor/lib/chunker/url_to_v3.rb | 36 +++++++++ .../asciidoctor/lib/chunker/v3-mapping.json | 78 +++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 resources/asciidoctor/lib/chunker/url_to_v3.rb create mode 100644 resources/asciidoctor/lib/chunker/v3-mapping.json diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb new file mode 100644 index 0000000000000..25d423fd0aed2 --- /dev/null +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -0,0 +1,36 @@ +module Chunker + + class UrlToV3 + + attr_reader :header + + def initialize(doc) + current_url = doc.attr('current-url') + outdir = doc.attr('outdir') + + current_url ||= 'index.html' + + # raise ArgumentError, "Missing required attribute 'current-url'" if current_url.nil? + raise ArgumentError, "Missing required attribute 'outdir'" if outdir.nil? + + # Hardcoded file path + file_path = File.expand_path('v3-mapping.json', __dir__) + # Read content from the specified file and convert it to a dictionary + mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path) + + + path_dir = outdir.sub('/tmp/docsbuild/target_repo/raw', '').split('/')[0...-1].join('/') + + actual_url = '/guide' + path_dir + '/*/' + current_url + + new_url = mapping[actual_url] + + @header = Asciidoctor::Block.new(doc, :pass, source: <<~HTML) +
+ From: CURRENT URL + To: NEW URL +
+ HTML + end + end +end diff --git a/resources/asciidoctor/lib/chunker/v3-mapping.json b/resources/asciidoctor/lib/chunker/v3-mapping.json new file mode 100644 index 0000000000000..d03b9a6c8eeec --- /dev/null +++ b/resources/asciidoctor/lib/chunker/v3-mapping.json @@ -0,0 +1,78 @@ +{ + "/guide/en/kibana/*/api.html": "/docs/api/", + "/guide/en/kibana/*/apis.html": "/guide/en/kibana/8.18/apis.html", + "/guide/en/kibana/*/apm-alerts.html": "/docs/solutions/observability/apps/create-apm-rules-alerts", + "/guide/en/kibana/*/apm-annotation-api.html": "/docs/api/doc/kibana/operation/operation-createannotation", + "/guide/en/kibana/*/apm-api.html": "/docs/solutions/observability/apps/apm-server-api", + "/guide/en/kibana/*/apm-app-annotation-user-create.html": "/docs/solutions/observability/apps/applications-ui-annotation-user", + "/guide/en/kibana/*/apm-app-api-user.html": "/docs/solutions/observability/apps/applications-ui-api-user", + "/guide/en/kibana/*/apm-app-central-config-user.html": "/docs/solutions/observability/apps/applications-ui-central-config-user", + "/guide/en/kibana/*/apm-app-reader.html": "/docs/solutions/observability/apps/apm-reader-user", + "/guide/en/kibana/*/apm-app-storage-explorer-user-create.html": "/docs/solutions/observability/apps/applications-ui-storage-explorer-user", + "/guide/en/kibana/*/apm-app-users.html": "/docs/solutions/observability/apps/secure-access-to-applications-ui", + "/guide/en/kibana/*/apm-getting-started.html": "/docs/solutions/observability/apps/application-performance-monitoring-apm", + "/guide/en/kibana/*/apm-lambda.html": "/docs/solutions/observability/apps/observe-lambda-functions", + "/guide/en/kibana/*/apm-settings-in-kibana.html": "/docs/solutions/observability/apps/applications-ui-settings", + "/guide/en/kibana/*/apm-settings-kb.html": "/docs/reference/kibana/configuration-reference/apm-settings", + "/guide/en/kibana/*/apm-spaces.html": "/docs/solutions/observability/apps/control-access-to-apm-data", + "/guide/en/kibana/*/apm-ui.html": "/docs/solutions/observability/apps/overviews", + "/guide/en/kibana/*/application-service.html": "/docs/extend/kibana/application-service", + "/guide/en/kibana/*/arrange-panels.html": "/docs/explore-analyze/dashboards/arrange-panels", + "/guide/en/kibana/*/asset-tracking-tutorial.html": "/docs/explore-analyze/visualize/maps/asset-tracking-tutorial", + "/guide/en/kibana/*/automating-report-generation.html": "/docs/explore-analyze/report-and-share/automating-report-generation", + "/guide/en/kibana/*/banners-settings-kb.html": "/docs/reference/kibana/configuration-reference/banner-settings", + "/guide/en/kibana/*/batch-reindex-queue.html": "/docs/api/", + "/guide/en/kibana/*/batch-start-resume-reindex.html": "/docs/api/", + "/guide/en/kibana/*/beats-page.html": "/docs/deploy-manage/monitor/monitoring-data/beats-page", + "/guide/en/kibana/*/bedrock-action-type.html": "/docs/reference/kibana/connectors-kibana/bedrock-action-type", + "/guide/en/kibana/*/breaking-changes-summary.html": "/docs/release-notes/breaking-changes", + "/guide/en/kibana/*/brew.html": "/docs/deploy-manage/deploy/self-managed/install-kibana", + "/guide/en/kibana/*/building-kibana.html": "/docs/extend/kibana/building-kibana", + "/guide/en/kibana/*/cancel-reindex.html": "/docs/api/", + "/guide/en/kibana/*/canvas-function-reference.html": "/docs/reference/data-analysis/kibana/canvas-functions", + "/guide/en/kibana/*/canvas-present-workpad.html": "/docs/explore-analyze/visualize/canvas/canvas-present-workpad", + "/guide/en/kibana/*/canvas-tinymath-functions.html": "/docs/reference/data-analysis/kibana/tinymath-functions", + "/guide/en/kibana/*/canvas-tutorial.html": "/docs/explore-analyze/visualize/canvas/canvas-tutorial", + "/guide/en/kibana/*/canvas.html": "/docs/explore-analyze/visualize/canvas", + "/guide/en/kibana/*/cases-action-type.html": "/docs/reference/kibana/connectors-kibana/cases-action-type", + "/guide/en/kibana/*/cases-api-add-comment.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-create.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-delete-cases.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-delete-comments.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-find-case-activity.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-find-cases.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-find-connectors.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-get-alerts.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-get-case-activity.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-get-case.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-get-cases-by-alert.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-get-comments.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-get-reporters.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-get-status.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-get-tag.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-push.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-set-configuration.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-update-comment.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-update-configuration.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api-update.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-api.html": "/docs/api/", + "/guide/en/kibana/*/cases-get-configuration.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/guide/en/kibana/*/cases-settings.html": "/docs/reference/kibana/configuration-reference/cases-settings", + "/guide/en/kibana/*/cases-webhook-action-type.html": "/docs/reference/kibana/connectors-kibana/cases-webhook-action-type", + "/guide/en/kibana/*/cases.html": "/docs/explore-analyze/alerts-cases/cases", + "/guide/en/kibana/*/chart-types.html": "/docs/explore-analyze/visualize/supported-chart-types", + "/guide/en/kibana/*/check-reindex-status.html": "/docs/api/", + "/guide/en/kibana/*/ci-metrics.html": "/docs/extend/kibana/ci-metrics", + "/guide/en/kibana/*/cli-commands.html": "/docs/reference/kibana/commands", + "/guide/en/kibana/*/configuration-service.html": "/docs/extend/kibana/configuration-service", + "/guide/en/kibana/*/configuring-monitoring.html": "/docs/deploy-manage/monitor/stack-monitoring/kibana-monitoring-self-managed", + "/guide/en/kibana/*/configuring-tls-communication.html": "/docs/deploy-manage/security/secure-your-cluster-deployment", + "/guide/en/kibana/*/configuring-tls.html": "/docs/deploy-manage/security/set-up-basic-security-plus-https", + "/guide/en/kibana/*/connect-to-elasticsearch.html": "/docs/manage-data/ingest", + "/guide/en/kibana/*/console-kibana.html": "/docs/explore-analyze/query-filter/tools/console", + "/guide/en/kibana/*/contributing.html": "/docs/extend/kibana/contributing", + "/guide/en/kibana/*/core-packages.html": "/docs/extend/kibana/core-packages", + "/guide/en/kibana/*/correlations.html": "/docs/solutions/observability/apps/find-transaction-latency-failure-correlations", + "/guide/en/kibana/*/create-a-dashboard-of-panels-with-ecommerce-data.html": "/docs/explore-analyze/dashboards/create-dashboard-of-panels-with-ecommerce-data", + "/guide/en/kibana/*/create-a-dashboard-of-panels-with-web-server-data.html": "/docs/explore-analyze/dashboards/create-dashboard-of-panels-with-web-server-data" +} From 3fc3f2be4ba61d4a1640d6a1b9ddef8e110ce5b7 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 14:15:56 +0100 Subject: [PATCH 14/29] commit am speed up --- conf.yaml | 142 +++++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/conf.yaml b/conf.yaml index b7fd4b641b556..7609edf43959c 100644 --- a/conf.yaml +++ b/conf.yaml @@ -1,78 +1,78 @@ repos: - apm-aws-lambda: https://github.com/elastic/apm-aws-lambda.git - apm-k8s-attacher: https://github.com/elastic/apm-k8s-attacher.git - apm-server: https://github.com/elastic/apm-server.git - apm-agent-android: https://github.com/elastic/apm-agent-android.git - apm-agent-nodejs: https://github.com/elastic/apm-agent-nodejs.git - apm-agent-python: https://github.com/elastic/apm-agent-python.git - apm-agent-ruby: https://github.com/elastic/apm-agent-ruby.git - apm-agent-rum-js: https://github.com/elastic/apm-agent-rum-js.git - apm-agent-go: https://github.com/elastic/apm-agent-go.git - apm-agent-java: https://github.com/elastic/apm-agent-java.git - apm-agent-dotnet: https://github.com/elastic/apm-agent-dotnet.git - apm-agent-php: https://github.com/elastic/apm-agent-php.git - apm-agent-ios: https://github.com/elastic/apm-agent-ios.git - azure-marketplace: https://github.com/elastic/azure-marketplace.git - beats: https://github.com/elastic/beats.git - clients-team: https://github.com/elastic/clients-team.git - cloud: https://github.com/elastic/cloud.git - cloud-assets: https://github.com/elastic/cloud-assets.git - cloud-on-k8s: https://github.com/elastic/cloud-on-k8s.git - curator: https://github.com/elastic/curator.git - docs-content: https://github.com/elastic/docs-content.git - ecctl: https://github.com/elastic/ecctl.git - ecs: https://github.com/elastic/ecs.git - ecs-dotnet: https://github.com/elastic/ecs-dotnet.git - ecs-logging: https://github.com/elastic/ecs-logging.git - ecs-logging-go-logrus: https://github.com/elastic/ecs-logging-go-logrus.git - ecs-logging-go-zap: https://github.com/elastic/ecs-logging-go-zap.git - ecs-logging-go-zerolog: https://github.com/elastic/ecs-logging-go-zerolog.git - ecs-logging-java: https://github.com/elastic/ecs-logging-java.git - ecs-logging-nodejs: https://github.com/elastic/ecs-logging-nodejs.git - ecs-logging-php: https://github.com/elastic/ecs-logging-php.git - ecs-logging-python: https://github.com/elastic/ecs-logging-python.git - ecs-logging-ruby: https://github.com/elastic/ecs-logging-ruby.git - eland: https://github.com/elastic/eland.git - elasticsearch-hadoop: https://github.com/elastic/elasticsearch-hadoop.git - elasticsearch-java: https://github.com/elastic/elasticsearch-java.git - elasticsearch-js: https://github.com/elastic/elasticsearch-js.git - elasticsearch-js-legacy: https://github.com/elastic/elasticsearch-js-legacy.git - elasticsearch-ruby: https://github.com/elastic/elasticsearch-ruby.git - elasticsearch-net: https://github.com/elastic/elasticsearch-net.git - elasticsearch-php: https://github.com/elastic/elasticsearch-php.git - elasticsearch-php-cn: https://github.com/elasticsearch-cn/elasticsearch-php.git - elasticsearch-py: https://github.com/elastic/elasticsearch-py.git - elasticsearch-perl: https://github.com/elastic/elasticsearch-perl.git - go-elasticsearch: https://github.com/elastic/go-elasticsearch.git - elasticsearch-rs: https://github.com/elastic/elasticsearch-rs.git + # apm-aws-lambda: https://github.com/elastic/apm-aws-lambda.git + # apm-k8s-attacher: https://github.com/elastic/apm-k8s-attacher.git + # apm-server: https://github.com/elastic/apm-server.git + # apm-agent-android: https://github.com/elastic/apm-agent-android.git + # apm-agent-nodejs: https://github.com/elastic/apm-agent-nodejs.git + # apm-agent-python: https://github.com/elastic/apm-agent-python.git + # apm-agent-ruby: https://github.com/elastic/apm-agent-ruby.git + # apm-agent-rum-js: https://github.com/elastic/apm-agent-rum-js.git + # apm-agent-go: https://github.com/elastic/apm-agent-go.git + # apm-agent-java: https://github.com/elastic/apm-agent-java.git + # apm-agent-dotnet: https://github.com/elastic/apm-agent-dotnet.git + # apm-agent-php: https://github.com/elastic/apm-agent-php.git + # apm-agent-ios: https://github.com/elastic/apm-agent-ios.git + # azure-marketplace: https://github.com/elastic/azure-marketplace.git + # beats: https://github.com/elastic/beats.git + # clients-team: https://github.com/elastic/clients-team.git + # cloud: https://github.com/elastic/cloud.git + # cloud-assets: https://github.com/elastic/cloud-assets.git + # cloud-on-k8s: https://github.com/elastic/cloud-on-k8s.git + # curator: https://github.com/elastic/curator.git + # docs-content: https://github.com/elastic/docs-content.git + # ecctl: https://github.com/elastic/ecctl.git + # ecs: https://github.com/elastic/ecs.git + # ecs-dotnet: https://github.com/elastic/ecs-dotnet.git + # ecs-logging: https://github.com/elastic/ecs-logging.git + # ecs-logging-go-logrus: https://github.com/elastic/ecs-logging-go-logrus.git + # ecs-logging-go-zap: https://github.com/elastic/ecs-logging-go-zap.git + # ecs-logging-go-zerolog: https://github.com/elastic/ecs-logging-go-zerolog.git + # ecs-logging-java: https://github.com/elastic/ecs-logging-java.git + # ecs-logging-nodejs: https://github.com/elastic/ecs-logging-nodejs.git + # ecs-logging-php: https://github.com/elastic/ecs-logging-php.git + # ecs-logging-python: https://github.com/elastic/ecs-logging-python.git + # ecs-logging-ruby: https://github.com/elastic/ecs-logging-ruby.git + # eland: https://github.com/elastic/eland.git + # elasticsearch-hadoop: https://github.com/elastic/elasticsearch-hadoop.git + # elasticsearch-java: https://github.com/elastic/elasticsearch-java.git + # elasticsearch-js: https://github.com/elastic/elasticsearch-js.git + # elasticsearch-js-legacy: https://github.com/elastic/elasticsearch-js-legacy.git + # elasticsearch-ruby: https://github.com/elastic/elasticsearch-ruby.git + # elasticsearch-net: https://github.com/elastic/elasticsearch-net.git + # elasticsearch-php: https://github.com/elastic/elasticsearch-php.git + # elasticsearch-php-cn: https://github.com/elasticsearch-cn/elasticsearch-php.git + # elasticsearch-py: https://github.com/elastic/elasticsearch-py.git + # elasticsearch-perl: https://github.com/elastic/elasticsearch-perl.git + # go-elasticsearch: https://github.com/elastic/go-elasticsearch.git + # elasticsearch-rs: https://github.com/elastic/elasticsearch-rs.git elasticsearch: https://github.com/elastic/elasticsearch.git - enterprise-search-pubs: https://github.com/elastic/enterprise-search-pubs.git - enterprise-search-js: https://github.com/elastic/enterprise-search-js.git - enterprise-search-php: https://github.com/elastic/enterprise-search-php.git - enterprise-search-python: https://github.com/elastic/enterprise-search-python.git - enterprise-search-ruby: https://github.com/elastic/enterprise-search-ruby.git - esf: https://github.com/elastic/elastic-serverless-forwarder.git + # enterprise-search-pubs: https://github.com/elastic/enterprise-search-pubs.git + # enterprise-search-js: https://github.com/elastic/enterprise-search-js.git + # enterprise-search-php: https://github.com/elastic/enterprise-search-php.git + # enterprise-search-python: https://github.com/elastic/enterprise-search-python.git + # enterprise-search-ruby: https://github.com/elastic/enterprise-search-ruby.git + # esf: https://github.com/elastic/elastic-serverless-forwarder.git guide: https://github.com/elastic/elasticsearch-definitive-guide.git - guide-cn: https://github.com/elasticsearch-cn/elasticsearch-definitive-guide.git - ingest-docs: https://github.com/elastic/ingest-docs.git - integration-docs: https://github.com/elastic/integration-docs.git + # guide-cn: https://github.com/elasticsearch-cn/elasticsearch-definitive-guide.git + # ingest-docs: https://github.com/elastic/ingest-docs.git + # integration-docs: https://github.com/elastic/integration-docs.git kibana: https://github.com/elastic/kibana.git - kibana-cn: https://github.com/elasticsearch-cn/kibana.git - logstash: https://github.com/elastic/logstash.git - logstash-docs: https://github.com/elastic/logstash-docs.git - observability-docs: https://github.com/elastic/observability-docs.git - package-spec: https://github.com/elastic/package-spec.git - search-ui: https://github.com/elastic/search-ui.git - security-docs: https://github.com/elastic/security-docs.git - sense: https://github.com/elastic/sense.git - stack-docs: https://github.com/elastic/stack-docs.git - swiftype: https://github.com/elastic/swiftype-doc-placeholder.git - tech-content: https://github.com/elastic/tech-content.git - terraform-provider-ec: https://github.com/elastic/terraform-provider-ec.git - x-pack: https://github.com/elastic/x-pack.git - x-pack-elasticsearch: https://github.com/elastic/x-pack-elasticsearch.git - x-pack-kibana: https://github.com/elastic/x-pack-kibana.git - x-pack-logstash: https://github.com/elastic/x-pack-logstash.git + # kibana-cn: https://github.com/elasticsearch-cn/kibana.git + # logstash: https://github.com/elastic/logstash.git + # logstash-docs: https://github.com/elastic/logstash-docs.git + # observability-docs: https://github.com/elastic/observability-docs.git + # package-spec: https://github.com/elastic/package-spec.git + # search-ui: https://github.com/elastic/search-ui.git + # security-docs: https://github.com/elastic/security-docs.git + # sense: https://github.com/elastic/sense.git + # stack-docs: https://github.com/elastic/stack-docs.git + # swiftype: https://github.com/elastic/swiftype-doc-placeholder.git + # tech-content: https://github.com/elastic/tech-content.git + # terraform-provider-ec: https://github.com/elastic/terraform-provider-ec.git + # x-pack: https://github.com/elastic/x-pack.git + # x-pack-elasticsearch: https://github.com/elastic/x-pack-elasticsearch.git + # x-pack-kibana: https://github.com/elastic/x-pack-kibana.git + # x-pack-logstash: https://github.com/elastic/x-pack-logstash.git contents_title: Elastic documentation From 72dbd7efec4a77ea76080ff0a87aa545b4e5b1e7 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 15:11:48 +0100 Subject: [PATCH 15/29] Revert conf --- conf.yaml | 142 +++++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/conf.yaml b/conf.yaml index 7609edf43959c..b7fd4b641b556 100644 --- a/conf.yaml +++ b/conf.yaml @@ -1,78 +1,78 @@ repos: - # apm-aws-lambda: https://github.com/elastic/apm-aws-lambda.git - # apm-k8s-attacher: https://github.com/elastic/apm-k8s-attacher.git - # apm-server: https://github.com/elastic/apm-server.git - # apm-agent-android: https://github.com/elastic/apm-agent-android.git - # apm-agent-nodejs: https://github.com/elastic/apm-agent-nodejs.git - # apm-agent-python: https://github.com/elastic/apm-agent-python.git - # apm-agent-ruby: https://github.com/elastic/apm-agent-ruby.git - # apm-agent-rum-js: https://github.com/elastic/apm-agent-rum-js.git - # apm-agent-go: https://github.com/elastic/apm-agent-go.git - # apm-agent-java: https://github.com/elastic/apm-agent-java.git - # apm-agent-dotnet: https://github.com/elastic/apm-agent-dotnet.git - # apm-agent-php: https://github.com/elastic/apm-agent-php.git - # apm-agent-ios: https://github.com/elastic/apm-agent-ios.git - # azure-marketplace: https://github.com/elastic/azure-marketplace.git - # beats: https://github.com/elastic/beats.git - # clients-team: https://github.com/elastic/clients-team.git - # cloud: https://github.com/elastic/cloud.git - # cloud-assets: https://github.com/elastic/cloud-assets.git - # cloud-on-k8s: https://github.com/elastic/cloud-on-k8s.git - # curator: https://github.com/elastic/curator.git - # docs-content: https://github.com/elastic/docs-content.git - # ecctl: https://github.com/elastic/ecctl.git - # ecs: https://github.com/elastic/ecs.git - # ecs-dotnet: https://github.com/elastic/ecs-dotnet.git - # ecs-logging: https://github.com/elastic/ecs-logging.git - # ecs-logging-go-logrus: https://github.com/elastic/ecs-logging-go-logrus.git - # ecs-logging-go-zap: https://github.com/elastic/ecs-logging-go-zap.git - # ecs-logging-go-zerolog: https://github.com/elastic/ecs-logging-go-zerolog.git - # ecs-logging-java: https://github.com/elastic/ecs-logging-java.git - # ecs-logging-nodejs: https://github.com/elastic/ecs-logging-nodejs.git - # ecs-logging-php: https://github.com/elastic/ecs-logging-php.git - # ecs-logging-python: https://github.com/elastic/ecs-logging-python.git - # ecs-logging-ruby: https://github.com/elastic/ecs-logging-ruby.git - # eland: https://github.com/elastic/eland.git - # elasticsearch-hadoop: https://github.com/elastic/elasticsearch-hadoop.git - # elasticsearch-java: https://github.com/elastic/elasticsearch-java.git - # elasticsearch-js: https://github.com/elastic/elasticsearch-js.git - # elasticsearch-js-legacy: https://github.com/elastic/elasticsearch-js-legacy.git - # elasticsearch-ruby: https://github.com/elastic/elasticsearch-ruby.git - # elasticsearch-net: https://github.com/elastic/elasticsearch-net.git - # elasticsearch-php: https://github.com/elastic/elasticsearch-php.git - # elasticsearch-php-cn: https://github.com/elasticsearch-cn/elasticsearch-php.git - # elasticsearch-py: https://github.com/elastic/elasticsearch-py.git - # elasticsearch-perl: https://github.com/elastic/elasticsearch-perl.git - # go-elasticsearch: https://github.com/elastic/go-elasticsearch.git - # elasticsearch-rs: https://github.com/elastic/elasticsearch-rs.git + apm-aws-lambda: https://github.com/elastic/apm-aws-lambda.git + apm-k8s-attacher: https://github.com/elastic/apm-k8s-attacher.git + apm-server: https://github.com/elastic/apm-server.git + apm-agent-android: https://github.com/elastic/apm-agent-android.git + apm-agent-nodejs: https://github.com/elastic/apm-agent-nodejs.git + apm-agent-python: https://github.com/elastic/apm-agent-python.git + apm-agent-ruby: https://github.com/elastic/apm-agent-ruby.git + apm-agent-rum-js: https://github.com/elastic/apm-agent-rum-js.git + apm-agent-go: https://github.com/elastic/apm-agent-go.git + apm-agent-java: https://github.com/elastic/apm-agent-java.git + apm-agent-dotnet: https://github.com/elastic/apm-agent-dotnet.git + apm-agent-php: https://github.com/elastic/apm-agent-php.git + apm-agent-ios: https://github.com/elastic/apm-agent-ios.git + azure-marketplace: https://github.com/elastic/azure-marketplace.git + beats: https://github.com/elastic/beats.git + clients-team: https://github.com/elastic/clients-team.git + cloud: https://github.com/elastic/cloud.git + cloud-assets: https://github.com/elastic/cloud-assets.git + cloud-on-k8s: https://github.com/elastic/cloud-on-k8s.git + curator: https://github.com/elastic/curator.git + docs-content: https://github.com/elastic/docs-content.git + ecctl: https://github.com/elastic/ecctl.git + ecs: https://github.com/elastic/ecs.git + ecs-dotnet: https://github.com/elastic/ecs-dotnet.git + ecs-logging: https://github.com/elastic/ecs-logging.git + ecs-logging-go-logrus: https://github.com/elastic/ecs-logging-go-logrus.git + ecs-logging-go-zap: https://github.com/elastic/ecs-logging-go-zap.git + ecs-logging-go-zerolog: https://github.com/elastic/ecs-logging-go-zerolog.git + ecs-logging-java: https://github.com/elastic/ecs-logging-java.git + ecs-logging-nodejs: https://github.com/elastic/ecs-logging-nodejs.git + ecs-logging-php: https://github.com/elastic/ecs-logging-php.git + ecs-logging-python: https://github.com/elastic/ecs-logging-python.git + ecs-logging-ruby: https://github.com/elastic/ecs-logging-ruby.git + eland: https://github.com/elastic/eland.git + elasticsearch-hadoop: https://github.com/elastic/elasticsearch-hadoop.git + elasticsearch-java: https://github.com/elastic/elasticsearch-java.git + elasticsearch-js: https://github.com/elastic/elasticsearch-js.git + elasticsearch-js-legacy: https://github.com/elastic/elasticsearch-js-legacy.git + elasticsearch-ruby: https://github.com/elastic/elasticsearch-ruby.git + elasticsearch-net: https://github.com/elastic/elasticsearch-net.git + elasticsearch-php: https://github.com/elastic/elasticsearch-php.git + elasticsearch-php-cn: https://github.com/elasticsearch-cn/elasticsearch-php.git + elasticsearch-py: https://github.com/elastic/elasticsearch-py.git + elasticsearch-perl: https://github.com/elastic/elasticsearch-perl.git + go-elasticsearch: https://github.com/elastic/go-elasticsearch.git + elasticsearch-rs: https://github.com/elastic/elasticsearch-rs.git elasticsearch: https://github.com/elastic/elasticsearch.git - # enterprise-search-pubs: https://github.com/elastic/enterprise-search-pubs.git - # enterprise-search-js: https://github.com/elastic/enterprise-search-js.git - # enterprise-search-php: https://github.com/elastic/enterprise-search-php.git - # enterprise-search-python: https://github.com/elastic/enterprise-search-python.git - # enterprise-search-ruby: https://github.com/elastic/enterprise-search-ruby.git - # esf: https://github.com/elastic/elastic-serverless-forwarder.git + enterprise-search-pubs: https://github.com/elastic/enterprise-search-pubs.git + enterprise-search-js: https://github.com/elastic/enterprise-search-js.git + enterprise-search-php: https://github.com/elastic/enterprise-search-php.git + enterprise-search-python: https://github.com/elastic/enterprise-search-python.git + enterprise-search-ruby: https://github.com/elastic/enterprise-search-ruby.git + esf: https://github.com/elastic/elastic-serverless-forwarder.git guide: https://github.com/elastic/elasticsearch-definitive-guide.git - # guide-cn: https://github.com/elasticsearch-cn/elasticsearch-definitive-guide.git - # ingest-docs: https://github.com/elastic/ingest-docs.git - # integration-docs: https://github.com/elastic/integration-docs.git + guide-cn: https://github.com/elasticsearch-cn/elasticsearch-definitive-guide.git + ingest-docs: https://github.com/elastic/ingest-docs.git + integration-docs: https://github.com/elastic/integration-docs.git kibana: https://github.com/elastic/kibana.git - # kibana-cn: https://github.com/elasticsearch-cn/kibana.git - # logstash: https://github.com/elastic/logstash.git - # logstash-docs: https://github.com/elastic/logstash-docs.git - # observability-docs: https://github.com/elastic/observability-docs.git - # package-spec: https://github.com/elastic/package-spec.git - # search-ui: https://github.com/elastic/search-ui.git - # security-docs: https://github.com/elastic/security-docs.git - # sense: https://github.com/elastic/sense.git - # stack-docs: https://github.com/elastic/stack-docs.git - # swiftype: https://github.com/elastic/swiftype-doc-placeholder.git - # tech-content: https://github.com/elastic/tech-content.git - # terraform-provider-ec: https://github.com/elastic/terraform-provider-ec.git - # x-pack: https://github.com/elastic/x-pack.git - # x-pack-elasticsearch: https://github.com/elastic/x-pack-elasticsearch.git - # x-pack-kibana: https://github.com/elastic/x-pack-kibana.git - # x-pack-logstash: https://github.com/elastic/x-pack-logstash.git + kibana-cn: https://github.com/elasticsearch-cn/kibana.git + logstash: https://github.com/elastic/logstash.git + logstash-docs: https://github.com/elastic/logstash-docs.git + observability-docs: https://github.com/elastic/observability-docs.git + package-spec: https://github.com/elastic/package-spec.git + search-ui: https://github.com/elastic/search-ui.git + security-docs: https://github.com/elastic/security-docs.git + sense: https://github.com/elastic/sense.git + stack-docs: https://github.com/elastic/stack-docs.git + swiftype: https://github.com/elastic/swiftype-doc-placeholder.git + tech-content: https://github.com/elastic/tech-content.git + terraform-provider-ec: https://github.com/elastic/terraform-provider-ec.git + x-pack: https://github.com/elastic/x-pack.git + x-pack-elasticsearch: https://github.com/elastic/x-pack-elasticsearch.git + x-pack-kibana: https://github.com/elastic/x-pack-kibana.git + x-pack-logstash: https://github.com/elastic/x-pack-logstash.git contents_title: Elastic documentation From 880d8c6341d4bcc6ce960de9fbc6bc6ffba09f76 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 16:05:44 +0100 Subject: [PATCH 16/29] ok --- resources/asciidoctor/lib/chunker/url_to_v3.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index 25d423fd0aed2..2ef1fd2a162d4 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -11,7 +11,7 @@ def initialize(doc) current_url ||= 'index.html' # raise ArgumentError, "Missing required attribute 'current-url'" if current_url.nil? - raise ArgumentError, "Missing required attribute 'outdir'" if outdir.nil? + # raise ArgumentError, "Missing required attribute 'outdir'" if outdir.nil? # Hardcoded file path file_path = File.expand_path('v3-mapping.json', __dir__) @@ -23,8 +23,13 @@ def initialize(doc) actual_url = '/guide' + path_dir + '/*/' + current_url - new_url = mapping[actual_url] - + + if mapping.key?(actual_url) + new_url = mapping[actual_url] + else + new_url = '/docs' + end + @header = Asciidoctor::Block.new(doc, :pass, source: <<~HTML)
From: CURRENT URL From 6f1ce82125981a4222730fed43b5aa98752455eb Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 17:39:49 +0100 Subject: [PATCH 17/29] Try without file read --- resources/asciidoctor/lib/chunker/url_to_v3.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index 2ef1fd2a162d4..0978a396443cb 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -14,9 +14,9 @@ def initialize(doc) # raise ArgumentError, "Missing required attribute 'outdir'" if outdir.nil? # Hardcoded file path - file_path = File.expand_path('v3-mapping.json', __dir__) - # Read content from the specified file and convert it to a dictionary - mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path) + # file_path = File.expand_path('v3-mapping.json', __dir__) + # # Read content from the specified file and convert it to a dictionary + # mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path) path_dir = outdir.sub('/tmp/docsbuild/target_repo/raw', '').split('/')[0...-1].join('/') @@ -24,11 +24,11 @@ def initialize(doc) actual_url = '/guide' + path_dir + '/*/' + current_url - if mapping.key?(actual_url) - new_url = mapping[actual_url] - else + # if mapping.key?(actual_url) + # new_url = mapping[actual_url] + # else new_url = '/docs' - end + # end @header = Asciidoctor::Block.new(doc, :pass, source: <<~HTML)
From a6fd90eaeb8a521041cdd9d5ab88724eaa5c5608 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 19:36:38 +0100 Subject: [PATCH 18/29] test --- resources/asciidoctor/lib/chunker/url_to_v3.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index 0978a396443cb..6a6a00e26c7de 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -18,8 +18,13 @@ def initialize(doc) # # Read content from the specified file and convert it to a dictionary # mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path) - - path_dir = outdir.sub('/tmp/docsbuild/target_repo/raw', '').split('/')[0...-1].join('/') + path_dir = if segments.empty? + '' + elsif segments.length > 1 + segments[0...-1].join('/') + else + segments[0] + end actual_url = '/guide' + path_dir + '/*/' + current_url From 61fd1116118f991d7356f9eb70cb415b0627a6e7 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 19:44:35 +0100 Subject: [PATCH 19/29] fix --- resources/asciidoctor/lib/chunker/url_to_v3.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index 6a6a00e26c7de..a30651515838b 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -18,6 +18,8 @@ def initialize(doc) # # Read content from the specified file and convert it to a dictionary # mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path) + segments = outdir.sub('/tmp/docsbuild/target_repo/raw', '').split('/') + path_dir = if segments.empty? '' elsif segments.length > 1 From 06f752ff049df9395c59c8dd0e30c6f22a94b0b0 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 21:19:23 +0100 Subject: [PATCH 20/29] test --- .../asciidoctor/lib/chunker/url_to_v3.rb | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index a30651515838b..562bd4c9a5933 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -13,10 +13,10 @@ def initialize(doc) # raise ArgumentError, "Missing required attribute 'current-url'" if current_url.nil? # raise ArgumentError, "Missing required attribute 'outdir'" if outdir.nil? - # Hardcoded file path - # file_path = File.expand_path('v3-mapping.json', __dir__) - # # Read content from the specified file and convert it to a dictionary - # mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path) + Hardcoded file path + file_path = File.expand_path('v3-mapping.json', __dir__) + # Read content from the specified file and convert it to a dictionary + mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path) segments = outdir.sub('/tmp/docsbuild/target_repo/raw', '').split('/') @@ -31,15 +31,15 @@ def initialize(doc) actual_url = '/guide' + path_dir + '/*/' + current_url - # if mapping.key?(actual_url) - # new_url = mapping[actual_url] - # else - new_url = '/docs' - # end + if mapping.key?(actual_url) + new_url = mapping[actual_url] + else + new_url = '/docs' + end @header = Asciidoctor::Block.new(doc, :pass, source: <<~HTML)
- From: CURRENT URL + From: #{actual_url} To: NEW URL
HTML From 31df99ffe8960ba7dd030d7659baf77ba206012b Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 21:44:00 +0100 Subject: [PATCH 21/29] fix --- resources/asciidoctor/lib/chunker/url_to_v3.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index 562bd4c9a5933..94021647375be 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -13,7 +13,7 @@ def initialize(doc) # raise ArgumentError, "Missing required attribute 'current-url'" if current_url.nil? # raise ArgumentError, "Missing required attribute 'outdir'" if outdir.nil? - Hardcoded file path + # Hardcoded file path file_path = File.expand_path('v3-mapping.json', __dir__) # Read content from the specified file and convert it to a dictionary mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path) @@ -30,7 +30,6 @@ def initialize(doc) actual_url = '/guide' + path_dir + '/*/' + current_url - if mapping.key?(actual_url) new_url = mapping[actual_url] else From 79283337afb5c973ca8dfd441a42ac385704c762 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Thu, 27 Mar 2025 22:38:10 +0100 Subject: [PATCH 22/29] test --- .buildkite/scripts/build_pr.sh | 1 + resources/asciidoctor/lib/chunker/url_to_v3.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.buildkite/scripts/build_pr.sh b/.buildkite/scripts/build_pr.sh index 38f8f97be4a2d..acbc55b45bb5b 100755 --- a/.buildkite/scripts/build_pr.sh +++ b/.buildkite/scripts/build_pr.sh @@ -228,6 +228,7 @@ PREVIEW_URL="https://${TARGET_BRANCH}.docs-preview.app.elstc.co" build_cmd="./build_docs --all \ --target_repo git@github.com:elastic/built-docs \ --reference /opt/git-mirrors/ \ + --skiplinkcheck \ --target_branch ${TARGET_BRANCH} \ --push \ --announce_preview ${PREVIEW_URL}/diff \ diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index 94021647375be..8c260d5f0cede 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -28,7 +28,7 @@ def initialize(doc) segments[0] end - actual_url = '/guide' + path_dir + '/*/' + current_url + actual_url = 'https://www.elastic.co/guide' + path_dir + '/*/' + current_url if mapping.key?(actual_url) new_url = mapping[actual_url] @@ -39,7 +39,7 @@ def initialize(doc) @header = Asciidoctor::Block.new(doc, :pass, source: <<~HTML)
From: #{actual_url} - To: NEW URL + To: NEW URL
HTML end From 0faad35b58bf74938a0339fef08c3178c21d3017 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 28 Mar 2025 00:23:25 +0100 Subject: [PATCH 23/29] ok --- .buildkite/scripts/build_pr.sh | 1 - resources/asciidoctor/lib/chunker/extension.rb | 4 ++-- resources/asciidoctor/lib/chunker/url_to_v3.rb | 11 +++++------ resources/web/template.html | 7 +++++++ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.buildkite/scripts/build_pr.sh b/.buildkite/scripts/build_pr.sh index acbc55b45bb5b..38f8f97be4a2d 100755 --- a/.buildkite/scripts/build_pr.sh +++ b/.buildkite/scripts/build_pr.sh @@ -228,7 +228,6 @@ PREVIEW_URL="https://${TARGET_BRANCH}.docs-preview.app.elstc.co" build_cmd="./build_docs --all \ --target_repo git@github.com:elastic/built-docs \ --reference /opt/git-mirrors/ \ - --skiplinkcheck \ --target_branch ${TARGET_BRANCH} \ --push \ --announce_preview ${PREVIEW_URL}/diff \ diff --git a/resources/asciidoctor/lib/chunker/extension.rb b/resources/asciidoctor/lib/chunker/extension.rb index 5c879a7479b46..cd12b2639b8c7 100644 --- a/resources/asciidoctor/lib/chunker/extension.rb +++ b/resources/asciidoctor/lib/chunker/extension.rb @@ -85,7 +85,7 @@ def add_nav(doc) def add_url_to_v3(doc) url_to_v3 = UrlToV3.new doc - doc.blocks.insert 0, url_to_v3.header + doc.blocks.insert 0, url_to_v3.url end def correct_xref(node) @@ -116,7 +116,7 @@ def form_section_into_page(doc, section, html) def add_subdoc_sections(doc, subdoc, html) nav = Nav.new subdoc url_to_v3 = UrlToV3.new subdoc - subdoc << url_to_v3.header + subdoc << url_to_v3.url subdoc << nav.header subdoc << Asciidoctor::Block.new(subdoc, :pass, source: html) subdoc << footnotes(doc, subdoc) if doc.footnotes? diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index 8c260d5f0cede..9b6e698b1b762 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -2,7 +2,7 @@ module Chunker class UrlToV3 - attr_reader :header + attr_reader :url def initialize(doc) current_url = doc.attr('current-url') @@ -28,7 +28,7 @@ def initialize(doc) segments[0] end - actual_url = 'https://www.elastic.co/guide' + path_dir + '/*/' + current_url + actual_url = '/guide' + path_dir + '/*/' + current_url if mapping.key?(actual_url) new_url = mapping[actual_url] @@ -36,10 +36,9 @@ def initialize(doc) new_url = '/docs' end - @header = Asciidoctor::Block.new(doc, :pass, source: <<~HTML) -
- From: #{actual_url} - To: NEW URL + @url = Asciidoctor::Block.new(doc, :pass, source: <<~HTML) + HTML end diff --git a/resources/web/template.html b/resources/web/template.html index 16f7989d58169..fab3ae86e492f 100644 --- a/resources/web/template.html +++ b/resources/web/template.html @@ -146,6 +146,13 @@ + From 2ebc16c7d0771b17d2183cc43e350c9c57f185ce Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 28 Mar 2025 16:54:12 +0100 Subject: [PATCH 24/29] Remove /guide prefix --- .../asciidoctor/lib/chunker/url_to_v3.rb | 2 +- .../asciidoctor/lib/chunker/v3-mapping.json | 152 +++++++++--------- 2 files changed, 77 insertions(+), 77 deletions(-) diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index 9b6e698b1b762..9e2011a0e1caf 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -28,7 +28,7 @@ def initialize(doc) segments[0] end - actual_url = '/guide' + path_dir + '/*/' + current_url + actual_url = path_dir + '/*/' + current_url if mapping.key?(actual_url) new_url = mapping[actual_url] diff --git a/resources/asciidoctor/lib/chunker/v3-mapping.json b/resources/asciidoctor/lib/chunker/v3-mapping.json index d03b9a6c8eeec..cb788f1b0620d 100644 --- a/resources/asciidoctor/lib/chunker/v3-mapping.json +++ b/resources/asciidoctor/lib/chunker/v3-mapping.json @@ -1,78 +1,78 @@ { - "/guide/en/kibana/*/api.html": "/docs/api/", - "/guide/en/kibana/*/apis.html": "/guide/en/kibana/8.18/apis.html", - "/guide/en/kibana/*/apm-alerts.html": "/docs/solutions/observability/apps/create-apm-rules-alerts", - "/guide/en/kibana/*/apm-annotation-api.html": "/docs/api/doc/kibana/operation/operation-createannotation", - "/guide/en/kibana/*/apm-api.html": "/docs/solutions/observability/apps/apm-server-api", - "/guide/en/kibana/*/apm-app-annotation-user-create.html": "/docs/solutions/observability/apps/applications-ui-annotation-user", - "/guide/en/kibana/*/apm-app-api-user.html": "/docs/solutions/observability/apps/applications-ui-api-user", - "/guide/en/kibana/*/apm-app-central-config-user.html": "/docs/solutions/observability/apps/applications-ui-central-config-user", - "/guide/en/kibana/*/apm-app-reader.html": "/docs/solutions/observability/apps/apm-reader-user", - "/guide/en/kibana/*/apm-app-storage-explorer-user-create.html": "/docs/solutions/observability/apps/applications-ui-storage-explorer-user", - "/guide/en/kibana/*/apm-app-users.html": "/docs/solutions/observability/apps/secure-access-to-applications-ui", - "/guide/en/kibana/*/apm-getting-started.html": "/docs/solutions/observability/apps/application-performance-monitoring-apm", - "/guide/en/kibana/*/apm-lambda.html": "/docs/solutions/observability/apps/observe-lambda-functions", - "/guide/en/kibana/*/apm-settings-in-kibana.html": "/docs/solutions/observability/apps/applications-ui-settings", - "/guide/en/kibana/*/apm-settings-kb.html": "/docs/reference/kibana/configuration-reference/apm-settings", - "/guide/en/kibana/*/apm-spaces.html": "/docs/solutions/observability/apps/control-access-to-apm-data", - "/guide/en/kibana/*/apm-ui.html": "/docs/solutions/observability/apps/overviews", - "/guide/en/kibana/*/application-service.html": "/docs/extend/kibana/application-service", - "/guide/en/kibana/*/arrange-panels.html": "/docs/explore-analyze/dashboards/arrange-panels", - "/guide/en/kibana/*/asset-tracking-tutorial.html": "/docs/explore-analyze/visualize/maps/asset-tracking-tutorial", - "/guide/en/kibana/*/automating-report-generation.html": "/docs/explore-analyze/report-and-share/automating-report-generation", - "/guide/en/kibana/*/banners-settings-kb.html": "/docs/reference/kibana/configuration-reference/banner-settings", - "/guide/en/kibana/*/batch-reindex-queue.html": "/docs/api/", - "/guide/en/kibana/*/batch-start-resume-reindex.html": "/docs/api/", - "/guide/en/kibana/*/beats-page.html": "/docs/deploy-manage/monitor/monitoring-data/beats-page", - "/guide/en/kibana/*/bedrock-action-type.html": "/docs/reference/kibana/connectors-kibana/bedrock-action-type", - "/guide/en/kibana/*/breaking-changes-summary.html": "/docs/release-notes/breaking-changes", - "/guide/en/kibana/*/brew.html": "/docs/deploy-manage/deploy/self-managed/install-kibana", - "/guide/en/kibana/*/building-kibana.html": "/docs/extend/kibana/building-kibana", - "/guide/en/kibana/*/cancel-reindex.html": "/docs/api/", - "/guide/en/kibana/*/canvas-function-reference.html": "/docs/reference/data-analysis/kibana/canvas-functions", - "/guide/en/kibana/*/canvas-present-workpad.html": "/docs/explore-analyze/visualize/canvas/canvas-present-workpad", - "/guide/en/kibana/*/canvas-tinymath-functions.html": "/docs/reference/data-analysis/kibana/tinymath-functions", - "/guide/en/kibana/*/canvas-tutorial.html": "/docs/explore-analyze/visualize/canvas/canvas-tutorial", - "/guide/en/kibana/*/canvas.html": "/docs/explore-analyze/visualize/canvas", - "/guide/en/kibana/*/cases-action-type.html": "/docs/reference/kibana/connectors-kibana/cases-action-type", - "/guide/en/kibana/*/cases-api-add-comment.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-create.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-delete-cases.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-delete-comments.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-find-case-activity.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-find-cases.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-find-connectors.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-get-alerts.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-get-case-activity.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-get-case.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-get-cases-by-alert.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-get-comments.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-get-reporters.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-get-status.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-get-tag.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-push.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-set-configuration.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-update-comment.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-update-configuration.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api-update.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-api.html": "/docs/api/", - "/guide/en/kibana/*/cases-get-configuration.html": "/docs/api/doc/kibana/group/endpoint-cases", - "/guide/en/kibana/*/cases-settings.html": "/docs/reference/kibana/configuration-reference/cases-settings", - "/guide/en/kibana/*/cases-webhook-action-type.html": "/docs/reference/kibana/connectors-kibana/cases-webhook-action-type", - "/guide/en/kibana/*/cases.html": "/docs/explore-analyze/alerts-cases/cases", - "/guide/en/kibana/*/chart-types.html": "/docs/explore-analyze/visualize/supported-chart-types", - "/guide/en/kibana/*/check-reindex-status.html": "/docs/api/", - "/guide/en/kibana/*/ci-metrics.html": "/docs/extend/kibana/ci-metrics", - "/guide/en/kibana/*/cli-commands.html": "/docs/reference/kibana/commands", - "/guide/en/kibana/*/configuration-service.html": "/docs/extend/kibana/configuration-service", - "/guide/en/kibana/*/configuring-monitoring.html": "/docs/deploy-manage/monitor/stack-monitoring/kibana-monitoring-self-managed", - "/guide/en/kibana/*/configuring-tls-communication.html": "/docs/deploy-manage/security/secure-your-cluster-deployment", - "/guide/en/kibana/*/configuring-tls.html": "/docs/deploy-manage/security/set-up-basic-security-plus-https", - "/guide/en/kibana/*/connect-to-elasticsearch.html": "/docs/manage-data/ingest", - "/guide/en/kibana/*/console-kibana.html": "/docs/explore-analyze/query-filter/tools/console", - "/guide/en/kibana/*/contributing.html": "/docs/extend/kibana/contributing", - "/guide/en/kibana/*/core-packages.html": "/docs/extend/kibana/core-packages", - "/guide/en/kibana/*/correlations.html": "/docs/solutions/observability/apps/find-transaction-latency-failure-correlations", - "/guide/en/kibana/*/create-a-dashboard-of-panels-with-ecommerce-data.html": "/docs/explore-analyze/dashboards/create-dashboard-of-panels-with-ecommerce-data", - "/guide/en/kibana/*/create-a-dashboard-of-panels-with-web-server-data.html": "/docs/explore-analyze/dashboards/create-dashboard-of-panels-with-web-server-data" + "/en/kibana/*/api.html": "/docs/api/", + "/en/kibana/*/apis.html": "/guide/en/kibana/8.18/apis.html", + "/en/kibana/*/apm-alerts.html": "/docs/solutions/observability/apps/create-apm-rules-alerts", + "/en/kibana/*/apm-annotation-api.html": "/docs/api/doc/kibana/operation/operation-createannotation", + "/en/kibana/*/apm-api.html": "/docs/solutions/observability/apps/apm-server-api", + "/en/kibana/*/apm-app-annotation-user-create.html": "/docs/solutions/observability/apps/applications-ui-annotation-user", + "/en/kibana/*/apm-app-api-user.html": "/docs/solutions/observability/apps/applications-ui-api-user", + "/en/kibana/*/apm-app-central-config-user.html": "/docs/solutions/observability/apps/applications-ui-central-config-user", + "/en/kibana/*/apm-app-reader.html": "/docs/solutions/observability/apps/apm-reader-user", + "/en/kibana/*/apm-app-storage-explorer-user-create.html": "/docs/solutions/observability/apps/applications-ui-storage-explorer-user", + "/en/kibana/*/apm-app-users.html": "/docs/solutions/observability/apps/secure-access-to-applications-ui", + "/en/kibana/*/apm-getting-started.html": "/docs/solutions/observability/apps/application-performance-monitoring-apm", + "/en/kibana/*/apm-lambda.html": "/docs/solutions/observability/apps/observe-lambda-functions", + "/en/kibana/*/apm-settings-in-kibana.html": "/docs/solutions/observability/apps/applications-ui-settings", + "/en/kibana/*/apm-settings-kb.html": "/docs/reference/kibana/configuration-reference/apm-settings", + "/en/kibana/*/apm-spaces.html": "/docs/solutions/observability/apps/control-access-to-apm-data", + "/en/kibana/*/apm-ui.html": "/docs/solutions/observability/apps/overviews", + "/en/kibana/*/application-service.html": "/docs/extend/kibana/application-service", + "/en/kibana/*/arrange-panels.html": "/docs/explore-analyze/dashboards/arrange-panels", + "/en/kibana/*/asset-tracking-tutorial.html": "/docs/explore-analyze/visualize/maps/asset-tracking-tutorial", + "/en/kibana/*/automating-report-generation.html": "/docs/explore-analyze/report-and-share/automating-report-generation", + "/en/kibana/*/banners-settings-kb.html": "/docs/reference/kibana/configuration-reference/banner-settings", + "/en/kibana/*/batch-reindex-queue.html": "/docs/api/", + "/en/kibana/*/batch-start-resume-reindex.html": "/docs/api/", + "/en/kibana/*/beats-page.html": "/docs/deploy-manage/monitor/monitoring-data/beats-page", + "/en/kibana/*/bedrock-action-type.html": "/docs/reference/kibana/connectors-kibana/bedrock-action-type", + "/en/kibana/*/breaking-changes-summary.html": "/docs/release-notes/breaking-changes", + "/en/kibana/*/brew.html": "/docs/deploy-manage/deploy/self-managed/install-kibana", + "/en/kibana/*/building-kibana.html": "/docs/extend/kibana/building-kibana", + "/en/kibana/*/cancel-reindex.html": "/docs/api/", + "/en/kibana/*/canvas-function-reference.html": "/docs/reference/data-analysis/kibana/canvas-functions", + "/en/kibana/*/canvas-present-workpad.html": "/docs/explore-analyze/visualize/canvas/canvas-present-workpad", + "/en/kibana/*/canvas-tinymath-functions.html": "/docs/reference/data-analysis/kibana/tinymath-functions", + "/en/kibana/*/canvas-tutorial.html": "/docs/explore-analyze/visualize/canvas/canvas-tutorial", + "/en/kibana/*/canvas.html": "/docs/explore-analyze/visualize/canvas", + "/en/kibana/*/cases-action-type.html": "/docs/reference/kibana/connectors-kibana/cases-action-type", + "/en/kibana/*/cases-api-add-comment.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-create.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-delete-cases.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-delete-comments.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-find-case-activity.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-find-cases.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-find-connectors.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-get-alerts.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-get-case-activity.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-get-case.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-get-cases-by-alert.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-get-comments.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-get-reporters.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-get-status.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-get-tag.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-push.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-set-configuration.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-update-comment.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-update-configuration.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api-update.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-api.html": "/docs/api/", + "/en/kibana/*/cases-get-configuration.html": "/docs/api/doc/kibana/group/endpoint-cases", + "/en/kibana/*/cases-settings.html": "/docs/reference/kibana/configuration-reference/cases-settings", + "/en/kibana/*/cases-webhook-action-type.html": "/docs/reference/kibana/connectors-kibana/cases-webhook-action-type", + "/en/kibana/*/cases.html": "/docs/explore-analyze/alerts-cases/cases", + "/en/kibana/*/chart-types.html": "/docs/explore-analyze/visualize/supported-chart-types", + "/en/kibana/*/check-reindex-status.html": "/docs/api/", + "/en/kibana/*/ci-metrics.html": "/docs/extend/kibana/ci-metrics", + "/en/kibana/*/cli-commands.html": "/docs/reference/kibana/commands", + "/en/kibana/*/configuration-service.html": "/docs/extend/kibana/configuration-service", + "/en/kibana/*/configuring-monitoring.html": "/docs/deploy-manage/monitor/stack-monitoring/kibana-monitoring-self-managed", + "/en/kibana/*/configuring-tls-communication.html": "/docs/deploy-manage/security/secure-your-cluster-deployment", + "/en/kibana/*/configuring-tls.html": "/docs/deploy-manage/security/set-up-basic-security-plus-https", + "/en/kibana/*/connect-to-elasticsearch.html": "/docs/manage-data/ingest", + "/en/kibana/*/console-kibana.html": "/docs/explore-analyze/query-filter/tools/console", + "/en/kibana/*/contributing.html": "/docs/extend/kibana/contributing", + "/en/kibana/*/core-packages.html": "/docs/extend/kibana/core-packages", + "/en/kibana/*/correlations.html": "/docs/solutions/observability/apps/find-transaction-latency-failure-correlations", + "/en/kibana/*/create-a-dashboard-of-panels-with-ecommerce-data.html": "/docs/explore-analyze/dashboards/create-dashboard-of-panels-with-ecommerce-data", + "/en/kibana/*/create-a-dashboard-of-panels-with-web-server-data.html": "/docs/explore-analyze/dashboards/create-dashboard-of-panels-with-web-server-data" } From edc3793ef7a1697f607caa75ceea38a741eae0da Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 28 Mar 2025 17:11:00 +0100 Subject: [PATCH 25/29] Refactor and cleanup --- extra/client_docs_landing.html | 4 +-- preview/preview.js | 2 +- .../asciidoctor/lib/chunker/url_to_v3.rb | 36 +++++++++---------- resources/web/air_gapped_template.html | 3 -- resources/web/style/page_header.pcss | 12 ++++++- resources/web/template.html | 11 +----- template/template.js | 5 +-- 7 files changed, 35 insertions(+), 38 deletions(-) diff --git a/extra/client_docs_landing.html b/extra/client_docs_landing.html index 543b8e2f01b49..aacd7cd310edc 100644 --- a/extra/client_docs_landing.html +++ b/extra/client_docs_landing.html @@ -51,8 +51,6 @@ } - -
@@ -181,4 +179,4 @@

View all Elastic docs

-

The Ruby logo available here is released under the Creative Commons Attribution-Share Alike 2.5 License. The Go gopher created by Renee French available here and the PHP logo available here are released under the Creative Commons Attribution-Share Alike 4.0 International license.

+

The Ruby logo available here is released under the Creative Commons Attribution-Share Alike 2.5 License. The Go gopher created by Renee French available here and the PHP logo available here are released under the Creative Commons Attribution-Share Alike 4.0 International license.

\ No newline at end of file diff --git a/preview/preview.js b/preview/preview.js index 3a7b462699cb7..6292de7df9369 100644 --- a/preview/preview.js +++ b/preview/preview.js @@ -82,7 +82,7 @@ const requestHandler = async (core, parsedUrl, response) => { const lang = await file.lang(); const initialJsState = await buildInitialJsState(file.alternativesReport); const templated = template.apply( - file.stream[Symbol.asyncIterator](), lang.trim(), initialJsState, path, + file.stream[Symbol.asyncIterator](), lang.trim(), initialJsState ); return new Promise((resolve, reject) => { file.stream.on("error", reject); diff --git a/resources/asciidoctor/lib/chunker/url_to_v3.rb b/resources/asciidoctor/lib/chunker/url_to_v3.rb index 9e2011a0e1caf..59605ceb39a55 100644 --- a/resources/asciidoctor/lib/chunker/url_to_v3.rb +++ b/resources/asciidoctor/lib/chunker/url_to_v3.rb @@ -7,18 +7,11 @@ class UrlToV3 def initialize(doc) current_url = doc.attr('current-url') outdir = doc.attr('outdir') - current_url ||= 'index.html' - - # raise ArgumentError, "Missing required attribute 'current-url'" if current_url.nil? - # raise ArgumentError, "Missing required attribute 'outdir'" if outdir.nil? - - # Hardcoded file path file_path = File.expand_path('v3-mapping.json', __dir__) - # Read content from the specified file and convert it to a dictionary mapping = JSON.parse(File.read(file_path)) if File.exist?(file_path) - - segments = outdir.sub('/tmp/docsbuild/target_repo/raw', '').split('/') + segments = outdir.sub('/tmp/docsbuild/target_repo/raw', '').split('/') # This only works in CI. + version = segments[-1] || 'unknown' path_dir = if segments.empty? '' @@ -29,18 +22,25 @@ def initialize(doc) end actual_url = path_dir + '/*/' + current_url - - if mapping.key?(actual_url) - new_url = mapping[actual_url] + new_url = if mapping.key?(actual_url) + mapping[actual_url] else - new_url = '/docs' + '/docs' end - @url = Asciidoctor::Block.new(doc, :pass, source: <<~HTML) - - HTML + if version == '8.18' + @url = Asciidoctor::Block.new(doc, :pass, source: <<~HTML) +
+ A newer version is available. For the latest information, see the current release documentation +
+ HTML + else + @url = Asciidoctor::Block.new(doc, :pass, source: <<~HTML) +
+ IMPORTANT: No additional bug fixes or documentation updates will be released for this version. For the latest information, see the current release documentation +
+ HTML + end end end end diff --git a/resources/web/air_gapped_template.html b/resources/web/air_gapped_template.html index 7428344c5a9ca..4067c8d44c8c8 100644 --- a/resources/web/air_gapped_template.html +++ b/resources/web/air_gapped_template.html @@ -60,9 +60,6 @@
-
- -
diff --git a/resources/web/style/page_header.pcss b/resources/web/style/page_header.pcss index 415c4b1f97c81..686cacfb062ae 100644 --- a/resources/web/style/page_header.pcss +++ b/resources/web/style/page_header.pcss @@ -5,9 +5,19 @@ border: 1px solid #ccc; background: #FFFFD2; color: black; + display: none; } - .abstract .page_header { + .version-warning { + padding: 1em; + margin-bottom: 1em; + border: 1px solid #ccc; + background: #FFFFD2; + color: black; + } + + .abstract .page_header, + .abstract .version-warning { width: 100%; } } diff --git a/resources/web/template.html b/resources/web/template.html index fab3ae86e492f..c651a0d0b9fa7 100644 --- a/resources/web/template.html +++ b/resources/web/template.html @@ -73,9 +73,6 @@
-
- -
@@ -85,6 +82,7 @@
+
@@ -146,13 +144,6 @@ - diff --git a/template/template.js b/template/template.js index d02cec2e27aab..27eccf6cb1e89 100644 --- a/template/template.js +++ b/template/template.js @@ -32,7 +32,7 @@ const readFile = promisify(fs.readFile); const stat = promisify(fs.stat); module.exports = templateSource => { - const apply = (rawItr, lang, initialJsState, destPath) => { + const apply = (rawItr, lang, initialJsState) => { /* * We apply the template by walking a stream for the template and a stream * for the raw page in parallel. We do this instead of pulling everything @@ -185,9 +185,10 @@ module.exports = templateSource => { const raw = fs.createReadStream(source, {encoding: 'UTF-8'}); const write = fs.createWriteStream(dest, {encoding: 'UTF-8'}); await new Promise((resolve, reject) => { - const out = apply(raw[Symbol.asyncIterator](), lang, initialJsState, dest); + const out = apply(raw[Symbol.asyncIterator](), lang, initialJsState); write.on("close", resolve); write.on("error", reject); + // out.on("error", write.destroy) doesn't properly forward the error! out.on("error", err => write.destroy(err)); out.pipe(write); }).finally(() => raw.close()); From 20842737aa76473606caa5398eeaef3c94fa914e Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 28 Mar 2025 17:21:39 +0100 Subject: [PATCH 26/29] Revert nav.rb --- resources/asciidoctor/lib/chunker/nav.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/asciidoctor/lib/chunker/nav.rb b/resources/asciidoctor/lib/chunker/nav.rb index 5fee967f4f939..785aa4f77a41a 100644 --- a/resources/asciidoctor/lib/chunker/nav.rb +++ b/resources/asciidoctor/lib/chunker/nav.rb @@ -11,10 +11,9 @@ class Nav attr_reader :header, :footer def initialize(doc) - body = nav_body doc @header = Asciidoctor::Block.new(doc, :pass, source: <<~HTML) -