Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp857491pxk; Thu, 3 Sep 2020 14:34:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFKJHaig6cuaioGUqIyekdgp97HNttFR+R4AH/snQRcj1ilHZUXz3h9DRdoQNcqTW8oRyw X-Received: by 2002:aa7:cb83:: with SMTP id r3mr5217594edt.35.1599168855017; Thu, 03 Sep 2020 14:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599168855; cv=none; d=google.com; s=arc-20160816; b=Vq/JM43nYh2l972DnSYOAcJJQeA89JvbRVm4bX3caCzCE0GZRKp693wtcSXo/pkDQJ PgZwFhK5uRDq6A9uz9AeNi4hc/iKr8+IrCArOc0aRUkgtQ0WZaRdTRoppJUCv4dsWamV unzQfSIDxEF494NUq5+x8Z4iQbVZfLW4OqBl07oJm5wjiydHmKhV7EKXw3CzCtpn8n6D P5TxXbKQzM7dIjD5jpR7kaiOXLI+X5lD9nw14T2bTxkZ6lK+j0VCTHci9yf48Qzls3Fn WpeU7FINUnXXiIeJ7oOXn0LZi8qxs89xpy5IZKFeEUWuGN0yT2OEBXwPWYmFMReDgsDY CeYQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=qhd2wF++5tcW86SjEpa/NKXEk2ezhA6XcYthrm3BWMU=; b=GUcNHJd1Tf384qmfma1BVlYOZnjYR98VZood73psUwW4WdTXx5Ld5oW0XpmycL0XT9 cRmUfwJVKrgIet+8ITQa7CpElJ9tUXRiTMm0xpu2q768xoId2YyjqW6PGQJFVoDY7Bnv PpkbCzcGwaL9+RobgK3o7/LrGMYqj4YR3jy9Eh2GYjEyR5mlkQfFpqR8yc7isvJHu1D9 OLFLT7xCjrKm/KfNj3QoPbY+cPWnERbZksBligHlDeuX9w4gHbXJzx/8loIGIQgihAke XPp2ImAZ5WRLKOuA/uL9/NZd5LAoTJUueFNvKZQNKzGMQ9v50U+L2Iu+K0/0deaOg96e UPSA== ARC-Authentication-Results: i=1; mx.google.com; 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 mh1si2751299ejb.437.2020.09.03.14.33.51; Thu, 03 Sep 2020 14:34:15 -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; 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 S1728134AbgICVdT (ORCPT + 99 others); Thu, 3 Sep 2020 17:33:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbgICVdS (ORCPT ); Thu, 3 Sep 2020 17:33:18 -0400 Received: from ms.lwn.net (ms.lwn.net [IPv6:2600:3c01:e000:3a1::42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5991C061244; Thu, 3 Sep 2020 14:33:18 -0700 (PDT) Received: from lwn.net (localhost [127.0.0.1]) (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 E184E7DA; Thu, 3 Sep 2020 21:33:17 +0000 (UTC) Date: Thu, 3 Sep 2020 15:33:16 -0600 From: Jonathan Corbet To: "=?UTF-8?B?TsOtY29sYXM=?= F. R. A. Prado" Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com Subject: Re: [PATCH 0/2] docs: Add automatic cross-reference for C types Message-ID: <20200903153316.2f31f4d6@lwn.net> In-Reply-To: <20200903005747.3900333-1-nfraprado@protonmail.com> References: <20200903005747.3900333-1-nfraprado@protonmail.com> Organization: LWN.net MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 03 Sep 2020 00:58:09 +0000 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. So I've looked this over, applied it, looked at how the output changes, and generally put an untoward amount of effort into finding something to grumble about. I failed. This is a great change - thanks for stepping up and doing it! > 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. > 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. As Randy pointed out, the documentation in question is obsolete and incorrect anyway; there's really not much that can be done in the docs build system to fix *that*. I'm not going to worry about this particular glitch. If you felt so inspired, a patch to the SCSI maintainers just removing that paragraph might be well received. I'm going to go ahead and push this out to linux-next; we'll see if anything explodes from there. Thanks, jon