From 6b69e59826f0d07752cab9dfa1e1da52246f6bf8 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:24:00 +0200 Subject: [PATCH 01/13] Move styles into SVG image --- _static/devguide_overrides.css | 70 +------------------ _tools/release_cycle_template.svg.jinja | 89 +++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 69 deletions(-) diff --git a/_static/devguide_overrides.css b/_static/devguide_overrides.css index 5b6d67b09..f652db366 100644 --- a/_static/devguide_overrides.css +++ b/_static/devguide_overrides.css @@ -6,16 +6,9 @@ height: 110px; } -/* Release cycle chart */ - -.release-cycle-chart { - width: 100%; -} - +/* Release cycle chart - theme-aware overrides */ .release-cycle-chart .release-cycle-year-line { stroke: var(--color-foreground-primary); - stroke-width: 0.8px; - opacity: 75%; } .release-cycle-chart .release-cycle-year-text { @@ -24,36 +17,16 @@ .release-cycle-chart .release-cycle-today-line { stroke: var(--color-brand-primary); - stroke-width: 1.6px; } .release-cycle-chart .release-cycle-row-shade { fill: var(--color-background-item); - opacity: 50%; } .release-cycle-chart .release-cycle-version-label { fill: var(--color-foreground-primary); } -.release-cycle-chart .release-cycle-blob { - stroke-width: 1.6px; - /* default colours, overridden below for individual statuses */ - fill: var(--color-background-primary); - stroke: var(--color-foreground-primary); -} - -.release-cycle-chart .release-cycle-blob-label { - /* white looks good on both light & dark */ - fill: white; -} - -.release-cycle-chart .release-cycle-blob-label.release-cycle-status-security, -.release-cycle-chart .release-cycle-blob-label.release-cycle-status-bugfix { - /* but use black to improve contrast for lighter backgrounds */ - fill: black; -} - .release-cycle-chart .release-cycle-blob-label.release-cycle-status-end-of-life, .release-cycle-chart .release-cycle-blob-label.release-cycle-status-prerelease, .release-cycle-chart .release-cycle-blob-label.release-cycle-status-feature { @@ -61,47 +34,6 @@ fill: var(--color-foreground-primary); } -.release-cycle-chart .release-cycle-status-end-of-life { - --status-bg-color: #DD2200; - --status-border-color: #FF8888; -} - -.release-cycle-chart .release-cycle-status-security { - --status-bg-color: #FFDD44; - --status-border-color: #FF8800; -} - -.release-cycle-chart .release-cycle-status-bugfix { - --status-bg-color: #00DD22; - --status-border-color: #008844; -} - -.release-cycle-chart .release-cycle-status-prerelease { - --status-bg-color: teal; - --status-border-color: darkgreen; -} - -.release-cycle-chart .release-cycle-status-feature { - --status-bg-color: #2222EE; - --status-border-color: #008888; -} - -.release-cycle-chart .release-cycle-blob { - fill: var(--status-bg-color); - stroke: transparent; -} - -.release-cycle-chart .release-cycle-blob-full { - fill: var(--status-bg-color); - stroke: var(--status-border-color); -} - -.release-cycle-chart .release-cycle-border { - fill: transparent; - stroke: var(--status-border-color); - stroke-width: 1.6px; -} - .good pre { border-left: 3px solid rgba(74, 182, 93, 1); } diff --git a/_tools/release_cycle_template.svg.jinja b/_tools/release_cycle_template.svg.jinja index d3d5866a0..91d20b2e2 100644 --- a/_tools/release_cycle_template.svg.jinja +++ b/_tools/release_cycle_template.svg.jinja @@ -4,6 +4,95 @@ class="release-cycle-chart" viewBox="0 0 {{ diagram_width }} {{ diagram_height }}" > + From a0195fcc41aa1dcffbce4096300d4c5d7e7fcaed Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:34:36 +0200 Subject: [PATCH 02/13] Put scalable vector graphics on the world wide web --- conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf.py b/conf.py index 0f6a820d8..68f7a640e 100644 --- a/conf.py +++ b/conf.py @@ -37,6 +37,10 @@ "source_branch": "main", } html_static_path = ['_static'] +html_extra_path = [ + 'include/release-cycle.svg', + 'include/release-cycle-all.svg', +] html_css_files = [ 'devguide_overrides.css', ] From abc7ce50adca832ccecf500ebf187598c11d3107 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 28 Nov 2025 22:12:44 +0200 Subject: [PATCH 03/13] Set a font in the SVG --- _tools/release_cycle_template.svg.jinja | 1 + 1 file changed, 1 insertion(+) diff --git a/_tools/release_cycle_template.svg.jinja b/_tools/release_cycle_template.svg.jinja index 91d20b2e2..e64debda8 100644 --- a/_tools/release_cycle_template.svg.jinja +++ b/_tools/release_cycle_template.svg.jinja @@ -7,6 +7,7 @@ @@ -105,6 +118,15 @@ {% for version in versions %} {% set y = version.y * line_height %} + + + Python {{ version.key }} + {% if version.y % 2 %} @@ -166,7 +188,7 @@ {% for version in versions %} - + {% set top_y = version.y * line_height - 1 * SCALE %} {% set height = 1.25 * SCALE %} @@ -174,8 +196,6 @@ {% set end_x = date_to_x(version.end_of_life_date) %} {% set radius = 0.25 * SCALE %} - {% set small_text_y = version.y * line_height - 0.1 * SCALE %} - + + + {% for version in versions %} + + + {% set start_x = date_to_x(version.first_release_date) %} + {% set end_x = date_to_x(version.end_of_life_date) %} + {% set middle_x = ([end_x, date_to_x(version.start_security_date)]|min) %} + {% set small_text_y = version.y * line_height - 0.1 * SCALE %} {% endfor %} - - - From 2f0db0bd80b9d7f109ff40bb28d6431e123d171a Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 2 Dec 2025 15:47:25 +0100 Subject: [PATCH 08/13] Draw outlines and text separately --- _tools/release_cycle_template.svg.jinja | 97 ++++++++++++------------- 1 file changed, 46 insertions(+), 51 deletions(-) diff --git a/_tools/release_cycle_template.svg.jinja b/_tools/release_cycle_template.svg.jinja index c41537942..89f9d9ad2 100644 --- a/_tools/release_cycle_template.svg.jinja +++ b/_tools/release_cycle_template.svg.jinja @@ -33,9 +33,6 @@ stroke-width: 0.8px; opacity: 75%; } - .release-cycle-year-text { - fill: var(--svg-color-foreground-primary); - } .release-cycle-today-line { stroke: var(--svg-color-brand-primary); stroke-width: var(--blob-border-width); @@ -44,36 +41,30 @@ fill: var(--svg-color-background-item); opacity: 50%; } - .release-cycle-version-label { - fill: var(--svg-color-foreground-primary); - } .release-cycle-blob { stroke-width: var(--blob-border-width); } - text { + .text-main { fill: var(--svg-color-foreground-primary); + /* use specific colours on known backgrounds */ + &.release-cycle-status-security, + &.release-cycle-status-bugfix { + fill: black; + } + } + .text-outline { /* an outline of the background color, in case it's not set - correctly */ + correctly */ + fill: transparent; stroke: var(--svg-color-background-primary); stroke-width: var(--blob-border-width); - /* draw stroke first (half of it will be visible as outline) */ - paint-order: stroke; /* use specific colours on known backgrounds */ - &.release-cycle-status-security , + &.release-cycle-status-security, &.release-cycle-status-bugfix { - fill: black; stroke: var(--status-bg-color); } - /* For year labels, keep outline below the row shading - (it's a separate element) */ - &.release-cycle-version-label-outline { - fill: transparent; - } - &.release-cycle-version-label { - stroke: none; - } } .release-cycle-status-end-of-life { --status-bg-color: #DD2200; @@ -120,7 +111,7 @@ {% set y = version.y * line_height %} - {{ format_year(year) }} - + {% for cls in ('text-outline', 'text-main') %} + + {{ format_year(year) }} + + {% endfor %} {% if not loop.last %} - - {{ version.status }} - + {% for cls in ('text-outline', 'text-main') %} + + {{ version.status }} + + {% endfor %} Date: Tue, 2 Dec 2025 15:48:41 +0100 Subject: [PATCH 09/13] Set background color explicitly --- _tools/release_cycle_template.svg.jinja | 32 +++++++++---------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/_tools/release_cycle_template.svg.jinja b/_tools/release_cycle_template.svg.jinja index 89f9d9ad2..744073335 100644 --- a/_tools/release_cycle_template.svg.jinja +++ b/_tools/release_cycle_template.svg.jinja @@ -27,6 +27,8 @@ width: 100%; --blob-border-width: 1.6px; + + background-color: var(--color-background-primary); } .release-cycle-year-line { stroke: var(--svg-color-foreground-primary); @@ -109,16 +111,6 @@ {% for version in versions %} {% set y = version.y * line_height %} - - - Python {{ version.key }} - - {% if version.y % 2 %} - {{ format_year(year) }} - - {% endfor %} + + {{ format_year(year) }} + {% if not loop.last %} Date: Tue, 2 Dec 2025 15:50:26 +0100 Subject: [PATCH 10/13] Fix --- _tools/release_cycle_template.svg.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_tools/release_cycle_template.svg.jinja b/_tools/release_cycle_template.svg.jinja index 744073335..20b3bc9c4 100644 --- a/_tools/release_cycle_template.svg.jinja +++ b/_tools/release_cycle_template.svg.jinja @@ -125,7 +125,7 @@ {% for year in years %} Date: Tue, 2 Dec 2025 16:18:18 +0100 Subject: [PATCH 11/13] Avoid :root --- _tools/release_cycle_template.svg.jinja | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/_tools/release_cycle_template.svg.jinja b/_tools/release_cycle_template.svg.jinja index 20b3bc9c4..ee44edbd6 100644 --- a/_tools/release_cycle_template.svg.jinja +++ b/_tools/release_cycle_template.svg.jinja @@ -5,7 +5,8 @@ viewBox="0 0 {{ diagram_width }} {{ diagram_height }}" >