summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2022-04-14 13:33:26 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-19 12:37:42 +0100
commit8643342d80a73f14a84dcc4c9aed2e67a452cb5c (patch)
tree2be155de44fcf0a79008d00e30cd29e5d5c12112
parent7b3a83f7369f9688109fd19394f0b6998dd6eae7 (diff)
downloadpoky-8643342d80a73f14a84dcc4c9aed2e67a452cb5c.tar.gz
docs: set_versions.py: add information about obsolescence of a release
This adds support for marking releases as obsolete to make the detection algorithm smarter (in a later commit) than just checking if it's older than dunfell. Cc: Quentin Schulz <foss+yocto@0leil.net> (From yocto-docs rev: 6f40ef56054ecbd3d8b7310d748c1af78a689add) Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xdocumentation/set_versions.py6
-rw-r--r--documentation/sphinx-static/switchers.js.in12
2 files changed, 9 insertions, 9 deletions
diff --git a/documentation/set_versions.py b/documentation/set_versions.py
index fceff4dbce..0fcbb993be 100755
--- a/documentation/set_versions.py
+++ b/documentation/set_versions.py
@@ -207,7 +207,7 @@ with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch
207 lines = r.readlines() 207 lines = r.readlines()
208 for line in lines: 208 for line in lines:
209 if "VERSIONS_PLACEHOLDER" in line: 209 if "VERSIONS_PLACEHOLDER" in line:
210 w.write(" 'dev': 'dev (%s)',\n" % release_series[devbranch]) 210 w.write(" 'dev': { 'title': 'dev (%s)', 'obsolete': false,},\n" % release_series[devbranch])
211 for branch in activereleases: 211 for branch in activereleases:
212 if branch == devbranch: 212 if branch == devbranch:
213 continue 213 continue
@@ -219,9 +219,9 @@ with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch
219 if versions[-1] != "0": 219 if versions[-1] != "0":
220 version = version + "." + versions[-1] 220 version = version + "." + versions[-1]
221 versions.append(version) 221 versions.append(version)
222 w.write(" '%s': '%s',\n" % (version, version)) 222 w.write(" '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch == ourseries).lower()))
223 if ourversion not in versions and ourseries != devbranch: 223 if ourversion not in versions and ourseries != devbranch:
224 w.write(" '%s': '%s',\n" % (ourversion, ourversion)) 224 w.write(" '%s': {'title': '%s', 'obsolete': true,},\n" % (ourversion, ourversion))
225 else: 225 else:
226 w.write(line) 226 w.write(line)
227 227
diff --git a/documentation/sphinx-static/switchers.js.in b/documentation/sphinx-static/switchers.js.in
index e7ef2ce5f5..5ae0325e6d 100644
--- a/documentation/sphinx-static/switchers.js.in
+++ b/documentation/sphinx-static/switchers.js.in
@@ -65,15 +65,15 @@ by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b
65 function build_version_select(current_series, current_version) { 65 function build_version_select(current_series, current_version) {
66 var buf = ['<select>']; 66 var buf = ['<select>'];
67 67
68 $.each(all_versions, function(version, title) { 68 $.each(all_versions, function(version, vers_data) {
69 var series = version.substr(0, 3); 69 var series = version.substr(0, 3);
70 if (series == current_series) { 70 if (series == current_series) {
71 if (version == current_version) 71 if (version == current_version)
72 buf.push('<option value="' + version + '" selected="selected">' + title + '</option>'); 72 buf.push('<option value="' + version + '" selected="selected">' + vers_data["title"] + '</option>');
73 else 73 else
74 buf.push('<option value="' + version + '">' + title + '</option>'); 74 buf.push('<option value="' + version + '">' + vers_data["title"] + '</option>');
75 } else { 75 } else {
76 buf.push('<option value="' + version + '">' + title + '</option>'); 76 buf.push('<option value="' + version + '">' + vers_data["title"] + '</option>');
77 } 77 }
78 }); 78 });
79 79
@@ -223,7 +223,7 @@ by https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/run-docs-b
223 $('#outdated-warning').html('Version ' + release + ' of the project is now considered obsolete, please select and use a more recent version'); 223 $('#outdated-warning').html('Version ' + release + ' of the project is now considered obsolete, please select and use a more recent version');
224 $('#outdated-warning').css('padding', '.5em'); 224 $('#outdated-warning').css('padding', '.5em');
225 } else if (release != "dev") { 225 } else if (release != "dev") {
226 $.each(all_versions, function(version, title) { 226 $.each(all_versions, function(version, vers_data) {
227 var series = version.substr(0, 3); 227 var series = version.substr(0, 3);
228 if (series == current_series && version != release) { 228 if (series == current_series && version != release) {
229 $('#outdated-warning').html('This document is for outdated version ' + release + ', you should select the latest release version in this series, ' + version + '.'); 229 $('#outdated-warning').html('This document is for outdated version ' + release + ', you should select the latest release version in this series, ' + version + '.');