forked from python/devguide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease_cycle_template.svg.jinja
91 lines (84 loc) · 2.78 KB
/
release_cycle_template.svg.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?xml version="1.0" encoding="UTF-8"?>
<svg
xmlns="http://www.w3.org/2000/svg"
class="release-cycle-chart"
viewBox="0 0 {{ diagram_width * SCALE }} {{ diagram_height * SCALE }}"
>
{% for version in versions %}
{% set y = loop.index * LINE_HEIGHT %}
{% if loop.index % 2 %}
<!-- Row shading -->
<rect
class="release-cycle-row-shade"
x="0em"
y="{{ (y - 1.125) * SCALE }}"
width="{{ diagram_width * SCALE }}"
height="{{ LINE_HEIGHT * SCALE }}"
/>
{% endif %}
{% endfor %}
{% for year in years %}
<text
class="release-cycle-year-text"
x="{{ (year_to_x(year) + year_to_x(year + 1)) / 2 * SCALE }}"
y="{{ (diagram_height - LINE_HEIGHT) * SCALE }}"
font-size="{{ SCALE * 0.75 }}"
text-anchor="middle"
>
{{ format_year(year) }}
</text>
{% if not loop.last %}
<line
class="release-cycle-year-line"
x1="{{ year_to_x(year + 1) * SCALE }}"
x2="{{ year_to_x(year + 1) * SCALE }}"
y1="0"
y2="{{ (diagram_height - LINE_HEIGHT) * SCALE }}"
font-size="{{ SCALE }}"
/>
{% endif %}
{% endfor %}
{% for version in versions %}
{% set y = loop.index * LINE_HEIGHT %}
<!-- Legend on the left -->
<text
class="release-cycle-version-label"
x="{{ 0.5 * SCALE }}"
y="{{ y * SCALE }}"
font-size="{{ SCALE }}"
>
Python {{ version.key }}
</text>
<!-- Colourful blob with a label -->
{% set start_x = date_to_x(version.first_release_date) %}
{% set end_x = date_to_x(version.end_of_life_date) %}
{% set mid_x = (start_x + end_x) / 2 %}
<rect
class="release-cycle-blob release-cycle-blob-{{ version.status }}"
x="{{ start_x * SCALE }}"
y="{{ (y - 1) * SCALE }}"
width="{{ (end_x - start_x) * SCALE }}"
height="{{ 1.25 * SCALE }}"
rx="0.25em"
ry="0.25em"
/>
<text
class="release-cycle-blob-label release-cycle-blob-{{ version.status }}"
x="{{ mid_x * SCALE }}"
y="{{ (y - 0.1) * SCALE }}"
font-size="{{ SCALE * 0.75 }}"
text-anchor="middle"
>
{{ version.status }}
</text>
{% endfor %}
<!-- A line for today -->
<line
class="release-cycle-today-line"
x1="{{ date_to_x(today) * SCALE }}"
x2="{{ date_to_x(today) * SCALE }}"
y1="0"
y2="{{ (diagram_height - LINE_HEIGHT) * SCALE }}"
font-size="{{ SCALE }}"
/>
</svg>