Message ID | 20230427101241.1273752-1-costa.shul@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp167552vqo; Thu, 27 Apr 2023 03:29:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YxGlH8xQMfz+KOXde+VLfwE2ygNvF1cn7icpQb2+sDVQBqPjN0T9HrQaUnI9wDeHu5QI1 X-Received: by 2002:a17:902:f907:b0:19e:500b:517a with SMTP id kw7-20020a170902f90700b0019e500b517amr900951plb.69.1682591343063; Thu, 27 Apr 2023 03:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682591343; cv=none; d=google.com; s=arc-20160816; b=RRYZhqp1tWX3sfyaH/u353e1PGyn7tV8afdQfu62S7RNXXxUVNIS108UlfZpT64qW5 SXWxdDuVJ17A19BJIrTHcVEG64K39MXWT8qE5pw5kxDjSBv8HnzuiGeT0HjZvuIJdVzS L97uOieeCrebTFUf1oofsmGmCzNfRp1G/VZaV0xZ604U3t0I75/ybwXPImFGzAlUyv5E Y4E2RWcg8SORD7Vn1tdQNokTxPC6YTwtgwutctFI3CEh2o0+ZYpX8zsCmayu7N40VjR6 hg8ZLvMPpZp9N59TLNqC2hxtKETsnsQi0A3ID0i8Gy6BTQPOh/uZ8mE1uEjqNba4+oE4 kyog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=mNNjiSHfVRruw15xW6omPfyhEqYHKH/kULEDX2tDZsQ=; b=RHCS+U9QRcVomUdcFMJepMjmUjjYExu1WRC+gZsRTUNKiCQ+ov3InvrYkfS8EF28iI a7LD0AdsGGjL0BCUJwJkRMXLKThsi+0rBPXkthp/GjgYtAbVtX7mpHQPPrLOC8LQOZgK JNtnyelb99DbZSzQ1xAocbwhvQGEBEmeZ2tIBP46hydddztmGSAhZNMrS9iGGtml8VJZ MDLXXsUqOVu+ilDN6gYT8zC7F9zlhOr9Hg6GXGOyACu23LAOeECBE8UWMSyfDjShMp5g a7RS3fWvxbt5H6tBo7DPavslAlpc7uVbmck2hmWImBsiYtavtDs+dESUTDE/dg/cAbnK aQBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rm8-20020a17090b3ec800b00246a5991cc6si19991410pjb.162.2023.04.27.03.28.46; Thu, 27 Apr 2023 03:29:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243389AbjD0KNR (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Thu, 27 Apr 2023 06:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243155AbjD0KNO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 27 Apr 2023 06:13:14 -0400 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C24592; Thu, 27 Apr 2023 03:13:13 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-3f19afc4f60so38227155e9.1; Thu, 27 Apr 2023 03:13:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682590392; x=1685182392; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mNNjiSHfVRruw15xW6omPfyhEqYHKH/kULEDX2tDZsQ=; b=f4IP2tOYvGDnS0Da4vpBB6t/kiwasxkka/o1ryupst73Dgx1JKZFNhWQvM1CFIysNq Ty8c5I0CN2kttKr7CErviY2L0hi5izMBlHeuESgCWWRbGJCMYE8SPwQLhlFw1ACSeLZy IALETImbvg2pIgdkRWOQqDZcr1BwtDAs+YzrT/reZRL6apTHq9Rxree7pa5WeVRS//LO SmqlBFiyaPbJQAa45k+S8ceNivqICqVCM4TzyfYc+0bRHKUvQaAQ6roJ5pOPAVzCUE8W jAak5kFW0ehSPb9Q89kVaNAcuh1R5z7VwY6RCiCPzSnFRfNao8+KQ0wuJvKv28RHVCYj SOCQ== X-Gm-Message-State: AC+VfDxCimmwlxUEtEX7EOXZCkZ3nw0QhEb6e4mBvYd/gP3ujStHjlc5 UwC/n0n2zOhs82GrAFldKNQ= X-Received: by 2002:a7b:c8d9:0:b0:3f1:94fe:65e0 with SMTP id f25-20020a7bc8d9000000b003f194fe65e0mr1073788wml.26.1682590391144; Thu, 27 Apr 2023 03:13:11 -0700 (PDT) Received: from costa-tp.redhat.com ([2a00:a040:1a3:c11b:3ae6:1732:e587:a81f]) by smtp.gmail.com with ESMTPSA id v19-20020a05600c215300b003ee20b4b2dasm20825920wml.46.2023.04.27.03.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 03:13:10 -0700 (PDT) From: Costa Shulyupin <costa.shul@redhat.com> To: Jonathan Corbet <corbet@lwn.net>, linux-doc@vger.kernel.org Cc: Costa Shulyupin <costa.shul@redhat.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, linux-kernel@vger.kernel.org (open list) Subject: [PATCH] docs: redirect from old arch to the new one Date: Thu, 27 Apr 2023 13:12:39 +0300 Message-Id: <20230427101241.1273752-1-costa.shul@redhat.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764324899807764254?= X-GMAIL-MSGID: =?utf-8?q?1764324899807764254?= |
Series |
docs: redirect from old arch to the new one
|
|
Commit Message
Costa Shulyupin
April 27, 2023, 10:12 a.m. UTC
Due to a recent reorganization of 'CPU Architectures', the links to
the documentation from external resources were rendered invalid.
This is a common challenge when attempting to make changes
while maintaining backward compatibility. To address this issue,
a commit has been made which uses sphinx extension to seamlessly
redirect users from the old location of the page to the new one.
Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
---
Documentation/conf.py | 8 +++++++-
Documentation/sphinx/requirements.txt | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
Comments
Costa Shulyupin <costa.shul@redhat.com> writes: > Due to a recent reorganization of 'CPU Architectures', the links to > the documentation from external resources were rendered invalid. > This is a common challenge when attempting to make changes > while maintaining backward compatibility. To address this issue, > a commit has been made which uses sphinx extension to seamlessly > redirect users from the old location of the page to the new one. > > > Signed-off-by: Costa Shulyupin <costa.shul@redhat.com> > --- > Documentation/conf.py | 8 +++++++- > Documentation/sphinx/requirements.txt | 1 + > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/Documentation/conf.py b/Documentation/conf.py > index 37314afd1ac8..514bfe6a8166 100644 > --- a/Documentation/conf.py > +++ b/Documentation/conf.py > @@ -55,7 +55,13 @@ needs_sphinx = '1.7' > extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', > 'kfigure', 'sphinx.ext.ifconfig', 'automarkup', > 'maintainers_include', 'sphinx.ext.autosectionlabel', > - 'kernel_abi', 'kernel_feat'] > + 'kernel_abi', 'kernel_feat', > + 'sphinx_reredirects', > +] > + > +redirects = { > + "arch.html": "arch/index.html", > +} I am not generally opposed to doing this, but: - It only solves part of the problem; links directly into (say) the x86 docs will still break. - Is there really a problem? Are there to-be-broken links out there that you can point to? Thanks, jon
Costa Shulyupin <costa.shul@redhat.com> writes: > My initial focus is on addressing conceptual review comments with this > first fix. Once that is done, I intend to submit fixes for the > remaining architecture. Furthermore, I intend to courteously with > redirects relocate additional subdirectories. For example, > consolidate subsystems. Please do not top-post on kernel lists. I'm not quite sure what "conceptual review comments" you're referring to. In any case, you have not answered my question: is there an actual problem needing to be solved here? Thanks, jon
> is there an actual problem needing to be solved here?
There is not an actual problem. Only a potential.
Thanks,
Costa
Em Thu, 27 Apr 2023 13:12:39 +0300 Costa Shulyupin <costa.shul@redhat.com> escreveu: > Due to a recent reorganization of 'CPU Architectures', the links to > the documentation from external resources were rendered invalid. > This is a common challenge when attempting to make changes > while maintaining backward compatibility. To address this issue, > a commit has been made which uses sphinx extension to seamlessly > redirect users from the old location of the page to the new one. > > > Signed-off-by: Costa Shulyupin <costa.shul@redhat.com> > --- > Documentation/conf.py | 8 +++++++- > Documentation/sphinx/requirements.txt | 1 + > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/Documentation/conf.py b/Documentation/conf.py > index 37314afd1ac8..514bfe6a8166 100644 > --- a/Documentation/conf.py > +++ b/Documentation/conf.py > @@ -55,7 +55,13 @@ needs_sphinx = '1.7' > extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', > 'kfigure', 'sphinx.ext.ifconfig', 'automarkup', > 'maintainers_include', 'sphinx.ext.autosectionlabel', > - 'kernel_abi', 'kernel_feat'] > + 'kernel_abi', 'kernel_feat', > + 'sphinx_reredirects', > +] Besides Jon's comment, if we add something like this, please make such extension optional (in a similar way to what we do for sphinx.ext.imgmath), as this is only pertinent on websites meant to provide the Kernel documentation. > + > +redirects = { > + "arch.html": "arch/index.html", > +} I suspect that maintaining a list of all redirects here can be painful, as, from time to time, we see documentation churns. We should likely need some script to check what renames happened since a previous Kernel version, generating it automatically. Again, as this is something that only applies to websites hosting documentation, IMO the best would be to have a separate file ("conf_redirects.py") included on conf.py, that will be auto-generated by a script that would receive, as input, the initial Kernel version where redirects should be preserved. Regards, Mauro > > if major >= 3: > if (major > 3) or (minor > 0 or patch >= 2): > diff --git a/Documentation/sphinx/requirements.txt b/Documentation/sphinx/requirements.txt > index 335b53df35e2..0b067e985edb 100644 > --- a/Documentation/sphinx/requirements.txt > +++ b/Documentation/sphinx/requirements.txt > @@ -1,3 +1,4 @@ > # jinja2>=3.1 is not compatible with Sphinx<4.0 > jinja2<3.1 > Sphinx==2.4.4 > +sphinx_reredirects
Mauro Carvalho Chehab <mchehab@kernel.org> writes: > Again, as this is something that only applies to websites hosting > documentation, IMO the best would be to have a separate file > ("conf_redirects.py") included on conf.py, that will be > auto-generated by a script that would receive, as input, the > initial Kernel version where redirects should be preserved. ...but again...I think we should observe an actual problem before we start adding any of this. Otherwise we'll just end up carrying a bunch of cruft indefinitely. jon
Em Fri, 28 Apr 2023 07:22:53 -0600 Jonathan Corbet <corbet@lwn.net> escreveu: > Mauro Carvalho Chehab <mchehab@kernel.org> writes: > > > Again, as this is something that only applies to websites hosting > > documentation, IMO the best would be to have a separate file > > ("conf_redirects.py") included on conf.py, that will be > > auto-generated by a script that would receive, as input, the > > initial Kernel version where redirects should be preserved. > > ...but again...I think we should observe an actual problem before we > start adding any of this. Otherwise we'll just end up carrying a bunch > of cruft indefinitely. Agreed. Just saying that, if this is a real problem, a custom conf.py would be the best approach. Btw, if I'm not mistaken, our building system already allows it via: make SPHINX_CONF=conf-redirects.py htmldocs I suspect that it would be possible to add redirects extension and its parameters on it, if someone ever needs it. No need to carry such stuff at the Kernel upstream, as this would very likely limited to some web sites that would be interested on keeping links to old documentation's location. Regards, Mauro
diff --git a/Documentation/conf.py b/Documentation/conf.py index 37314afd1ac8..514bfe6a8166 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -55,7 +55,13 @@ needs_sphinx = '1.7' extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'kfigure', 'sphinx.ext.ifconfig', 'automarkup', 'maintainers_include', 'sphinx.ext.autosectionlabel', - 'kernel_abi', 'kernel_feat'] + 'kernel_abi', 'kernel_feat', + 'sphinx_reredirects', +] + +redirects = { + "arch.html": "arch/index.html", +} if major >= 3: if (major > 3) or (minor > 0 or patch >= 2): diff --git a/Documentation/sphinx/requirements.txt b/Documentation/sphinx/requirements.txt index 335b53df35e2..0b067e985edb 100644 --- a/Documentation/sphinx/requirements.txt +++ b/Documentation/sphinx/requirements.txt @@ -1,3 +1,4 @@ # jinja2>=3.1 is not compatible with Sphinx<4.0 jinja2<3.1 Sphinx==2.4.4 +sphinx_reredirects