From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC593C433E6 for ; Thu, 4 Feb 2021 23:29:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DE1264FB0 for ; Thu, 4 Feb 2021 23:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbhBDX3A (ORCPT ); Thu, 4 Feb 2021 18:29:00 -0500 Received: from ms.lwn.net ([45.79.88.28]:32946 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbhBDX26 (ORCPT ); Thu, 4 Feb 2021 18:28:58 -0500 Received: from localhost (unknown [IPv6:2601:281:8300:104d::5f6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id A6C146166; Thu, 4 Feb 2021 23:28:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 ms.lwn.net A6C146166 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lwn.net; s=20201203; t=1612481294; bh=DQfQbIVMmZvbCrfAXHodKr+ICylkwNupB+PhosX7jjg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=qiJ4hzNexBf3mOowT61yg20xcsa9V0xarP+XA4nvB3xEqQVJqtL2eOypbX+xWlXTr W2jXd0BLI3+BFs5H6xU8o8u6zjULpIsfgrYtbPHuMC8vH+kCa0zvQu9X/fhb41bNuG og6I97VL/UZXAPiyMRAe17i+7CmNR/ldSgsx7xIRezHrr8IqzexR8T1umuiyfEHvBd 5WUTr//Ii+qKVmSxRKoatgEOVEOtC9c2OiMaMJs459xX4dRI/xpmpqp2evgKQ8tra+ JwvVDKqln9pU0WjRHRfEHFzof9l7ckVPwTN0FoV1Ewil+DXIZppf9C8gyXIkhTPItb ev/WFVfr3JYig== From: Jonathan Corbet To: =?utf-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Cc: Randy Dunlap , Mauro Carvalho Chehab , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Miguel Ojeda , Andrew Klychkov , lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com Subject: Re: [PATCH 0/2] docs: Add support for relative paths in automarkup In-Reply-To: <20210128010028.58541-1-nfraprado@protonmail.com> References: <20210128010028.58541-1-nfraprado@protonmail.com> Date: Thu, 04 Feb 2021 16:28:14 -0700 Message-ID: <87o8gzxvjl.fsf@meer.lwn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org N=C3=ADcolas F. R. A. Prado writes: > As Jon previously noted [1], it would be nice if automarkup supported rel= ative > paths as well when cross-referencing to other documents. This adds the su= pport > for it, and documents it. > > Jon, after applying this, 43bc3ed73639 ("docs: dt: Use full path to enable > cross-reference") could be reverted without the link stopping to work. > > [1] https://lore.kernel.org/linux-doc/20201130142404.6ef6689e@lwn.net/ > > N=C3=ADcolas F. R. A. Prado (2): > docs: Enable usage of relative paths to docs on automarkup > docs: Document cross-referencing using relative path > > Documentation/doc-guide/sphinx.rst | 30 ++++++++++++++++++++---------- > Documentation/sphinx/automarkup.py | 7 +++++-- > 2 files changed, 25 insertions(+), 12 deletions(-) So I finally got around to playing with this set. One thing I found is that some of the references that were being caught before were not now... after far too much time, I figured out that the problem was references to .txt files, of which we have quite a few in the docs. admin-guide/kernel-parameters.txt in particular is quite popular. Before this change, those were being turned into xrefs, afterward not. To address that, I applied this little tweak: -RE_doc =3D re.compile(r'(\bDocumentation/)?((\.\./)*[\w\-/]+)\.rst') +RE_doc =3D re.compile(r'(\bDocumentation/)?((\.\./)*[\w\-/]+)\.(rst|txt)') That seems to make things work properly again. While tracking this down I put in a print for failing cross references, and noted that we have quite a few; it's a useful way to see where the stale references are. Maybe I'll try to hack together something to make those stand out so we can fix them. Thanks, jon