Skip to content

Show Base URL and version on API product landings - #4034

Open
reakaleek wants to merge 1 commit into
mainfrom
cursor/3ad713fa
Open

Show Base URL and version on API product landings#4034
reakaleek wants to merge 1 commit into
mainfrom
cursor/3ad713fa

Conversation

@reakaleek

Copy link
Copy Markdown
Member

API product landings now show a copyable Base URL, license, and version when those fields exist on the OpenAPI document. The catalog table stays in place. An empty License: line no longer appears when the spec has no license.

Affects: API reference, Site UI

Prompt summary: Implement https://github.com/elastic/docs-eng-team/issues/814. Add a Base URL row with copy on the product landing when document.Servers is present. Show license and version only when those fields exist on info. Keep the operation catalog. Do not replace the landing with the Introduction topic.

Why

The product landing already prints title, description, and a full operation catalog. It does not show servers, so a reader cannot copy the Base URL. It always prints License: even when info.license is missing. Operation pages already list servers, but .server-url has no copy control.

Implements https://github.com/elastic/docs-eng-team/issues/814.

What

Landing extras

LandingInfoNote is built once from the OpenAPI document. The landing view prints Base URL, license, and version only when those values exist. License becomes a link when info.license.url is set. Source and last-update stay out. OpenAPI info does not have those fields.

Copy on server URLs

initCopyButton also targets .server-url. The button is appended inside that chip so hover CSS can show it. Code-block buttons still insert after the pre. Operation pages pick up the same copy control.

Markdown export

LandingCommonMark.Product takes the same LandingInfoNote and writes matching Base URL, license, and version lines.

Verify

dotnet test tests/Elastic.ApiExplorer.Tests/
# Generate_FixtureProductLandingHtml_ContainsBaseUrlLicenseVersionAndCatalog
# Generate_FixtureProductLandingMarkdown_ContainsBaseUrlLicenseVersionAndCatalog
# Generate_TitleOnlyDocument_OmitsEmptyInfoHeadings

Run against local preview or staging. Production /docs/api/* still proxies to bump.sh.

Out of scope: Source and last-update rows. Those fields are not on OpenAPI info.

Made with Cursor

The landing printed an empty License line and hid the servers list. Readers could not copy a Base URL.

Co-Authored-By: Cursor Grok 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Docs preview (local build)

Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4034/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant