Skip to content

Commit 5813c1c

Browse files
committed
Hide the starts of EOL versions
1 parent 223f178 commit 5813c1c

File tree

3 files changed

+52
-14
lines changed

3 files changed

+52
-14
lines changed

_static/devguide_overrides.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@
5454
fill: black;
5555
}
5656

57+
.release-cycle-chart .release-cycle-blob-label.release-cycle-status-end-of-life,
5758
.release-cycle-chart .release-cycle-blob-label.release-cycle-status-feature {
58-
/* and FG when it's not in a pill */
59+
/* and FG when it's not in a blob */
5960
fill: var(--color-foreground-primary);
6061
}
6162

_tools/generate_release_cycle.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,30 @@ def __init__(self, limit_to_active=False) -> None:
3939
version["start_security_date"] = r1 + dt.timedelta(days=2 * 365)
4040
version["end_of_life_date"] = parse_date(version["end_of_life"])
4141

42+
self.cutoff = min(ver["first_release_date"] for ver in self.versions.values())
43+
4244
if limit_to_active:
43-
cutoff = min(
45+
self.cutoff = min(
4446
version["first_release_date"]
4547
for version in self.versions.values()
4648
if version["status"] != 'end-of-life'
4749
)
4850
self.versions = {
4951
key: version
5052
for key, version in self.versions.items()
51-
if version["end_of_life_date"] >= cutoff
53+
if version["end_of_life_date"] >= self.cutoff
5254
}
55+
self.id_key='active'
56+
else:
57+
self.id_key='all'
5358

5459
self.sorted_versions = sorted(
5560
self.versions.values(),
5661
key=lambda v: [int(i) for i in v["key"].split(".")],
5762
reverse=True,
5863
)
5964

65+
6066
def write_csv(self) -> None:
6167
"""Output CSV files."""
6268
now_str = str(dt.datetime.now(dt.timezone.utc))
@@ -110,7 +116,7 @@ def write_svg(self, today: str, out_path: str) -> None:
110116
# some positioning numbers in the template as well.
111117
LINE_HEIGHT = 1.5
112118

113-
first_date = min(ver["first_release_date"] for ver in self.sorted_versions)
119+
first_date = self.cutoff
114120
last_date = max(ver["end_of_life_date"] for ver in self.sorted_versions)
115121

116122
def date_to_x(date: dt.date) -> float:
@@ -136,11 +142,14 @@ def format_year(year: int) -> str:
136142
diagram_height=(len(self.sorted_versions) + 2) * LINE_HEIGHT,
137143
years=range(first_date.year, last_date.year + 1),
138144
LINE_HEIGHT=LINE_HEIGHT,
145+
LEGEND_WIDTH=LEGEND_WIDTH,
146+
RIGHT_MARGIN=RIGHT_MARGIN,
139147
versions=list(reversed(self.sorted_versions)),
140148
today=dt.datetime.strptime(today, "%Y-%m-%d").date(),
141149
year_to_x=year_to_x,
142150
date_to_x=date_to_x,
143151
format_year=format_year,
152+
id_key=self.id_key,
144153
).dump(f)
145154

146155

_tools/release_cycle_template.svg.jinja

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
class="release-cycle-chart"
55
viewBox="0 0 {{ diagram_width * SCALE }} {{ diagram_height * SCALE }}"
66
>
7+
<defs>
8+
<linearGradient id="release-cycle-mask-gradient-{{ id_key }}">
9+
<stop stop-color="black" offset="0%" />
10+
<stop stop-color="white" offset="100%" />
11+
</linearGradient>
12+
</defs>
713

814
{% for version in versions %}
915
{% set y = loop.index * LINE_HEIGHT %}
@@ -42,6 +48,31 @@
4248
{% endif %}
4349
{% endfor %}
4450

51+
<!-- Gradient mask to fade out end-of-life versions -->
52+
<mask id="release-cycle-mask-{{ id_key }}">
53+
<rect
54+
x="0"
55+
y="0"
56+
width="{{ LEGEND_WIDTH * SCALE }}"
57+
height="{{ diagram_height * SCALE }}"
58+
fill="black"
59+
/>
60+
<rect
61+
x="{{ (LEGEND_WIDTH - RIGHT_MARGIN) * SCALE }}"
62+
y="0"
63+
width="{{ RIGHT_MARGIN * SCALE }}"
64+
height="{{ diagram_height * SCALE }}"
65+
fill="url(#release-cycle-mask-gradient-{{ id_key }})"
66+
/>
67+
<rect
68+
x="{{ (LEGEND_WIDTH ) * SCALE }}"
69+
y="0"
70+
width="{{ diagram_width * SCALE }}"
71+
height="{{ diagram_height * SCALE }}"
72+
fill="white"
73+
/>
74+
</mask>
75+
4576
{% for version in versions %}
4677
{% set y = loop.index * LINE_HEIGHT %}
4778

@@ -74,7 +105,7 @@
74105
{% set radius_value = 0.25 * SCALE %}
75106

76107
{% if version.status != "end-of-life" %}
77-
<!-- Split the pill -->
108+
<!-- Split the blob -->
78109
<path
79110
class="release-cycle-blob release-cycle-status-bugfix"
80111
d="
@@ -109,6 +140,7 @@
109140
height="{{ 1.25 * SCALE }}"
110141
rx="0.25em"
111142
ry="0.25em"
143+
mask="url(#release-cycle-mask-{{ id_key }})"
112144
/>
113145
<rect
114146
class="release-cycle-border release-cycle-status-{{ version.status }}"
@@ -118,6 +150,7 @@
118150
height="{{ 1.25 * SCALE }}"
119151
rx="0.25em"
120152
ry="0.25em"
153+
mask="url(#release-cycle-mask-{{ id_key }})"
121154
/>
122155
{% if version.status == "bugfix" %}
123156
<text
@@ -142,27 +175,22 @@
142175
{% elif version.status == "end-of-life" %}
143176
<text
144177
class="release-cycle-blob-label release-cycle-status-end-of-life"
145-
{% if version.key != "3.0" %}
146-
x="{{ (start_x + end_x) / 2 * SCALE }}"
147-
text-anchor="middle"
148-
{% else %}
149-
x="{{ (end_x + 0.25) * SCALE }}"
150-
text-anchor="start"
151-
{% endif %}
178+
x="{{ (end_x + 0.25) * SCALE }}"
179+
text-anchor="start"
152180
y="{{ (y - 0.1) * SCALE }}"
153181
font-size="{{ SCALE * 0.75 }}"
154182
>
155183
end-of-life
156184
</text>
157-
{% elif version.status == "feature" %}
185+
{% else %}
158186
<text
159187
class="release-cycle-blob-label release-cycle-status-feature"
160188
x="{{ (start_x - 0.5) * SCALE }}"
161189
y="{{ (y - 0.1) * SCALE }}"
162190
font-size="{{ SCALE * 0.75 }}"
163191
text-anchor="end"
164192
>
165-
feature
193+
{{ version.status }}
166194
</text>
167195
{% endif %}
168196
{% endfor %}

0 commit comments

Comments
 (0)