Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp210299pxk; Wed, 2 Sep 2020 19:44:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhZ2yh7TMMfEk3LoBOh7jvVOfN2cCJ3s0WXveF0Sb/1CU82+tXo1avgeQRALIS2LpDKyNB X-Received: by 2002:aa7:d382:: with SMTP id x2mr918089edq.108.1599101082595; Wed, 02 Sep 2020 19:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599101082; cv=none; d=google.com; s=arc-20160816; b=l/VMfTbPm9a0AGk49d3+CbWYSVuRXcx5Su3yGsWK+jJmIbawIaIRkBREF2nJtJZ1Ro KX6l4OkEih5/ZjBcwE1ZAobjZwIAZjp48PG85a45eR6RITQM3tgyGR7y9MnH5t+aInt7 EgytNSV+hUFKIelth2j9HlMsFL/DFsAH0CbUAQJJSwrpUMiIiHiEGjkDHDMPlZQMbEbh ei86hZpQefH/V3VR7NUqIuNVpiQ7uHXVCMeXK7DXm0Nmo/wBM6LFiWNsekDKjiA6/a6L EVuKzlSXw6QbYGKBCRt0EiJl5tjSoQlHyDUBQZD9fnZonUFpzoeJRAcZ7oLMepwj52aV 6Ztg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=R9wsgh5OhpmeQRbKxOY/dzd+1XG9pkbfv3w+MHt05O0=; b=PIIff5skBPUOi9QTPOWDX2HhiEci5ADxwBAn42NQVrmmrkCecCyUsoltKsubbJWkyQ nSZGsHv3RdjxIx2HTK+e34JMkZGNYSe8ZKxGmJjTJiOQ5BJg3Ncb6X1CUHFv4jwEGPfV ETmMj2L4up6KFs+I1KoMV5fsQHB4U9si0nDvGu8jluQyP/xtE80RxJJ+5oFrSyXvaog1 imrfBscHR5c4oolO34UpREly4Di790hbFvT3vZGpP8tEgwCmK74J6KuTcs+mlUtfV5ep y9+JglnKY1Or7Q7VmFoLUDDdwwcw3pKBsLdDWj0neeJg08ovN1it2j8OWzhI0pN8sQfb j0SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b="Q0d/Y/mg"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si750735edt.106.2020.09.02.19.44.17; Wed, 02 Sep 2020 19:44:42 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b="Q0d/Y/mg"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbgICCnQ (ORCPT + 99 others); Wed, 2 Sep 2020 22:43:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726523AbgICCnQ (ORCPT ); Wed, 2 Sep 2020 22:43:16 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D89FCC061244; Wed, 2 Sep 2020 19:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=R9wsgh5OhpmeQRbKxOY/dzd+1XG9pkbfv3w+MHt05O0=; b=Q0d/Y/mgV4RO/6ooAH/2LXQB85 ZikQYl7DEhJw0JBCVSjXGIcMbVl6zsAqiApPOSzVrO1y8bK3bKKyj9OTWEA+5qMAYhsU3JZXS2eK5 9a7hRAU2SIdQMGbq9DDRom0iyJUHoYGUhZXS/YeZca/sFcJ73/1tB8KnKA+zc3rpv8y4UMgXfcnBK jvx39XdFtkReY7yBDOHTu6qi5cjTUROqvV3hq6TweDxWDjVMfByghE+0yJm/Vyw0iKbPXUGwXR6FK Bugf06xfP81L7EWL2gpauc3So1OuivWqjC4vIEy8FaELOqdfi3+mqrqmLR+WmxnGW+45sGf2H3t+I m5W0id0g==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDfDT-0007N5-CZ; Thu, 03 Sep 2020 02:43:11 +0000 Subject: Re: [PATCH 0/2] docs: Add automatic cross-reference for C types To: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Jonathan Corbet Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com References: <20200903005747.3900333-1-nfraprado@protonmail.com> From: Randy Dunlap Message-ID: <1a03c65e-6fbc-25f9-e553-61259a310f29@infradead.org> Date: Wed, 2 Sep 2020 19:43:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200903005747.3900333-1-nfraprado@protonmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/2/20 5:58 PM, Nícolas F. R. A. Prado wrote: > In order to cross-reference C types in the documentation, Sphinx > requires the syntax :c:type:`type_name`, or even :c:type:`struct > type_name ` in order to have the link text different from the > target text. > This patch series removes the need for that markup. > > The first commit extends the automarkup script to enable automatic > cross-reference of C types by matching any "struct|union|enum|typedef type_name" > expression. > This makes the documentation's plain text cleaner and adds cross-reference to > types without any additional effort by the author. > > The second commit updates the "Cross-referencing from > reStructuredText" section in Documentation/doc-guide/kernel-doc.rst > to reflect that no additional syntax is needed when cross-referencing both types > and functions anymore. > > When testing this, I did find an edge-case from the output of > Documentation/output/scsi/scsi_mid_low_api.rst on the "typedef struct scsi_cmnd > Scsi_Cmnd;", where 'typedef struct' is being identified as a reference, but > there isn't any named 'struct', so it renders bold. There also isn't any file name scsi_typedefs.h any longer, so maybe we can update scsi_mid_low_api.rst as well. Thanks. > I thought of adding an ignore_names list just like there is one for functions, > with 'struct' in it, to workaround this edge case, but since it was the only > one I found, and also because it was unclear what the desired output was > (cross-reference 'struct scsi_cmnd' or leave the whole expression as plain text) > I wanted to get some feedback beforehand. > > After getting this merged I intend to start removing the occurrences of :c:type. > > Thanks, > Nícolas > > Nícolas F. R. A. Prado (2): > docs: Add automatic cross-reference for C types > kernel-doc: Update "cross-referencing from rST" section to use > automarkup > > Documentation/doc-guide/kernel-doc.rst | 33 ++++++++++++----------- > Documentation/sphinx/automarkup.py | 37 +++++++++++++++++--------- > 2 files changed, 41 insertions(+), 29 deletions(-) > -- ~Randy