Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp371811pxk; Fri, 11 Sep 2020 09:09:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIHmWDA45yoDQPTivbQE+AIk58DIA14z/xnPcjh+R4abAT+ftPcwpQKTESUgyyLA7yivaI X-Received: by 2002:aa7:d78f:: with SMTP id s15mr2827251edq.322.1599840564743; Fri, 11 Sep 2020 09:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599840564; cv=none; d=google.com; s=arc-20160816; b=gah94pUKM0+dNxUL26XSN1Y4EaV/hEAPNMmv4BadCswTciMWUQ1dJsW+PMid6kroXw JoVKM5ID8ZNvKnmk3KtzR2eP5kB4dkIIwF8N0d7iznYoZeL6CDxybtjWtY4QovcaBKri iCISHXnnInL1sAVHVikWBTVfbWSUReHfFoI0f2rRkHxCpyoC/NgsV/rO4Q5Ur4JVMzTv rwGpM7SefMdJ7IoaVnZiPy4kNg/hUXstF5tx4pFvSIQPkCPeq8Zz5SfTxOluXFVJZk5b MKRBtpkY4Xg0q+zqGHCi5u5iw/PvYGQV5U8IlMIsEyKbd6GUScxQPXFxI5Is+cxkddLQ u8ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=i1YSY0XyxQ3SaC8ZJ4PtKWoRmK1OW12T7faRuAJSgLY=; b=CXEW1uhBCCKJ0F5G3LwYWcu2zDPT4IAL5u1woVWSFA+crfw/Xu23LOAxAnBAiAW4t9 gOjPSPZBihBMNPU9+/hJTKzqVZo40OJAxAzGSKJS8HyHvHjgoJNJH/U3/vgSFIegGM2e 2yOtsKsIteaVWmTdkieiO0B6Q+9qhnLgUKGxVZ5iLKEdFgDTzXDWXl4tcj/Ji+fAI1m8 xA3xnuYR+geVrHHcP6GfOF9tlWcssiTD1RzlqALp5RyIylDUE2Qp6DyEaUjJYGcE/bXt zcbBhpVLSMGH7a2lnoIp52WtDuBGviyuPXCMEBXs0bzs5DYRGuj+88oX5GM0jE2DM3tO bEew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=uE0t+iaG; 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 d17si1664486edx.591.2020.09.11.09.09.01; Fri, 11 Sep 2020 09:09:24 -0700 (PDT) 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=uE0t+iaG; 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 S1726574AbgIKQFd (ORCPT + 99 others); Fri, 11 Sep 2020 12:05:33 -0400 Received: from mail-41103.protonmail.ch ([185.70.41.103]:19890 "EHLO mail-41103.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbgIKQDu (ORCPT ); Fri, 11 Sep 2020 12:03:50 -0400 Received: from mail-03.mail-europe.com (mail-03.mail-europe.com [91.134.188.129]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 3D145200BEBF for ; Fri, 11 Sep 2020 13:36:43 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (1024-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="uE0t+iaG" Date: Fri, 11 Sep 2020 13:34:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1599831274; bh=i1YSY0XyxQ3SaC8ZJ4PtKWoRmK1OW12T7faRuAJSgLY=; h=Date:To:From:Cc:Reply-To:Subject:From; b=uE0t+iaGURnDMbw/jWB2/rKtG+/t5YOF50uKPjidH1p8qUskaIDjCqT8+5nFqhqtb GCrkrjGxKH+/W80ODPbrO7Lc89E6eWtHknGyZvx2eYmCzaibIiMC0gt9ol14Y1uT7/ CzUBAu/y3JcvuYwLO1F/h8MY0d9u+rKIZqFIc6PA= To: Jonathan Corbet From: =?utf-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com Reply-To: =?utf-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Subject: [PATCH 0/3] docs: Add automatic cross-reference for documentation pages Message-ID: <20200911133339.327721-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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cross-referencing from a documentation page to another can be done using th= e :doc:`doc-file` directive from Sphinx. This however introduces markup that could be avoided to increase readabilit= y in plain text. This patch series adds automatic markup for cross-referencing between documentation pages. This patch series depends on [1]. The first patch refactors the automarkup script to split regex matching and iteration into one function and text markup substitution into another. This enables each regex to have its own function that substitutes its match= es' text for the appropriate markup and is necessary for the automatic markup o= f documentation pages since it requires slightly different logic from marking= up C references. The second patch adds automatic markup for cross-referencing documentation pages by adding an appropriate regex and function to do the markup. This enables a text like "See Documentation/doc-guide/sphinx.rst." to be substituted by a cross-reference to that document without any additional ma= rkup. Since this automarkup doesn't work with relative paths (they always need to start at Documentation/), it will almost always require more typing than th= e equivalent :doc:`sphinx`, but it's purpose is to avoid the markup, making i= t more readable in plain text. The .rst extension was left as optional in the regex matching, even though = it only makes sense for .rst documents, because I thought not specifying the extension, like "See Documentation/doc-guide/sphinx." also made sense as a cross-reference. The third patch adds a section about cross-referencing in the "Writing Documentation" chapter since there was none (other than the one regarding kernel-doc). The section describes how to use the new automatic cross-referencing for documentation pages, and also how to use the already in place Sphinx doc directive. It also points to the kernel-doc document for information on cross-referenc= ing kernel-doc functions and types (using the new automarkup, so it also serves= as a testcase for it). Thanks, N=C3=ADcolas [1]: https://lore.kernel.org/linux-doc/20200903005747.3900333-1-nfraprado@p= rotonmail.com/ N=C3=ADcolas F. R. A. Prado (3): docs: Allow multiple automarkup functions docs: Add automatic cross-reference for documentation pages docs: Document cross-referencing between documentation pages Documentation/doc-guide/sphinx.rst | 17 ++++ Documentation/sphinx/automarkup.py | 134 ++++++++++++++++++++--------- 2 files changed, 109 insertions(+), 42 deletions(-) --=20 2.28.0