From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D0FC3C1977; Mon, 27 Apr 2026 13:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777294818; cv=none; b=JdR74Ah/bilQZIV3HyZpKxzmfM6cfsVWs2PIqAY2xoiVp9a37v2u0RH5hGFAMgYOEaPcQPbQ6RkWZdiR1kEmKIxshSwyo8lO583+F2L3rG8YqjjkOKnjj0JfV18SDEmm39tHThXMh6sW0RZKHlLLiJMywsGts+lP0ZqT3MLHD1A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777294818; c=relaxed/simple; bh=NuYk28Zg9NLnbQ4d/3en1YVQRZ/qBlcvUunSiLU9FFk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ugot85fSzuYO8oe4rv3Mjmz5NbnYePP3YlEzLz7phppJ/q/QRpMOwuvmwpGdxrrCi3LIpnxgOUEBSTu0mJSKvn6AhtpABRwJcah+8OmNwUz2qaYnP/u1yhY9s5tz2YlDSDLCORd9Cv+k3n6rkXyTdQkdAvM9Y+EwNBMCrqWla8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fgSQESTL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fgSQESTL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AD06C2BCF4; Mon, 27 Apr 2026 13:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777294818; bh=NuYk28Zg9NLnbQ4d/3en1YVQRZ/qBlcvUunSiLU9FFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fgSQESTLs4k+VUkrMZRFkZyhpA0f85vR/s1SWwaInt9wkfoJsREPVHpUAKacAiVsN YrhXym4fuWQRavY7SY7o3DleT842Uf2hhg2j934NiBGjTMpddGXJnhnJ96/d7Mhy4W jTy3Q/xu/we0mdrtja2JvcQ19Ohuo84A0IShkuId4jrMIQX2QClmuLEX4nNytQNUp4 JYYBsOXy/A5SkvlCSuBukhnz8oSnmrDC5vaDx3UnXs/0Gl1V1FQS9GiKI2THNLm+rT bhLFBi3UZWddTCDarTbVtVyYidASUx9YFrzNM+vzKpTMdmPK2mD3/hW1OTfzW6hmaL CQB9EfOUH0BGA== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1wHLZQ-0000000Bx8T-22Ip; Mon, 27 Apr 2026 15:00:16 +0200 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List , Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, workflows@vger.kernel.org, Shuah Khan Subject: [PATCH v3 06/12] docs: maintainers_include: use a better title for profiles Date: Mon, 27 Apr 2026 15:00:06 +0200 Message-ID: <579bc4faf7681bebd71ce373a7d78a96d4f0fedc.1777294623.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab As we're picking the name of the subsystem from MAINTAINERS, also use its subsystem name for the titles. Signed-off-by: Mauro Carvalho Chehab --- Documentation/sphinx/maintainers_include.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Documentation/sphinx/maintainers_include.py b/Documentation/sphinx/maintainers_include.py index 1dac83bf1a65..cf428db7599c 100755 --- a/Documentation/sphinx/maintainers_include.py +++ b/Documentation/sphinx/maintainers_include.py @@ -36,7 +36,7 @@ class MaintainersParser: """Parse MAINTAINERS file(s) content""" def __init__(self, base_path, path): - self.profiles = list() + self.profiles = {} result = list() result.append(".. _maintainers:") @@ -54,6 +54,7 @@ class MaintainersParser: prev = None field_prev = "" field_content = "" + subsystem_name = None for line in open(path): # Have we reached the end of the preformatted Descriptions text? @@ -75,7 +76,10 @@ class MaintainersParser: if match: fname = os.path.relpath(match.group(1), base_path) if fname not in self.profiles: - self.profiles.append(fname) + if self.profiles.get(fname) is None: + self.profiles[fname] = subsystem_name + else: + self.profiles[fname] += f", {subsystem_name}" # Linkify all non-wildcard refs to ReST files in Documentation/. pat = r'(Documentation/([^\s\?\*]*)\.rst)' @@ -112,6 +116,8 @@ class MaintainersParser: output = field_content + "\n\n" field_content = "" + subsystem_name = line.title() + # Collapse whitespace in subsystem name. heading = re.sub(r"\s+", " ", line) output = output + "%s\n%s" % (heading, "~" * len(heading)) @@ -217,7 +223,13 @@ class MaintainersProfile(Include): output = ".. toctree::\n" output += " :maxdepth: 2\n\n" - output += indent("\n".join(profiles), " ") + + items = sorted(profiles.items(), key=lambda kv: (kv[1] or "", kv[0])) + for fname, profile in items: + if profile: + output += f" {profile} <{fname}>\n" + else: + output += f" {fname}\n" self.state_machine.insert_input(statemachine.string2lines(output), path) -- 2.53.0