Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp925010pxu; Wed, 7 Oct 2020 21:17:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxa2Bz80WE2djYHiL7vRRMUrDK4RDXnJxg/7LWsbwYvWeK1FKITobsmKFabK7KijdQynBG7 X-Received: by 2002:a17:907:392:: with SMTP id ss18mr6680962ejb.429.1602130636963; Wed, 07 Oct 2020 21:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602130636; cv=none; d=google.com; s=arc-20160816; b=ZuMyCbiY4J9usUGoYBQrpI0oDw8wA4YncXSPq1pj4P971Wy4FO45LWV1T8tSl/EqnD Dnxn1+HyHLeD1mTaxdd0Hw6ZCiYdMKGS75ESnxcg8ddH8a2ycKnwaH0olDcpL6mAO1/Z 4wt/qKl6MJQtylyZg3WB2sNS7MXMDcPT8ufTpxLPnpNEKmH2XC8A0WJyS1ELRcGY0t7j aiiC94Rf2MYe8GHy8xrZuVZKKQjWT3gwnlxqCcroY3EAh8VifE7rcWHUduQgxEw5N0BX fbi/JpLjd3aFK1Dscb1T7SjuGLUQRcOjne3pbvf0oIT+Drjx/BiQBkZcxRumnnm5DdUN E5Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rrnmw/1AqLnfIB4Al9wZnYMvqYnWVlZSjEgeVO7+Jdo=; b=QpoVTuEl0t3K57KsKWatB3XUtkCYyjrgnl6FF+LPXRmQ6btUnd1DFsWpbCmWqxPArf eKVu5zBTafvHb11dKkhTXU57Bko/gNIRw8iusHQNA2KsiXqVPjzCqw6itXlxUwTezf8K xGWKqtQGem+A9UVDIAFwT0uqUZN0kUgPgCaXlvZgSACUNVqw4L6azfqcvd6uuXSa/KPs kzGpIw/xd4mQSyNj9owJlj1+P0kx7PAsWfe4F0OUp/58BhaEQfMTA3H+2GlXIa205MNh 4s1y6c04jNwdbY2bklEPNFbqGkjo1KdINDHsocARqsldja+3DEyH2xjGLhIdiAwV7kTR xcOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=r4wcMIOi; 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 s20si2717701edr.0.2020.10.07.21.16.51; Wed, 07 Oct 2020 21:17:16 -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=@infradead.org header.s=casper.20170209 header.b=r4wcMIOi; 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 S1728260AbgJHCrR (ORCPT + 99 others); Wed, 7 Oct 2020 22:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728209AbgJHCrR (ORCPT ); Wed, 7 Oct 2020 22:47:17 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 646E1C061755; Wed, 7 Oct 2020 19:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=rrnmw/1AqLnfIB4Al9wZnYMvqYnWVlZSjEgeVO7+Jdo=; b=r4wcMIOizMp5uMKfjPrjz6gf4F ZhYTebc1UwisNEY7lCxt3SneN2BKAG+k9jaLelDZhLgmkUpoMd/PtuYgKf+APR/VzjlQ05+W4USEy W2kbnik33iJOmqQkXiiSP9GlyZs/eisRO3tSAD8QgyO2OXAmhH9tuv70etRrNw/r+qPzvRYWVS6U8 lNo139eDM8wkD3lBugEsQKO/wFwfstVvxIreqsnusxAxTDqtwGDekvqz1JKjlWhGnwmp4UuJ51jei lh1ifwGWnqAxWNQvLhzt1Yl/5R69OlSkfX2nmDiRvfYWT7/6ZgnBzY9Lq2Eo2MQ+p+NA8Wy+OdKnL 7tgWav5A==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQLxS-0004h6-O2; Thu, 08 Oct 2020 02:47:06 +0000 Date: Thu, 8 Oct 2020 03:47:06 +0100 From: Matthew Wilcox To: =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado Cc: Jonathan Corbet , Mauro Carvalho Chehab , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com Subject: Re: [PATCH] docs: Make automarkup ready for Sphinx 3.1+ Message-ID: <20201008024706.GZ20115@casper.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2020 at 02:15:24AM +0000, N?colas F. R. A. Prado wrote: > > I have a feature request ... could you automarkup NULL as being > > :c:macro? > > Or maybe just anything matching \<[[:upper:]_[:digit:]]*\> > > (i may have my regex syntax confused ... a word composed of any > > arrangement of upper-case, digits and underscores.) > > I think what you are suggesting are two separate things. > > For NULL, what you're interested in is that it appears in a monospaced font, as > if written ``NULL``, right? As I don't think a cross-reference to "the NULL > macro definition" would make much sense. > > While "anything containing only upper-case, digits and underscores" would > actually be for cross-referencing to the definition of the macro symbol in > question, right? Well, maybe! What I'd really like is to remove all the markup from xarray.rst. Jon managed to get rid of most of it with the (), but there's still markup on: LONG_MAX NULL -EBUSY true XA_MARK_[012] XA_FLAGS_* ENOMEM EINVAL I'm not sure there's much that automarkup can do about ``true``, but all the others fit the all-caps-and-underscore-and-digits pattern. I don't know how much we want errnos to link to anything in particular. So maybe split these into 'well-known' (eg defined by ANSI C or POSIX) definitions and things which are local macros: LONG_MAX NULL -EBUSY ENOMEM EINVAL vs XA_MARK_[012] XA_FLAGS_* I'm willing to add more inline kernel-doc to get this to work better. Or even convert #defines to enums ... whatever gets this working better. > At the moment, this automarkup script is being used only for cross-referencing, > but it is indeed a generic automarkup script, and could be used for the > formatting of NULL. But we also can't just make every upper-case word written > in monospaced font, as that doesn't always makes sense. > > So if I understood your two requests correctly, I think we could: > 1. Always automatically format NULL using a literal ``. > 2. Try to cross-reference every upper-case word with the macro definition using > :c:macro, but if the cross-reference doesn't exist, format it normally, since > it's just normal text (this is what we're doing for C references at the moment). > > What do you think? I think this works well, except that we need to match not just NULL but other well-known ANSI/POSIX keywords. Thanks for entertaining this!