Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp528272yba; Fri, 26 Apr 2019 04:32:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqygyvRp84pEBwkqlDSWTMjckEjbunZz8D5eytrWx0or9xU1zmoVlL81PWoM0XDm+23kKixv X-Received: by 2002:a17:902:86:: with SMTP id a6mr44920465pla.277.1556278348047; Fri, 26 Apr 2019 04:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556278348; cv=none; d=google.com; s=arc-20160816; b=c4+jF8tJJZFni7mS1oHJeqqhu5udK8XDraLQ+T1dobB2umpDu5VCOVM1v7P/ttR2ak Z0sS/spVT+99Z0cHqQMU0xltzZovCAEu1HdDx6RKrdR79a27+5b7AlVzG+BuxDfg33TM iSYUmyom0I7+r6Qimub2JlmfI0UtbjyvoM+lrjqMjr4pqUCjpFQBA2zXC0e2SIPiTFjU l9a77FLohR3iI755VAQN3lxGQnkA8dk4cpWGmqLygTjzaoV3DNp/5Hog8yqY3rvuJZ32 974bnKYTai6rVG5xB0xTaeN39bgTKX5uNJZN2qa+ldNVUFHA+43JPLG+97JRIver8KZz 0tqQ== 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; bh=QKItzZqJiYlm6IrdKz2eGDlBIHVIMEVsXCh61mdUkvk=; b=VXwVe0ibWQIh+24ViVTSQpUlE4J/CGf8ovIt1AUW4mOQg25JcnmfHQX/WCNFmYEeOu KzGT8lWp7FkaWecHBQe/ahPc7nTzLIvAwjdqC+tZwLbn0Qvhook203BOp3RC8SjfiiLy eb1ynR36UmcVNY7NDhoGM8WudUmNJN8AFb3BQ2unrxEYhbkOcQf7GHze6znKGXtCKek3 SDc+q7/TuxQ3jm2ood9Mh/XJ3gL8FkDEKBsovancOMRCva6T7kIY53LROn/qBoIY7Gxf n1trpn9YHHN9GAnc6/VZ0u30dGq5ZJKNmDnhhp99eNjYDLvefEWn7Rbg+gQVDIG8qxdB EZ/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si3432143plp.253.2019.04.26.04.32.11; Fri, 26 Apr 2019 04:32:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726050AbfDZLbU (ORCPT + 99 others); Fri, 26 Apr 2019 07:31:20 -0400 Received: from smtp1.goneo.de ([85.220.129.30]:33670 "EHLO smtp1.goneo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725923AbfDZLbU (ORCPT ); Fri, 26 Apr 2019 07:31:20 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp1.goneo.de (Postfix) with ESMTP id E7D0B23F296; Fri, 26 Apr 2019 13:31:16 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.756 X-Spam-Level: X-Spam-Status: No, score=-2.756 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=0.144, BAYES_00=-1.9] autolearn=ham Received: from smtp1.goneo.de ([127.0.0.1]) by localhost (smtp1.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IGS607Rw8s9R; Fri, 26 Apr 2019 13:31:16 +0200 (CEST) Received: from [192.168.1.127] (dyndsl-091-248-137-208.ewe-ip-backbone.de [91.248.137.208]) by smtp1.goneo.de (Postfix) with ESMTPSA id A50E923F35F; Fri, 26 Apr 2019 13:31:15 +0200 (CEST) Subject: Re: [PATCH 1/2] Docs: An initial automarkup extension for sphinx To: Jani Nikula , Jonathan Corbet , linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Matthew Wilcox , Mauro Carvalho Chehab References: <20190425200125.12302-1-corbet@lwn.net> <20190425200125.12302-2-corbet@lwn.net> <87tvelrv8d.fsf@intel.com> From: Markus Heiser Message-ID: Date: Fri, 26 Apr 2019 13:31:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <87tvelrv8d.fsf@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 26.04.19 um 11:06 schrieb Jani Nikula: > On Thu, 25 Apr 2019, Jonathan Corbet wrote: >> Rather than fill our text files with :c:func:`function()` syntax, just do >> the markup via a hook into the sphinx build process. As is always the >> case, the real problem is detecting the situations where this markup should >> *not* be done. > This is basically a regex based pre-processing step in front of Sphinx, > but it's not independent as it embeds a limited understanding/parsing of > reStructuredText syntax. This is similar to what we do in kernel-doc the > Perl monster, except slightly different. > > I understand the motivation, and I sympathize with the idea of a quick > regex hack to silence the mob. But I fear this will lead to hard to > solve corner cases and the same style of "impedance mismatches" we had > with the kernel-doc/docproc/docbook Rube Goldberg machine of the past. > > It's more involved, but I think the better place to do this (as well as > the kernel-doc transformations) would be in the doctree-read event, > after the rst parsing is done. You can traverse the doctree and find the > places which weren't special for Sphinx, and replace the plain text > nodes in-place. I've toyed with this in the past, but alas I didn't have > (and still don't) have the time to finish the job. There were some > unresolved issues with e.g. replacing nodes that had syntax highlighting > (because I wanted to make the references work also within preformatted > blocks). > > If you decide to go with regex anyway, I'd at least consider pulling the > transformations/highlights from kernel-doc the script to the Sphinx > extension, and use the exact same transformations for stuff in source > code comments and rst files. FWIW mentioning: I fully agree with Jan. -- Markus --