Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2033121lqp; Sat, 23 Mar 2024 23:23:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWrh7ZSo/bLW02YvTmrPhmn8008oiOVka9nZnvY5tlc+FXzEaBc5piIImKnJTBgMYqAoweRHLNycpvspJKCGlR91PhWIGAD+3evuClFvQ== X-Google-Smtp-Source: AGHT+IFN2eydQT636abE1udsU30c71YDizczDOzTsp4IK+x9B6ooj/CenYWjv7MQnk3ot8qlG5cu X-Received: by 2002:a05:6a20:9147:b0:1a3:bdd4:a298 with SMTP id x7-20020a056a20914700b001a3bdd4a298mr1627178pzc.43.1711261435169; Sat, 23 Mar 2024 23:23:55 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p18-20020a170902e75200b001e0b5d4a295si621652plf.422.2024.03.23.23.23.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 23:23:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112604-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-112604-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112604-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C40BBB214FC for ; Sun, 24 Mar 2024 06:23:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B09014A98; Sun, 24 Mar 2024 06:23:44 +0000 (UTC) Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D9321A38EB; Sun, 24 Mar 2024 06:23:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.223.78.240 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711261424; cv=none; b=hwDBtyZeQekHPWtxDdv8rx2/vGdBVfW0ppdngM40lJJUnkcTFB6KbXe6BFK1BumB61+7+xDf+nSVLZhej61H4XgyDoD+UA7q4VK3AA/WV3FZZvD0U/rGotcvCseDtwEieX7xxVLqpdaRf+yBU0Ir35PAJ3/UWHYJESFyYdGEO9c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711261424; c=relaxed/simple; bh=xKf9YqC0cOax9MfVOOKhHtECwOyzX1d8Jmc9K64UGZ4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DyBVfwf54t40hw/RnYxnrR4+kkhWxkPz6sJA67eJ8Cll3C5FJnp8dutH6pzcDHq83y6BdR49Respo+QN/iflC8PEppf4izEEjQqu2tYzDqmTmIMhPSSxwnLFYhnVkTtgC+hFxCOdpcFJidrlVqSwfy1T/5JZ1Z6Gp1dED/ALtBg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de; spf=none smtp.mailfrom=h08.hostsharing.net; arc=none smtp.client-ip=83.223.78.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 657EC2800BBCD; Sun, 24 Mar 2024 07:23:31 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 50E954AB00; Sun, 24 Mar 2024 07:23:31 +0100 (CET) Date: Sun, 24 Mar 2024 07:23:31 +0100 From: Lukas Wunner To: Dan Williams Cc: Matthew Wilcox , Peter Zijlstra , torvalds@linux-foundation.org, Bjorn Helgaas , Ira Weiny , Jonathan Cameron , Jesse Brandeburg , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Jonathan Corbet , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, linux-doc@vger.kernel.org Subject: Re: [PATCH] cleanup: Add usage and style documentation Message-ID: References: <171097196970.1011049.9726486429680041876.stgit@dwillia2-xfh.jf.intel.com> <20240322090630.GA40102@noisy.programming.kicks-ass.net> <65fdd7ae82934_4a98a29429@dwillia2-mobl3.amr.corp.intel.com.notmuch> <65ff7a88e93fb_2690d29429@dwillia2-mobl3.amr.corp.intel.com.notmuch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65ff7a88e93fb_2690d29429@dwillia2-mobl3.amr.corp.intel.com.notmuch> On Sat, Mar 23, 2024 at 05:57:45PM -0700, Dan Williams wrote: > Hmm, how about split the difference and teach scripts/kernel-doc to treat > Peter's preferred markup for a C code example as a synonym, i.e. > effectively a search and replace of a line with only: > > Ex. > > ...with: > > .. code-block:: c > > ...within a kernel-doc DOC: section? > > Might be easier said the done as I stare down a pile of perl. Maybe a > perl wrangler will come along and take pity on this patch. On line 757, there are two regexes... # # Regexes used only here. # my $sphinx_literal = '^[^.].*::$'; my $sphinx_cblock = '^\.\.\ +code-block::'; ..which are (only) used immediately below in output_highlight_rst(). Amend those regexes to also match "Ex.", e.g. my $sphinx_cblock = '^\.\.\ +(code-block::|Ex\.)'; Alternatively, add another variable definition and match against it in output_highlight_rst(). A third alternative is to use the "::" syntax in lieu of ".. code-block:: c" in your C source file, if that causes less eyesore for Peter. ;) Thanks, Lukas