Skip to content

Commit 968640d

Browse files
committed
website: annotate/decorate deprecated items
1 parent 210a3e7 commit 968640d

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

website/static/style.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,27 @@ h3:hover .anchor,
162162
border-radius: 0.5em;
163163
}
164164

165+
.deprecation-box {
166+
display: flex;
167+
align-items: center;
168+
gap: 0.75rem;
169+
padding: 0.75rem 1rem;
170+
margin: 1rem 0;
171+
background: #8b5a2b;
172+
border-left: 5px solid #f59e0b;
173+
border-right: 1px solid #f59e0b;
174+
border-top: 1px solid #f59e0b;
175+
border-bottom: 1px solid #f59e0b;
176+
border-radius: 0.5em;
177+
}
178+
179+
.toc-deprecated {
180+
color: #f59e0b;
181+
font-size: 0.8em;
182+
font-weight: normal;
183+
margin-left: 0.5em;
184+
}
185+
165186
a:has(code) {
166187
text-decoration: none;
167188
}

website/templates/_api_section.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
</div>
1919
{% endif %}
2020

21+
{% if item.deprecation %}
22+
<div class="deprecation-box">
23+
<span><strong>⚠️ Deprecated:</strong> {{ item.deprecation }}</span>
24+
</div>
25+
{% endif %}
26+
2127
{{ item.comment | markdown | safe }}
2228

2329
{% if section_id == "enums" %}

website/templates/macros.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ <h3>
1616
<div class="toc">
1717
<ul>
1818
{% for item in items %}
19-
<li><a href="#{{ item.anchor }}">{{ item.name }}</a></li>
19+
<li>
20+
<a href="#{{ item.anchor }}">
21+
{{ item.name }}
22+
</a>
23+
{% if item.deprecation %}
24+
<span class="toc-deprecated">⚠️ deprecated</span>
25+
{% endif %}
26+
</li>
2027
{% endfor %}
2128
</ul>
2229
</div>

0 commit comments

Comments
 (0)