Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1597216pxb; Thu, 4 Feb 2021 18:04:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzu71n9pGEHAC3JYvZdsaIvZkSmV5q60LdvhgxbpRdc+aWc4xYXbiKUyloEL80FoWNzCuLc X-Received: by 2002:a17:906:364b:: with SMTP id r11mr1838718ejb.447.1612490667035; Thu, 04 Feb 2021 18:04:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612490667; cv=none; d=google.com; s=arc-20160816; b=skoiFKtb91sim3DQ1Dn+sCgevgqvYSdLTFEERFzY/ZedQ+GoqlxnIClXvGmqKStpJR rYLz7MSljlowPI3SdvIF82UNTM/K4wOSanU4qIKZHT0/c1MUf1VrFm2UE/RyQkNdcI+G ljKFgSzC42Mt6cuBTqqSP3insg152pagWrZRgeMfH7YpcUPO/Qdw+49yQ5lu3Pi3qgvQ KVbmR5CH6CYnty7OzSh/dw8JE/jCtcOie2Veqdfo6SR83mO0irPWxG4uKxy3wIp0GEZA kPli1l147vIIIIm9u2liLn5aA1BzQUHCPor/03k0yGXiWoNZloEbiSpfRIHHtLDMYxO2 3x1g== 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:reply-to:cc:from:to :dkim-signature:date; bh=2IWQSxV6oL15AHRq17uD4vpb+CeMfjyzQ8/hzaB1cyA=; b=LBtq0oy0XFXdL56WUSC1du29JuRWuFEK/nYYy4rPVUGHlWty3PEV/3FjDM9qDuim/b 4IPsna6XCoDRad4f8B4itNcjTQPB/FY3EFq/qNOC31BVF/+r67ekOAGVyZrsiQrEjURi d5c2OE/m0iyllJBohE8tm8OaTfdbNDAr7hwgV1aIVim0uxaZQDkv0Ifhy2OX81e6LicV vJyE8RR5oQ7n/hfQTaAtfKm7cfdZLUTpyFtz9MPdWYlZsQEKtlZxix3YKBd3n90w45Ro Nt/MBjKDBUy2XgJ1JchAdPWQCliTy8dS+xQ8ShgBQBqPYonZ0Ox/xUDJ5kEwEgjWgO5Z GiPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=ILV1NeHN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lc13si2807549ejb.412.2021.02.04.18.04.03; Thu, 04 Feb 2021 18:04:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=ILV1NeHN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbhBEBIE (ORCPT + 99 others); Thu, 4 Feb 2021 20:08:04 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:30276 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbhBEBID (ORCPT ); Thu, 4 Feb 2021 20:08:03 -0500 Date: Fri, 05 Feb 2021 01:07:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1612487238; bh=2IWQSxV6oL15AHRq17uD4vpb+CeMfjyzQ8/hzaB1cyA=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=ILV1NeHN+peEHAhhpveOIzhAE2DsPlgVBm+cR2Qe8wzkSNtdaENfs0tfy0KRXoRqm Z+BtbteEpaXT1TyyJzuRBUf151m99UcJpAO2aJwkr57DXo0bRNerXrftjkr1EJeO9f QTWcFuGg/gA2BUOis6ft51fDUAKtmaTyq/XrrcE0= To: Jonathan Corbet From: =?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 Reply-To: =?utf-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Subject: Re: [PATCH 0/2] docs: Add support for relative paths in automarkup Message-ID: In-Reply-To: <87o8gzxvjl.fsf@meer.lwn.net> References: <20210128010028.58541-1-nfraprado@protonmail.com> <87o8gzxvjl.fsf@meer.lwn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu Feb 4, 2021 at 8:28 PM -03, Jonathan Corbet escreveu: > > N=C3=ADcolas F. R. A. Prado writes: > > > As Jon previously noted [1], it would be nice if automarkup supported r= elative > > paths as well when cross-referencing to other documents. This adds the = support > > for it, and documents it. > > > > Jon, after applying this, 43bc3ed73639 ("docs: dt: Use full path to ena= ble > > 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. Hm, but what is actually being linked to is the .rst of same name, admin-guide/kernel-parameters.rst. Both when adding a file to the Sphinx's index, as well as when cross-referencing, the file name is used without the extension, because the .rst extension is implied. In the case of admin-guide/kernel-parameters.txt though, the .rst file incl= udes the .txt file, so it actually makes sense to cross-reference to the .rst wh= en writing the path to the .txt. But in the case of core-api/refcount-vs-atomic.rst, for example, where there is a reference to memory-barriers.txt, which is a file with no .rst counterpart, it will fail to cross-reference. At the moment that's harmless, but it will become = a problem after we enable warnings. > > 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. That was already on my backlog, so I could probably do it in the next few d= ays :) (if you don't get to it first, of course). Thanks, N=C3=ADcolas