All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Cc: docs@lists.yoctoproject.org,
	Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	Quentin Schulz <foss@0leil.net>
Subject: [PATCH 2/4] docs: sphinx-static: switchers.js: correctly highlight obsolete releases
Date: Tue, 28 Sep 2021 18:22:00 +0200	[thread overview]
Message-ID: <20210928162202.749990-2-quentin.schulz@theobroma-systems.com> (raw)
In-Reply-To: <20210928162202.749990-1-quentin.schulz@theobroma-systems.com>

Currently, only releases before 3.1 are marked as obsolete even though
3.2 is already obsolete too.

Since 3.1 is an LTS and is still maintained, it needs to not be marked
as obsolete, unlike 3.2. Therefore, LTS series are now also tested
against before marking a release as obsolete.

This makes non-LTS, non-latest releases obsolete.

Cc: Quentin Schulz <foss@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 documentation/sphinx-static/switchers.js | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/documentation/sphinx-static/switchers.js b/documentation/sphinx-static/switchers.js
index cb55e35c8..6038ae065 100644
--- a/documentation/sphinx-static/switchers.js
+++ b/documentation/sphinx-static/switchers.js
@@ -10,11 +10,22 @@
     '2.7.4': 'warrior (2.7.4)',
   };
 
+  var latest_release_series = '3.3'
+  var lts_series = [
+	'3.1',
+  ]
+
   var all_doctypes = {
       'single': 'Individual Webpages',
       'mega': "All-in-one 'Mega' Manual",
   };
 
+  function ver_obsolete(curr) {
+    var series = curr.substr(0, 3);
+    return ver_compare(curr, latest_release_series) < 0 &&
+	    lts_series.indexOf(series) >= 0;
+  }
+
   // Simple version comparision
   // Return 1 if a > b
   // Return -1 if a < b
@@ -219,7 +230,7 @@
     $('.doctype_switcher_placeholder').html(doctype_select);
     $('.doctype_switcher_placeholder select').bind('change', on_doctype_switch);
 
-    if (ver_compare(release, "3.1") < 0) {
+    if (ver_obsolete(release) != 0) {
       $('#outdated-warning').html('Version ' + release + ' of the project is now considered obsolete, please select and use a more recent version');
       $('#outdated-warning').css('padding', '.5em');
     } else if (release != "dev") {
-- 
2.31.1



  reply	other threads:[~2021-09-28 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 16:21 [PATCH 1/4] docs: sphinx-static: switchers.js: add release name to dropdown menu Quentin Schulz
2021-09-28 16:22 ` Quentin Schulz [this message]
2021-09-28 17:21   ` [docs] [PATCH 2/4] docs: sphinx-static: switchers.js: correctly highlight obsolete releases Nicolas Dechesne
2021-10-05 14:11     ` Quentin Schulz
2021-10-05 16:29       ` Michael Opdenacker
2021-10-06  7:41         ` Quentin Schulz
2021-09-28 16:22 ` [PATCH 3/4] docs: sphinx-static: switchers.js: point to newer release in outdated warning Quentin Schulz
2021-09-28 16:22 ` [PATCH 4/4] docs: sphinx-static: switchers.js: redirect doc series links to latest known dot release for given series Quentin Schulz
2021-09-28 16:24   ` Quentin Schulz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210928162202.749990-2-quentin.schulz@theobroma-systems.com \
    --to=quentin.schulz@theobroma-systems.com \
    --cc=docs@lists.yoctoproject.org \
    --cc=foss@0leil.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.