docs: set_versions.py: show release name in switchers.js

Message ID 20220505104300.446038-1-foss+yocto@0leil.net
State New
Headers show
Series docs: set_versions.py: show release name in switchers.js | expand

Commit Message

Quentin Schulz May 5, 2022, 10:43 a.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Also show release names in the dropdown menu so that people have
knowledge of both the version number and release name of whatever
they're using or planning to use or upgrade to.

This patch will make the dropdown menu show the following entries:
Unstable (dev)
Kirkstone (4.0)
Honister (3.4.3)

Cc: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 documentation/set_versions.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Michael Opdenacker May 6, 2022, 9:49 a.m. UTC | #1
Hi Quentin,

On 5/5/22 12:43, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> Also show release names in the dropdown menu so that people have
> knowledge of both the version number and release name of whatever
> they're using or planning to use or upgrade to.
>
> This patch will make the dropdown menu show the following entries:
> Unstable (dev)
> Kirkstone (4.0)
> Honister (3.4.3)
>
> Cc: Quentin Schulz <foss+yocto@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>


Thanks for the patch, good idea!
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
... and merged into "master-next".

Cheers
Michael.

Patch

diff --git a/documentation/set_versions.py b/documentation/set_versions.py
index cd02cc739..733e1aa1a 100755
--- a/documentation/set_versions.py
+++ b/documentation/set_versions.py
@@ -211,7 +211,7 @@  with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch
             w.write(str(list(release_series.keys())))
             continue
         if "VERSIONS_PLACEHOLDER" in line:
-            w.write("    'dev': { 'title': 'dev (%s)', 'obsolete': false,},\n" % release_series[devbranch])
+            w.write("    'dev': { 'title': 'Unstable (dev)', 'obsolete': false,},\n")
             for branch in activereleases + ([ourseries] if ourseries not in activereleases else []):
                 if branch == devbranch:
                     continue
@@ -223,9 +223,9 @@  with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch
                 if branch_versions[-1] != "0":
                     version = version + "." + branch_versions[-1]
                 versions.append(version)
-                w.write("    '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch not in activereleases).lower()))
+                w.write("    '%s': {'title': '%s (%s)', 'obsolete': %s,},\n" % (version, branch.capitalize(), version, str(branch not in activereleases).lower()))
             if ourversion not in versions and ourseries != devbranch:
-                w.write("    '%s': {'title': '%s', 'obsolete': %s,},\n" % (ourversion, ourversion, str(ourseries not in activereleases).lower()))
+                w.write("    '%s': {'title': '%s (%s)', 'obsolete': %s,},\n" % (ourversion, ourseries.capitalize(), ourversion, str(ourseries not in activereleases).lower()))
         else:
             w.write(line)