Skip to content

Show a property's reference link above its show properties toggle - #4377

Merged
akira28 merged 4 commits into
mainfrom
api-explorer/property-docs-link-first
Oct 9, 2026
Merged

akira28 merged 4 commits into
mainfrom
api-explorer/property-docs-link-first

Conversation

@akira28

@akira28 akira28 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

On API Explorer property rows, the reference documentation link now sits right above "show properties", indented and sized like that toggle but rendered as a link. A link without text from the spec reads "Reference". External documentation links also get working target="_blank" and rel="noopener" attributes again.

Affects: API reference

Prompt summary: The author asked to move a property's reference link so it is easier to find. After trying it under the name and on the name line, which crowded that line, the author settled on a row just above "show properties", in the same font and indent but as a link. While moving it, the link's attributes turned out to render HTML-encoded on every page type, so this PR fixes them too.

Why

A property's "Read the reference documentation" link sat as a full-width line between its description and the row's other details, such as enum values or union options, so it read like part of the description rather than a separate action. External documentation links also wrote their attributes as a quoted string inside a Razor expression, so they rendered as target="_blank" rel="noopener". Browsers read that as a window named "_blank" and an unknown rel value, so noopener never applied. This affected 80 links on the Elasticsearch and Kibana pages.

What

The link sits above "show properties"

On property rows, the reference link gets a row of its own after the description and the row's other details, right above the "show properties" toggle. It uses the toggle's indent, text-sm font and L-shaped tree branch, rendered as a link. When the toggle follows, it drops its top margin and the branch line runs on into the toggle's, so the link and the toggle hang off one line. A link without text from the spec reads "Reference", or "External docs" for another site; spec text, such as "Query DSL", is kept. A row without a toggle shows the link alone at the same indent. The Markdown export has no property reference links, so it is unchanged.

Attributes that work

The six external documentation links, on property rows and on operation, schema and tag pages, now use Razor conditional attributes. An external link renders target="_blank" rel="noopener", or noopener noreferrer on tag pages. An elastic.co link renders neither.

Where to look

Case Example Link
Link above "show properties", one tree branch chunking_settings: "Reference"; expand it to see the line run into the child rows open
Link with the spec's own text source.query: "Query DSL" open
Link without a toggle, a plain L pipeline: "Reference" open
External link, opens in a new tab service_settings.model: "External docs", with target="_blank" rel="noopener" open

A request body may start collapsed; open it to see the row.

Verify

dotnet run --project tests/Elastic.ApiExplorer.Tests
# PropertyItemRenderingTests: link after the description and above the toggle, real target/rel attributes
dotnet run --project src/tooling/docs-builder -- serve
# /api/doc/elasticsearch/operation/operation-inference-put-alibabacloud/#req-chunking_settings

Out of scope: _TocTreeNav.cshtml and _TocTreeNavLegacy.cshtml in the site navigation write hx-boost="false" the same way, so it renders HTML-encoded too. That is site navigation rather than the API Explorer, and is left for its own change.

🤖 Generated with Claude Code

A property's "Read the reference documentation" link came after its
description, so a reader went through the text before finding it. It
now sits right under the property's name and type.

External documentation links rendered their attributes HTML-encoded, as
`target="_blank" rel="noopener"`. Browsers read that
as a window named `"_blank"` and an unknown `rel`, so `noopener` did not
apply. The six links on property rows, operation, schema and tag pages
now use conditional attributes and render `target="_blank"
rel="noopener"`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akira28
akira28 requested a review from a team as a code owner October 9, 2026 08:00
@akira28
akira28 requested a review from technige October 9, 2026 08:00
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Docs preview (local build)

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

The reference link sat on a line of its own under the property's name.
It now follows the name, type and badges on the same line. The default
"Read the reference documentation" was too long to fit there and
wrapped onto its own line again, so a property link without text from
the spec reads "Reference", or "External docs" for another site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akira28 akira28 changed the title Show a property's reference link under its name Show a property's reference link next to its name Oct 9, 2026
On the name line the link crowded the name, type and badges. It now
gets a row of its own after the description and the row's other
details, right above "show properties". It uses the toggle's indent and
font, rendered as a link, so the two read as one block under the
description. The short "Reference" wording stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akira28 akira28 changed the title Show a property's reference link next to its name Show a property's reference link above its show properties toggle Oct 9, 2026
The reference link row sat at the "show properties" indent without the
toggle's tree line, so it floated between the description and the
branch. It now draws the same L-shaped connector. With the toggle below,
the line runs on into the toggle's branch, so the link and the toggle
hang off one line; on its own, the row ends in an L.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akira28
akira28 merged commit d379408 into main Oct 9, 2026
32 checks passed
@akira28
akira28 deleted the api-explorer/property-docs-link-first branch October 9, 2026 10:46
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