Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp623767pxb; Wed, 27 Jan 2021 17:08:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzB9Xl+YV7tIHn0yE5THeKOSHVWOQ6HhwNAt/lZPMD5/Qkg5ukWn50NDeJ7RtRrhqcHWLPW X-Received: by 2002:a17:906:278b:: with SMTP id j11mr8843441ejc.438.1611796099134; Wed, 27 Jan 2021 17:08:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611796099; cv=none; d=google.com; s=arc-20160816; b=pLRrjDLnU/deb0DrRf24j3DtMcruuNbr7GW6/NTonaulidJn4j5Vf9AFqGRUTfXPBf wSdchnuSe+fv7b/+B0HvbDywH3EmuAXWpFLi9yXu0Cwm3ox/zzMixfyExL8HYfPDcrRj ZmbTgE3gFC1Gwab5nRZvTAl3GeSRlwve2j6Uu+w5z/Zc6hWpLUmWtSjLImnaw3B2THtA rW9+3C9HN8SIPUSzAxS5I+90YBEOYvi1q3bJkF6ewvWcdubRxd5uwKnFXqi9VJ3fMyxv Wp1Y/Hz9nLUWNvJRU9I0Z3w8Ks4844KukS4aoiR+WeeG7q0jXxLjl9FLxStJITJDXw9p 6hfw== 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=JpHvdf4WlWJrwuqfau82dS6nFbc1g8Q6OZk5049t/is=; b=GNpkgIb7Auq6KIORTLGLTff6MQRtNeAxSFbksXuiX4l/L2pPkhUht0/+usdzMot8Tb 3du+PIP51J/KUo8u5FVyEhP/gyUWiTg5SHzFlieCanNsaOM7HI8TLOcbdidOb5FWGxEQ 0BOrqQadTV8kPYBrKNO4bwgVOIoul9DBxxiQ4VHC+ktM14X4cjpJ0uaeqJK466hj6eW3 tvkqDp0q8RJt62YJA/miszWeyIwtHCNjlm3RdtzHwUluf9MoMdAGc0id3etL6sB4jf95 9YVKtlQzatkeJQguiiKHgrzb3M8V0F7OWXrAR5Ddi8aa2PD/kX5MkYNsOK0J8NMn2sI4 wz8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b="tIvgqb/C"; 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 mp28si1554379ejc.284.2021.01.27.17.07.53; Wed, 27 Jan 2021 17:08:19 -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="tIvgqb/C"; 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 S231664AbhA1BE7 (ORCPT + 99 others); Wed, 27 Jan 2021 20:04:59 -0500 Received: from mail1.protonmail.ch ([185.70.40.18]:13893 "EHLO mail1.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231643AbhA1BCe (ORCPT ); Wed, 27 Jan 2021 20:02:34 -0500 Date: Thu, 28 Jan 2021 01:01:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1611795699; bh=JpHvdf4WlWJrwuqfau82dS6nFbc1g8Q6OZk5049t/is=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=tIvgqb/CKtYJzYMp0MVvjk+J93VS5UJxGzwCnutyRKWAVe63yUcsvZTyKnp3eUbwi ZFa0oNibp/5rqgxqey62dM0mkAmygyIVmeoNdyRYj3sDlIawnx5whxSJJB3eJ0e/qp Z2mDC1tPspo+Wp5jHJjw3kUeI/Htp6DvxJ2vir8s= 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: [PATCH 2/2] docs: Document cross-referencing using relative path Message-ID: <20210128010028.58541-3-nfraprado@protonmail.com> In-Reply-To: <20210128010028.58541-1-nfraprado@protonmail.com> References: <20210128010028.58541-1-nfraprado@protonmail.com> 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 Update the Cross-referencing section to explain how to create a cross-reference to a document using relative paths and with no additional syntax, by relying on automarkup.py. Signed-off-by: N=C3=ADcolas F. R. A. Prado --- Documentation/doc-guide/sphinx.rst | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/s= phinx.rst index 36ac2166ad67..ec3e71f56009 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -340,16 +340,26 @@ Rendered as: Cross-referencing ----------------- =20 -Cross-referencing from one documentation page to another can be done by pa= ssing -the path to the file starting from the Documentation folder. -For example, to cross-reference to this page (the .rst extension is option= al):: - - See Documentation/doc-guide/sphinx.rst. - -If you want to use a relative path, you need to use Sphinx's ``doc`` direc= tive. -For example, referencing this page from the same directory would be done a= s:: - - See :doc:`sphinx`. +Cross-referencing from one documentation page to another can be done simpl= y by +writing the path to the document file, no special syntax required. The pat= h can +be either absolute or relative. For absolute paths, start it with +"Documentation/". For example, to cross-reference to this page, all the +following are valid options, depending on the current document's directory= (note +that the ``.rst`` extension is required):: + + See Documentation/doc-guide/sphinx.rst. This always works. + Take a look at sphinx.rst, which is at this same directory. + Read ../sphinx.rst, which is one directory above. + +If you want the link to have a different rendered text other than the docu= ment's +title, you need to use Sphinx's ``doc`` role. For example:: + + See :doc:`my custom link text for document sphinx `. + +For most use cases, the former is preferred, as it is cleaner and more sui= ted +for people reading the source files. If you come across a ``:doc:`` usage = that +isn't adding any value, please feel free to convert it to just the documen= t +path. =20 For information on cross-referencing to kernel-doc functions or types, see Documentation/doc-guide/kernel-doc.rst. --=20 2.30.0