Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4727900pxf; Tue, 30 Mar 2021 15:50:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsfzhm1CPHA0YHpHpzqYtiE/c4r70t0ko7fmdDpmTzk7s7JwOKat8MARagF+XFFfTjMS32 X-Received: by 2002:a17:906:b2cd:: with SMTP id cf13mr433394ejb.181.1617144647206; Tue, 30 Mar 2021 15:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617144647; cv=none; d=google.com; s=arc-20160816; b=anJbi9IPGug26BKeONmzpBe7Baonh2SLYRLCs0TMoTXL/V3wh9hiIDcLgO6Zcw6R29 khY/hSScOSCZstLBpTluTs+BZ6yNihOvLTe2z68KqWCYP+aaw18pYKmBoK5Hh0jnyjxL BwO7KiysP/xpe0sbqQhMXpEzi0hCZztTeJMD3rQz2cPAV+hfUI+YR2RN1gNETG/NRfoC Im8S8oTZRRRs8d6eDUf2NBfxM49x/HBuxHiRjg49dCFxq7RdNed8TSWmm62XZezmb/TC NbQtQO8q+mpNLZArV5nW126Z/o1D4LEfsSvSQ1vEBrrS89TgHvJWkChmV+A8VYS0HonP +eCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ejqbwz/4EkB7cjA6s77zDBNNeHlW7Gc17XQkwT+jGR0=; b=rNXNDBfzx4zvH76+McqhSeLwqUr+06jB9JQfEbTRUU/mw1qpMks7dj4Kws+DO1onUd L0M+Ex2JsIih8TDUzT+gYEuSNgSdJwg8hnknXAhOtogBpWsDjTnjl1w23UaDKNXG8ZG0 qPbZf9Ybj0QxOqwNKy22yZB1K5ngSQZZk8/2YKgFkHEscjTBFQ0BP0gH0DjYAEdckQQe EyALzr7Wn5RymVNxw6nqG0s6cdswKqzPkz2SkmA6uimrvklhkZNDQ5AfyCUPLMwQg6Hd UE7QOhqEJ36VXkmaoRwj5dmr361WC95D8E4wlctVQFY0ZUbxNjyKM2xHAlmav0fuGz4R u+mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QZHm3lIo; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si161566eja.266.2021.03.30.15.50.24; Tue, 30 Mar 2021 15:50:47 -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=@gmail.com header.s=20161025 header.b=QZHm3lIo; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233133AbhC3Wqy (ORCPT + 99 others); Tue, 30 Mar 2021 18:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232984AbhC3Wqa (ORCPT ); Tue, 30 Mar 2021 18:46:30 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF725C061574; Tue, 30 Mar 2021 15:46:29 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id v107so14077978ybi.9; Tue, 30 Mar 2021 15:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ejqbwz/4EkB7cjA6s77zDBNNeHlW7Gc17XQkwT+jGR0=; b=QZHm3lIoa3bbuGYkTKiqOXnNOEwBUO0+4Go0DX4ebrfg62LFwPNDBR8Xl1Y6MyoKH0 YoQSDLayToitnhPDOCFVo8PFceArYaSoHSH4z98GoBGuCKpQhggnHYW/2VagdMuaOqgB WemxDfM/YWX6235a3pg387TOjCH50xCzhxwVWa5eXzTxouQAoeULYvD0KEPgA3O42cXP LefUsow8u6yutZIAKypyHQyufMaxT4fDGk3NDgjenArm7ikZpHwjI141jOY/y0P4E2TG NdL7gBfT9fyz7h+pi4q+NHmsz9gUZotlqTEzDfskj45r1217aDQJQWXaFGH1AgVn1FbY gVAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ejqbwz/4EkB7cjA6s77zDBNNeHlW7Gc17XQkwT+jGR0=; b=i8vwsaCpT0qX9A8eFv/jXWa5snszSqhkq43XLjlGEB5XAZUUBX4UbesaRHsx+Y4oQR +VYGaR1G3vvbiS+LbnVV9+kq6VNLnzaVq+sYSl6XoE1SM5uuyI0l+jj4hxPgDASTGf3X s3cQ/aHrXytgEsvDMznvjQVXAZoQ6f5pVjc+dVNsYUvyvTdn479UtmiQ16KuGMQC36me ysTEhapgl38snNiZIbEm0AF5g4O4Rw5Vt2Ibbnpi34nLJcr8JVDIuCJ1ftco86cEJxhb 9mw67vpG1TWZ4ESTfLApFXLcaSw5ekseIKqAgHJI4OgAZIW9H+ODGAkKslg42Gx5QnNX OPlg== X-Gm-Message-State: AOAM531/HXY1C0iP7fSfQLFh73tEa+wzQBFqXLYaaxqLCFZXaCBKwAyQ qIejgSc3sbRbQRTL9HlaOT4QUOP3A7Xv5ZWSelhbN/PP6rojQg== X-Received: by 2002:a25:3cc6:: with SMTP id j189mr597494yba.247.1617144389096; Tue, 30 Mar 2021 15:46:29 -0700 (PDT) MIME-Version: 1.0 References: <20210325184615.08526aed@coco.lan> <2cf44cf1fa42588632735d4fbc8e84304bdc235f.1616696051.git.mchehab+huawei@kernel.org> <87tuozyslu.fsf@meer.lwn.net> <20210325191435.GZ1719932@casper.infradead.org> <87a6qrx7wf.fsf@meer.lwn.net> <20210325221437.GA1719932@casper.infradead.org> <87wntooq71.fsf@intel.com> In-Reply-To: <87wntooq71.fsf@intel.com> From: Miguel Ojeda Date: Wed, 31 Mar 2021 00:46:18 +0200 Message-ID: Subject: Re: [PATCH] kernel-doc: better handle '::' sequences To: Jani Nikula Cc: Matthew Wilcox , Jonathan Corbet , Mauro Carvalho Chehab , Linux Doc Mailing List , Rob Herring , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 1:07 PM Jani Nikula wrote: > > FWIW, and this should be obvious, I think going with what's natural for > documenting Rust source code is the right choice. Markdown as parsed by > rustdoc. People will expect Rust documentation comments to just work, > without some kernel specific gotchas. Don't try to reinvent the wheel > here, it's a dead end. Agreed! > The interesting question is, I think, figuring out if rustdoc output > could be incorporated into Sphinx documentation, and how. It would be > pretty disappointing if we ended up with two documentation silos based > on the module implementation language. I want to have the Rust docs linked from Sphinx and uploaded as usual to kernel.org etc. However, please note that the implementation language implies a lot of things, not just the "implementation language", if that makes sense. For instance, if you write your module in Rust, the idea is that you use the Rust infrastructure and exposed abstractions -- not that you call C kernel functions on your own. > At the moment it seems to me rustdoc can only output HTML, and that > seems pretty deeply ingrained in the tool. AFAICT, there isn't an > intermediate phase where it would be trivial to output the documentation > in Markdown (though I don't really know Rust and I only had a cursory > look at librustdoc). And even if it were possible, with Markdown you'd > have the issues with conflicting Markdown flavours, what's supported by > rustdoc vs. commonmark.py used by Sphinx. Please note that `rustdoc` generates HTML that is intended for Rust code, i.e. generating an intermediate format to then generate HTML from Sphinx would make the Rust docs worse, unless the mapping is perfect (but, at that point, why not just keep the standard Rust docs?). > Perhaps the bare minimum is running rustdoc first, and generating the > results into Sphinx static pages [1], to make them part of the > whole. Even if the HTML style might be different. Perhaps it would be I don't think it is the "bare minimum", I think this is the optimal solution! :-) It is also not just about the style. The Rust docs are organized for Rust code, the search functionality is meant for it, etc. > possible to come up with a Sphinx extensions to make it convenient to > reference content in the rustdoc generated HTML from reStructuredText. For C -> Rust links, the plan I suggested to Jonathan was to have Sphinx generate a text file with (reference, URL) pairs that then `rustdoc` can use as links (e.g. to link to, say, the docs for `printk`). I also discussed it with the `rustdoc` maintainers, and they thought it would be an interesting proposal, so I agreed to make an RFC for it (note that it can be useful not just for Rust docs that need to refer to C code, but also for any other kind of external content, e.g. imagine a math library referencing a set of papers, books, etc. without having to re-write the URL everywhere). Cheers, Miguel