From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: Re: Best practice for embedded code samles? [Was: drm/drv: Use // for comments in example code] Date: Wed, 14 Aug 2019 10:37:59 +0300 Message-ID: <8736i4gpt4.fsf@intel.com> References: <20190808163629.14280-1-j.neuschaefer@gmx.net> <20190811213215.GA26468@ravnborg.org> <20190813160726.3f9eb8c8@lwn.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <20190813160726.3f9eb8c8@lwn.net> Sender: linux-kernel-owner@vger.kernel.org To: Jonathan Corbet , Sam Ravnborg Cc: Maxime Ripard , Jonathan =?utf-8?Q?Neusch?= =?utf-8?Q?=C3=A4fer?= , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, David Airlie , Mauro Carvalho Chehab , Sean Paul List-Id: dri-devel@lists.freedesktop.org On Tue, 13 Aug 2019, Jonathan Corbet wrote: > On Sun, 11 Aug 2019 23:32:15 +0200 > Sam Ravnborg wrote: > >> I wonder if there is a better way to embed a code sample >> than reverting to // style comments. >> >> As the kernel do not like // comments we should try to avoid them in >> examples. > > If you're embedding a code sample *into a code comment* then I suspect > this is about as good as it gets. The alternative is to put it in as a > plain literal text block. That would lose the syntax highlighting; I > think that's an entirely bearable cost, but others seem to feel > differently about it. Not really a Sphinx limitation, is it? You can't embed a /* */ block comment within a /* */ block comment anyway, Sphinx or not. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center