Skip to content

Commit fa6ae2f

Browse files
committed
DEV: commands: graphically tag deprecated commands
1 parent 418b54f commit fa6ae2f

File tree

3 files changed

+95
-6
lines changed

3 files changed

+95
-6
lines changed

assets/css/index.css

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,81 @@ a[href*="#no-click"], img[src*="#no-click"] {
15311531
@apply bg-redis-pen-200 font-semibold;
15321532
}
15331533

1534+
/* Deprecated Command Styles */
1535+
.deprecated-badge {
1536+
display: inline-flex !important;
1537+
align-items: center !important;
1538+
padding: 0.25rem 0.5rem !important;
1539+
font-size: 0.75rem !important;
1540+
font-weight: 500 !important;
1541+
background-color: #fed7aa !important;
1542+
color: #9a3412 !important;
1543+
border-radius: 9999px !important;
1544+
border: 1px solid #fdba74 !important;
1545+
flex-shrink: 0 !important;
1546+
}
1547+
1548+
.deprecated-tooltip {
1549+
position: absolute !important;
1550+
z-index: 9999 !important;
1551+
padding: 0.5rem 0.75rem !important;
1552+
font-size: 0.875rem !important;
1553+
font-weight: 500 !important;
1554+
color: white !important;
1555+
background-color: #111827 !important;
1556+
border-radius: 0.5rem !important;
1557+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
1558+
opacity: 0 !important;
1559+
visibility: hidden !important;
1560+
transition: opacity 300ms ease-in-out !important;
1561+
pointer-events: none !important;
1562+
white-space: nowrap !important;
1563+
bottom: calc(100% + 8px) !important;
1564+
left: 50% !important;
1565+
transform: translateX(-50%) !important;
1566+
}
1567+
1568+
.deprecated-tooltip::before {
1569+
content: '' !important;
1570+
position: absolute !important;
1571+
top: 100% !important;
1572+
left: 50% !important;
1573+
transform: translateX(-50%) !important;
1574+
width: 0 !important;
1575+
height: 0 !important;
1576+
border-left: 5px solid transparent !important;
1577+
border-right: 5px solid transparent !important;
1578+
border-top: 5px solid #111827 !important;
1579+
}
1580+
1581+
.deprecated-tooltip-trigger {
1582+
position: relative !important;
1583+
display: inline-flex !important;
1584+
z-index: 10 !important;
1585+
}
1586+
1587+
.deprecated-tooltip-trigger:hover .deprecated-tooltip {
1588+
opacity: 1 !important;
1589+
visibility: visible !important;
1590+
}
1591+
1592+
.command-title-deprecated {
1593+
display: flex !important;
1594+
align-items: center !important;
1595+
gap: 0.5rem !important;
1596+
flex-wrap: nowrap !important;
1597+
}
1598+
1599+
.command-title-deprecated .truncate {
1600+
flex: 1 1 0% !important;
1601+
min-width: 0 !important;
1602+
}
1603+
1604+
/* Fix alignment on individual command pages */
1605+
.prose h1.command-name .command-title-deprecated {
1606+
align-items: center !important;
1607+
}
1608+
15341609
/* Utility Classes */
15351610
.agent-builder-hidden {
15361611
display: none !important;

layouts/commands/list.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,20 @@ <h1>Commands</h1>
111111
data-version
112112
data-top
113113
>
114-
<h1 class="truncate font-mono font-medium text-lg mb-1.5 px-6">
115-
{{ .Title }}
114+
<h1 class="font-mono font-medium text-lg mb-1.5 px-6">
115+
<div class="command-title-deprecated">
116+
<span class="truncate">{{ .Title }}</span>
117+
{{ if (and (isset .Params "doc_flags") (in .Params.doc_flags "deprecated")) }}
118+
<div class="deprecated-tooltip-trigger">
119+
<span class="deprecated-badge">Deprecated</span>
120+
{{ if (isset .Params "replaced_by") }}
121+
<div class="deprecated-tooltip">
122+
Use {{ .Params.replaced_by | markdownify | plainify }} instead
123+
</div>
124+
{{ end }}
125+
</div>
126+
{{ end }}
127+
</div>
116128
</h1>
117129
<p class="px-6">
118130
{{ .Params.summary }}

layouts/commands/single.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
{{ partial "breadcrumbs" . }}
1313
<section class="prose w-full py-12">
1414
<h1 class="command-name">
15-
{{- .Title }}
16-
{{- if (isset .Params "deprecated_since") }}
17-
<span class="text-base">(deprecated)</span>
18-
{{- end }}
15+
<div class="command-title-deprecated">
16+
{{- .Title }}
17+
{{- if (and (isset .Params "doc_flags") (in .Params.doc_flags "deprecated")) }}
18+
<span class="deprecated-badge">Deprecated</span>
19+
{{- end }}
20+
</div>
1921
</h1>
2022
{{ if (isset .Params "deprecated_since") }}
2123
<div class="border-l-8 pl-4">

0 commit comments

Comments
 (0)