Skip to content

Fix applies_to rendering in LLM readable markdown output - #2451

Merged
reakaleek merged 7 commits into
mainfrom
feature/applies-to-llm-md
Jan 13, 2026
Merged

reakaleek merged 7 commits into
mainfrom
feature/applies-to-llm-md

Conversation

@reakaleek

@reakaleek reakaleek commented Jan 12, 2026 •

Copy link
Copy Markdown
Member

What

Adds human-readable rendering of applies_to metadata in LLM markdown output. Previously, this information was only available in HTML popovers.

Why

LLMs need clear, structured applicability information (product availability, versions, lifecycle status) to answer questions accurately about feature availability across different Elastic products and versions.

How

  • Created LlmApplicabilityHelper to convert ApplicableTo objects into human-readable strings (e.g., "Elastic Stack: Generally available since 7.3")
  • Updated LLM renderers to use this helper for:
    • Inline {applies_to} roles → <applies-to>Elastic Stack: Generally available since 7.3</applies-to>
    • Block directive attributes → applies-to="Elastic Stack: Generally available since 8.0"
    • Code block directives → <applies-to> list format
    • YAML frontmatter → YAML list in metadata
  • Uses the same text generation logic as web popover components for consistency

Examples

Inline role:

Input:  This feature {applies_to}`stack: ga 7.3` is available.
Output: This feature <applies-to>Elastic Stack: Generally available since 7.3</applies-to> is available.

Admonition directive:

Input:  :::{note}
       :applies_to: stack: ga, serverless: ga
       This applies to both.
       :::
Output: <note applies-to="Elastic Cloud Serverless: Generally available, Elastic Stack: Generally available in 8.0+">
        This applies to both.
        </note>

Code block directive:

Input:  ```{applies_to}
       stack: ga 7.0
       serverless: ga
       ```
Output: <applies-to>
        - Elastic Cloud Serverless: Generally available
        - Elastic Stack: Generally available since 7.0
        </applies-to>

Frontmatter:

Input:  ---
       applies_to:
         stack: ga 9.1
       ---
Output: ---
       title: Page Title
       applies_to:
         - Elastic Stack: Generally available since 9.1
       ---

<span class="admonition-title">Warning</span>
<span class="applies applies-admonition">
<applies-to-popover badge-key="Serverless" badge-version="8.0+" lifecycle-class="ga" lifecycle-name="GA" show-lifecycle-name="false" show-version="true" has-multiple-lifecycles="false" popover-data="{&quot;productDescription&quot;:&quot;\u003Cstrong\u003EElastic Cloud Serverless\u003C/strong\u003E projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.&quot;,&quot;availabilityItems&quot;:[{&quot;text&quot;:&quot;Generally available in 8.0\u002B&quot;,&quot;lifecycleDescription&quot;:&quot;This functionality is generally available and ready for production usage.&quot;}],&quot;additionalInfo&quot;:&quot;Serverless interfaces and procedures might differ from classic Elastic Stack deployments.&quot;,&quot;showVersionNote&quot;:false,&quot;versionNote&quot;:null}" show-popover="true" is-inline="true"></applies-to-popover>
<applies-to-popover badge-key="Serverless" lifecycle-class="ga" lifecycle-name="GA" show-lifecycle-name="false" show-version="false" has-multiple-lifecycles="false" popover-data="{&quot;productDescription&quot;:&quot;\u003Cstrong\u003EElastic Cloud Serverless\u003C/strong\u003E projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.&quot;,&quot;availabilityItems&quot;:[{&quot;text&quot;:&quot;Generally available&quot;,&quot;lifecycleDescription&quot;:&quot;This functionality is generally available and ready for production usage.&quot;}],&quot;additionalInfo&quot;:&quot;Serverless interfaces and procedures might differ from classic Elastic Stack deployments.&quot;,&quot;showVersionNote&quot;:false,&quot;versionNote&quot;:null}" show-popover="true" is-inline="true"></applies-to-popover>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changed because I changed the base version in the test fixtures to "allVersions"

@reakaleek reakaleek changed the title Fix applies_to rendering in LLM readabile markdown output Fix applies_to rendering in LLM readable markdown output Jan 12, 2026
reakaleek and others added 2 commits January 12, 2026 15:15
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@reakaleek reakaleek self-assigned this Jan 12, 2026
@reakaleek reakaleek added the fix label Jan 12, 2026
@reakaleek
reakaleek marked this pull request as ready for review January 12, 2026 16:16
@reakaleek
reakaleek requested a review from a team as a code owner January 12, 2026 16:16
@reakaleek
reakaleek requested a review from cotti January 12, 2026 16:16
@reakaleek

Copy link
Copy Markdown
Member Author

You can find examples in

@reakaleek
reakaleek merged commit 7bdf047 into main Jan 13, 2026
27 checks passed
@reakaleek
reakaleek deleted the feature/applies-to-llm-md branch January 13, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants