Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp776173imm; Thu, 5 Jul 2018 08:41:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfn7emSQkBO6Kc1wcD5wqeDDVjlXoOzIya9YFGIKUrHmvr7gW9CEx677aVmQbNkLwU1Q8cM X-Received: by 2002:a63:8dca:: with SMTP id z193-v6mr6207434pgd.228.1530805277017; Thu, 05 Jul 2018 08:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530805276; cv=none; d=google.com; s=arc-20160816; b=kYxJqoT4Ow22YyvguJKIal1A6pI3JgYevJeLDEcVIWAHIhZTFc3fYZ7HpQmEKFo8mE Po/nu0y/T9iXBOTYSXWUeYS9iGC7soMJriJy0B6/woxvme/sTzKktWlmaBGKHaJSRs80 smZdIgMhw7M45o7fsCFADNhtB8UwvrjgsfxRNiy0e5SONgCMm0lXtkJ+A6rpM98dZivl Ssw/h8EJGVGrTTcxumVpwxdbb1li1fycNE6XgUr7/iTtlr64pHwO92QtxJ7HCRkgIVA7 QaRmcpua28ah/pm1fU81kKbF4rXrMKTJsObdTWzueo0Xb+pyMUsw2j9GkmEfzrh6QDnJ 7Q4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=kSUYQLHyLcSFkGc1/b0yqUFkZZqqNVuedC4iwKh0QeA=; b=pp7bJVdbt9uVEVHQqH7HvP/kFLnLOYNTGvsiiLhurWLcgMh7VPJM/fGtGibr3CP5Vv Gr7MHb5Yj+lSwO/rHQqS0Tn3BASGSSl3xuQOdWzQ7PM3qBsrAtrtT0qvD2XM5y3Yy9VI xQJH+YPnET/vOyj6BjG/Lz4huI7pwnSBxZ2T5tTOJ0rbJDOBlQe6gkENks/ITY0ddVme oQXS/aNHS2VeOUOPTiNwQvhFEnHZ1prmUISW51BLKzMvlQT1HswuxODV/2YsRDzloc6Z 8f+65UTcb/ZbhN/hjj3jrvOoEbeH076MU6+ovO5cNFc6WUPmWO6FBwQdoDZ1ew6aFqYP 3WvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=KFT6YVEl; 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 h4-v6si5960397pgm.441.2018.07.05.08.41.01; Thu, 05 Jul 2018 08:41:16 -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; dkim=pass header.i=@ffwll.ch header.s=google header.b=KFT6YVEl; 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 S1753625AbeGEPkL (ORCPT + 99 others); Thu, 5 Jul 2018 11:40:11 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:52749 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753400AbeGEPkJ (ORCPT ); Thu, 5 Jul 2018 11:40:09 -0400 Received: by mail-it0-f68.google.com with SMTP id p4-v6so12591478itf.2 for ; Thu, 05 Jul 2018 08:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kSUYQLHyLcSFkGc1/b0yqUFkZZqqNVuedC4iwKh0QeA=; b=KFT6YVElt6KiPl2D0D3isFxdjgaCW9y/pfetWK9PZ4g4118f09sS3QSKcgErgDPp08 LvlvNxQqdGkwH9CsjN06dyHI2VvhQ1dWMJgVOzIVc/nGGMAfKxvnlFi9ob7U3MuULOCJ /GhoGhk5BVUrum8eIVHpamO8ufZcptnH7bmx0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kSUYQLHyLcSFkGc1/b0yqUFkZZqqNVuedC4iwKh0QeA=; b=lf118f55bUsjMjsnPZ5fbKJy6Ytr3wjCDHRXShOgWKT5JP2v9OQPYaoZSAKsZUivdO pw8EFkni9WOxHpDqHRBDky2XG7b+OYTX1hkGyGV+/Hb2RIJR/HcVnjmo5cOKh0lWkQfV B+hchvVfcFUQEa1keF/o9msdoAJ1zi6i6FGbR7Tu5WlATvqkrennShSKgtdA1JQKD7OE cnYnOvGXCBE6SD06I4YknMZxY697jV2B6aK71OIX00vXBVCD+EG3pf8oGeos/QFLTCvM qSvHqmAEmdkT3a+/dUMIMCpd1JJb0oV3+hLmqjLkdv7RrehIqE7pmywHENNNRzUSjHf2 ACcw== X-Gm-Message-State: APt69E3Z+KhrTMrww5qWycYlQOS8H2bWLBXDcugvPol9o7d59Hb6kCUH 7pX0aRdQ/Ztd0wlfaLdJKnCgQVWon1sp7xNlaVSF0w== X-Received: by 2002:a02:982:: with SMTP id 2-v6mr5155955jam.79.1530805208799; Thu, 05 Jul 2018 08:40:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:e492:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 08:40:08 -0700 (PDT) X-Originating-IP: [2a02:168:5628:0:496f:7dc5:66d7:a057] In-Reply-To: <87in7q33ei.fsf@intel.com> References: <2ac6e3da22119f714406925139e40f4d835d11a4.1525962971.git.mchehab+samsung@kernel.org> <20180510163456.GC30442@bombadil.infradead.org> <20180510105105.5cb0d54f@lwn.net> <87in7q33ei.fsf@intel.com> From: Daniel Vetter Date: Thu, 5 Jul 2018 17:40:08 +0200 Message-ID: Subject: Re: [RFC PATCH 1/2] scripts/kernel-doc: Auto-detect common code-blocks To: Jani Nikula Cc: Jonathan Corbet , Matthew Wilcox , Mauro Carvalho Chehab , Mauro Carvalho Chehab , Christoph Hellwig , Linux Doc Mailing List , Linux Kernel Mailing List , Ingo Molnar , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 14, 2018 at 1:03 PM, Jani Nikula wrote: > On Thu, 10 May 2018, Jonathan Corbet wrote: >> On Thu, 10 May 2018 09:34:56 -0700 >> Matthew Wilcox wrote: >> >>> I think this is a bit fragile. Why not just search for ':\n'? Is >>> there ever a case where we want to write: >>> >>> /** >>> * foo is a bar: >>> * wibble >>> */ >>> and have wibble not be a code-block? >> >> Yeah, we might want to write something like: >> >> - Leading off a bulleted list >> >> 1) or a numbered list >> >> for example. That's why I was thinking of looking for explicit markers >> for such lists. >> >> It'll take some playing around with to have a hope of getting right, >> methinks. > > We had serious trouble with the old DocBook toolchain because the tool > pipeline was so long, and each step had its own expectations and quirks. > For example, remember the escaping needed for xml in kernel-doc? Or tmpl > xml files being invalid xml because of the docproc directives? One of > the big benefits of the current toolchain is minimizing the amount of > special casing magic required. > > The more we add custom syntax sugar in kernel-doc, the more we run the > risk of running into hard problems later on in the Sphinx phase. For > example, our own syntax preventing the use of legitimate rst syntax. And > now we get somewhat reasonable error messages from Sphinx when things go > wrong; we didn't get that when the impedance mismatches caused issues > with the old toolchain. They were hard to debug and mostly nobody even > bothered. We should work to reduce the amount of special processing in > kernel-doc, not the other way round. > > The use of "::" is a valid and arguably rather non-invasive rst token > for indicating the following indented block is a literal block. Adding > heuristics (especially ones based on English language magic words) will > lead to bigger problems than it's trying to solve. Very late +1 on this. I think :: plus a 4 char indent is a very non-intrusive way to shut up sphinx, and most reasonable maintainers can be convinced of the same. Some insists on making docs worse for everyone for some ideal of plain text purity in comments unfortunately. And I also fully agree with Jani on maintainability headaches with custom syntax and heuristics. It just makes debugging toolchain issues extremely painful. What we have right now is about the bare minimu that was required for a smooth transition, and no more. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch