Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp602128ybb; Fri, 20 Mar 2020 05:00:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtDXMxZVrYUaGgQ+gw9TSBvsfcbYK9Q7nyEY2/oabp4VEN2TPKeHCgHwC6Plei3Fk9QPzMz X-Received: by 2002:aca:a882:: with SMTP id r124mr6166004oie.53.1584705609982; Fri, 20 Mar 2020 05:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584705609; cv=none; d=google.com; s=arc-20160816; b=QRpQumTifeugw3YTK4gkubrWU64hTUJ1JVtmacjlp3wr4smRPJjYifUHBCybuFF3+H LC/+w3Y4a104iUuqY7ZqtGuVJsd20UY8ZJZVZw4qqhqEs+6bf7BZaVInCdYsHTjPA7oj tG2RUttuOPg8/RuIA2eoGfsdviDSAVrxf25NQEYTBTI/BVOaw8gOyV07k7F4zfT2JDUc H4QYV+hY2/rNyhxwPSDhGEh++8ievIZYbTpDiw3pTVnZQSCAfmSpD66aEuY+HWCCmhQe nRCZvBruQSqj/BeaFepBUxIc0lx9edMm4Z7lzqm2BKzpZssyBqdE5OrB7Pf4lX6aKiU9 KxrQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=AzepDb5GI0393IYpXW+UzVIVI1Ikeeedw7XSOR3xZdA=; b=QU0u/olVu6qhm9IjpB/3sU88DGtBI35VC+VZYfQvxsPPJRa50plXAlAQ5x2t73KQVv +zvEfvSULHWVSXCuTF78JAJoJUQyi4ItK5F/eI+xz6EFq4GgmgSCqSPQJpuaQBazSfc6 HrnKWO6bH7HXz6RL0MADaBcKVVRNGwy0JJp8U1NGhAzWQrdMlNzVQWa4aPvVfVd619Rq 5noKwmQyDd9M/3TfULUmEwMvAv6QAhh54hSTgv8+sboJ09ZfaXWYe7q+/P7eLU1ier5V duiKJKsq9W4a7lwKzZwL67FB1HbTf2DLiwljQMODCLIPsLn4tBfPUwGWmvwto7FmN6XX cj9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A7OzQWA8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si2894823otb.252.2020.03.20.04.59.57; Fri, 20 Mar 2020 05:00:09 -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=@kernel.org header.s=default header.b=A7OzQWA8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726970AbgCTL7Y (ORCPT + 99 others); Fri, 20 Mar 2020 07:59:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:39282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbgCTL7X (ORCPT ); Fri, 20 Mar 2020 07:59:23 -0400 Received: from coco.lan (ip5f5ad4e9.dynamic.kabel-deutschland.de [95.90.212.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F0C820722; Fri, 20 Mar 2020 11:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584705563; bh=aoZ7zim27WwTwQgSmmGFXrg6+n7WZ5+GAMCJAf+nuNs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=A7OzQWA832eTfXGvXXmBJRl9zuJTstSvzScbIvTe67lko6VAcDy0fbsFHycitqNzm QrIggfVZI/H+JNW/uwmj/cnwBepqUCcD01OpNG0zBf+sQSewFnlZfC61ug2Kqgvg8l ArS13d+oZsTDTBoinUYI0GEKwBXg7oYpUXp93UIY= Date: Fri, 20 Mar 2020 12:59:18 +0100 From: Mauro Carvalho Chehab To: Federico Vaga Cc: Linux Doc Mailing List , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: Re: [PATCH] docs: conf.py: avoid thousands of duplicate label warning on Sphinx Message-ID: <20200320125918.5eb5af04@coco.lan> In-Reply-To: <3508337.2CZTLhteCP@harkonnen> References: <20200320112122.48244ec4@coco.lan> <16f1c270a9077032de379b1cb30dfbb3e3670aee.1584702515.git.mchehab+huawei@kernel.org> <3508337.2CZTLhteCP@harkonnen> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, 20 Mar 2020 12:24:45 +0100 Federico Vaga escreveu: > On Friday, March 20, 2020 12:12:35 PM CET Mauro Carvalho Chehab wrote: > > The autosectionlabel extension is nice, as it allows to refer to > > a section by its name without requiring any extra tag to create > > a reference name. > > > > However, on its default, it has two serious problems: > > > > 1) the namespace is global. So, two files with different > > "introduction" section would create a label with the > > same name. This is easily solvable by forcing the extension > > to prepend the file name with: > > > > autosectionlabel_prefix_document = True > > > > 2) It doesn't work hierarchically. So, if there are two level 1 > > sessions (let's say, one labeled "open" and another one "ioctl") > > and both have a level 2 "synopsis" label, both section 2 will > > have the same identical name. > > > > Currently, there's no way to tell Sphinx to create an > > hierarchical reference like: > > > > open / synopsis > > ioctl / synopsis > > > > This causes around 800 warnings. So, the fix should be to > > not let autosectionlabel to produce references for anything > > that it is not at level one, with: > > > > autosectionlabel_maxdepth = 1 > > So, for level 1 headers is fine to use autosectionlabel, but if we want to > refer to level 2,3... we have to create labels manually. Yes. If we want to use it for other levels, the autosectionlabel extension would need to be modified to work on an hierarchical way, creating an unique label that would contain the entire hierarchy, starting from the filename. Also, ideally, it should also handle cross-reference locally, searching first for a reference at the same hierarchical level, then at level - 1 and so on. I suspect that, even with that, we may still have some troubles, as right now some files may have explicitly defined a reference like that, but those would likely be easy to fix. Thanks, Mauro