Browse Source

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

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>
(From yocto-docs rev: 83867cd979810a023eb7e2d243782e6202873273)

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Quentin Schulz 3 years ago
parent
commit
4d111eb737
1 changed files with 3 additions and 3 deletions
  1. 3 3
      documentation/set_versions.py

+ 3 - 3
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)