From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>,
Linux Doc Mailing List <linux-doc@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
workflows@vger.kernel.org, Shuah Khan <skhan@linuxfoundation.org>
Subject: [PATCH v3 06/12] docs: maintainers_include: use a better title for profiles
Date: Mon, 27 Apr 2026 15:00:06 +0200 [thread overview]
Message-ID: <579bc4faf7681bebd71ce373a7d78a96d4f0fedc.1777294623.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1777294623.git.mchehab+huawei@kernel.org>
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 <mchehab+huawei@kernel.org>
---
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
next prev parent reply other threads:[~2026-04-27 13:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 13:00 [PATCH v3 00/12] Auto-generate maintainer profile entries Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 01/12] MAINTAINERS: add an entry for media maintainers profile Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 02/12] MAINTAINERS: add maintainer-tip.rst to X86 Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 03/12] docs: maintainers: add SPDX license to the file Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 04/12] docs: maintainers_include: auto-generate maintainer profile TOC Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 05/12] docs: auto-generate maintainer entry profile links Mauro Carvalho Chehab
2026-04-27 13:00 ` Mauro Carvalho Chehab [this message]
2026-04-27 13:00 ` [PATCH v3 07/12] docs: maintainers_include: add external profile URLs Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 08/12] docs: maintainers_include: preserve names for files under process/ Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 09/12] docs: maintainers_include: Only show main entry for profiles Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 10/12] docs: maintainers_include: improve its output Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 11/12] docs: maintainers_include: fix support for O=dir Mauro Carvalho Chehab
2026-04-27 13:00 ` [PATCH v3 12/12] docs: maintainers_include: parse MAINTAINERS just once Mauro Carvalho Chehab
2026-04-27 13:05 ` [PATCH v3 00/12] Auto-generate maintainer profile entries Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=579bc4faf7681bebd71ce373a7d78a96d4f0fedc.1777294623.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=workflows@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®