elastic / elastic/docs-builder

[Feature Request]: automate ordering of applies-switch tabs and badges

Open
#2,424 6 comments 1 reaction 2 assignees Claimed by @reakaleek View on GitHub
ai-triaged ai:eng-question ai:writer-question enhancement
Dominant language
C#
Stars
24
Forks
44
Avg merge
1d 7h
Merged PRs (30d)
146

Description

### Prerequisites

- [x] I have searched existing issues to ensure this feature hasn't already been requested
- [x] I have tested using the latest version of docs-builder

### What problem are you trying to solve?

Right now we render tabs as they are ordered in source files. While this is a best practice communicated to writers to order tabs (and also lists) a certain way for version and deployment related cases, it's not easy to enforce it. If possible, we should automate this whenever possible to increase the consistency of our docs

### Proposed Solution

The ideal ordering is as follows:

- For versions: serverless first, then stack from latest to oldest
- for deployments: serverless first, then ech (ess), then ece, then eck, then self-managed

I think this is possible to control:
- in applies-switch components to order the tabs, knowing that this component should be used for all cases that concern versions and deployments tabbed content.
- for ordering badges inside of the same applies-switch tab (in case of multiple values)
- for ordering badges at the top of pages and at section levels

If you think this is applicable to bullet lists as well, that would be nice too.

Exceptions: "unavailable" applies_to should be last. We shouldn't have many (or even any) occurrences given our current approach, but that's just to be safe, as well as if we want to reuse this logic to determine the ordering of badges at the page and section levels.

### Examples and Research

_No response_

### Alternative Solutions

_No response_

### Additional Context

_No response_

### How important is this feature to you?

Important

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.