Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2033143rwr; Fri, 28 Apr 2023 05:26:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7rWWSinptctGlVcE/0QUtDWamKug3cVlmFj5ow6NpsWJZVharl0SY8Wc47N7npDa2Xd82q X-Received: by 2002:a17:90b:1b0c:b0:247:a53e:97a1 with SMTP id nu12-20020a17090b1b0c00b00247a53e97a1mr5212330pjb.28.1682684783630; Fri, 28 Apr 2023 05:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682684783; cv=none; d=google.com; s=arc-20160816; b=ckQtOq6lXO6V4Moenbloh6A1lpBN/ao0xZyqCc0yu5Sgtj3kiuDDzKjT+6OaCpABh3 Snd706jOBYpxa2eM4EARW9Bo9/Vwrurm6l5xWYo+H977iufaMaCWbYArgFF3iMv4+pvT uEI5bRDu5AR9AtgCAd9cTiYcH8Zbn26P95s+G0UXlDX14QdglXqux0eaIZk0XWroVv/6 XELOVSm8oriZ2BwheMqMTZF9r1uzshW9C9ppTyOHauRDom2Q8YIMnpF7NLrdwnWjvL+A +teHeUTxN/+dhW80EppNJaTbBd4bTvLpn/Hhn9Ctxh/qkj7Jvb7Ozs2r0wztNU/qXD4q O6PA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/39+8Y0KyYX6N7l1fXtNqu0ukeChRZgye0z7hUnxZPY=; b=pneex55ZmiIXfqMvwaolZgK38ckCH79d8+Qgx0RlNmCe03D245TDJaQjIkxpTvAfyb FXxHjREFsVBc1POXeSON3Xl4SpvcEgY7chKTX/uCMx6vu8/FuDmRgvMdJmH8u/X7bAqG jAosffnDfD2usrwQpDM6LUHkWeysfVzUbry8c06c1V+f0BOBG4BBOvtSkT+lp/FCBAnh JUFT1gQxgeEal8tkOE3qDAllOdN2UqRSYbCvadXfZ2svkb/rhTCyQeT/ghMR2m833Mnn 8LCZRa1RhrBrEtSooVUJ6OID5AduSfzP4ZZOkm4VyqLRGzKPKgvAlS7/SSvPYnsokAEb Fl+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EjttAvDm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il6-20020a17090b164600b0024c0d1dbcaasi2214864pjb.150.2023.04.28.05.26.12; Fri, 28 Apr 2023 05:26:23 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EjttAvDm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjD1MYX (ORCPT + 99 others); Fri, 28 Apr 2023 08:24:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjD1MYW (ORCPT ); Fri, 28 Apr 2023 08:24:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 505ADE54; Fri, 28 Apr 2023 05:24:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B4A4760C25; Fri, 28 Apr 2023 12:24:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F2EBC433EF; Fri, 28 Apr 2023 12:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682684660; bh=bJ4kd4DhI0XWEY91KoBUmIja7FGFyv2ovxrLHacsvhU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EjttAvDmLcZc2GIi/5FZLJYLdTppIaJdQIrj2NzUaFToF2L28MefxXkANc45kLJoZ MuuIZCqWvO5w1v+F90iFdjXCbd5Nikhi6P19iXMKsoQALbBIFuf1m6ak70hsBV9eeM jD2Gsi5uaAkEGPUKPFIJdZaAimeGCpaRPI/Okirvfv8OLfJlcHM3x1ru5ibGMhRHHn 5gyoydSK6maApOFU/QIc+sqh0Oqa7vOzrUWc6FLeADEfzyEsPmIGbq8CCxZwYVNEDj v5NMpiqe3rDGiSBylp+HOx0WMbxIN7Yx0IZdT0PedHy/kKnrDIylhYNNYSAj5S9E// sCbNOLG1m6kCg== Date: Fri, 28 Apr 2023 13:24:15 +0100 From: Mauro Carvalho Chehab To: Costa Shulyupin Cc: Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org (open list) Subject: Re: [PATCH] docs: redirect from old arch to the new one Message-ID: <20230428132415.0d0f5a03@sal.lan> In-Reply-To: <20230427101241.1273752-1-costa.shul@redhat.com> References: <20230427101241.1273752-1-costa.shul@redhat.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, 27 Apr 2023 13:12:39 +0300 Costa Shulyupin 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 > --- > 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