From: Mauro Carvalho Chehab Date: Tue, 8 Apr 2025 10:09:19 +0000 (+0800) Subject: scripts/kernel-doc.py: properly handle out_section for ReST X-Git-Tag: v6.16-rc1~176^2~49^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9235ec5e2bf8ccd3f3ef30bbb1811bf9ddb3ef08;p=thirdparty%2Fkernel%2Flinux.git scripts/kernel-doc.py: properly handle out_section for ReST There is a difference at the way DOC sections are output with the include mode. Handle such difference properly. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/935d00c6a7c45b25a8be72fad6183fe5a8476cd2.1744106242.git.mchehab+huawei@kernel.org --- diff --git a/scripts/lib/kdoc/kdoc_output.py b/scripts/lib/kdoc/kdoc_output.py index 7a945dd80c9b5..d0c8cedb0ea58 100755 --- a/scripts/lib/kdoc/kdoc_output.py +++ b/scripts/lib/kdoc/kdoc_output.py @@ -315,12 +315,12 @@ class RestFormat(OutputFormat): if section in self.nosymbol: continue - if not self.out_mode == self.OUTPUT_INCLUDE: - if out_docblock: + if out_docblock: + if not self.out_mode == self.OUTPUT_INCLUDE: self.data += f".. _{section}:\n\n" - - if not self.symbol: self.data += f'{self.lineprefix}**{section}**\n\n' + else: + self.data += f'{self.lineprefix}**{section}**\n\n' self.print_lineno(section_start_lines.get(section, 0)) self.output_highlight(sections[section])