linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Randy Dunlap" <rdunlap@infradead.org>, Tom Rix <trix@redhat.com>,
	Vaibhav Jain <vaibhav@linux.ibm.com>
Subject: [PATCH 5/5] scripts: get_api.pl: Add sub-titles to ABI output
Date: Mon,  2 Nov 2020 11:32:16 +0100	[thread overview]
Message-ID: <64752a5de06ab8263c296e3ed01414b25861e1eb.1604312590.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1604312590.git.mchehab+huawei@kernel.org>

Instead of adding titles just for the files, add titles
for each part of the ABI output, in order to make easier
to search for a symbol there.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 scripts/get_abi.pl | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl
index 459f169f834c..68dab828a722 100755
--- a/scripts/get_abi.pl
+++ b/scripts/get_abi.pl
@@ -287,6 +287,8 @@ my $bondary = qr { (?<![\w\/\`\{])(?=[\w\/\`\{])|(?<=[\w\/\`\{])(?![\w\/\`\{]) }
 sub output_rest {
 	create_labels();
 
+	my $part = "";
+
 	foreach my $what (sort {
 				($data{$a}->{type} eq "File") cmp ($data{$b}->{type} eq "File") ||
 				$a cmp $b
@@ -306,6 +308,21 @@ sub output_rest {
 		$w =~ s/([\(\)\_\-\*\=\^\~\\])/\\$1/g;
 
 		if ($type ne "File") {
+			my $cur_part = $what;
+			if ($what =~ '/') {
+				if ($what =~ m#^(\/?(?:[\w\-]+\/?){1,2})#) {
+					$cur_part = "Symbols under $1";
+					$cur_part =~ s,/$,,;
+				}
+			}
+
+			if ($cur_part ne "" && $part ne $cur_part) {
+			    $part = $cur_part;
+			    my $bar = $part;
+			    $bar =~ s/./-/g;
+			    print "$part\n$bar\n\n";
+			}
+
 			printf ".. _%s:\n\n", $data{$what}->{label};
 
 			my @names = split /, /,$w;
-- 
2.26.2


      parent reply	other threads:[~2020-11-02 10:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-01 23:04 Linux 5.10-rc2 Linus Torvalds
2020-11-02  0:01 ` Linux 5.10-rc2 (docs build) Randy Dunlap
2020-11-02  7:58   ` Mauro Carvalho Chehab
2020-11-02  8:33     ` Mauro Carvalho Chehab
2020-11-02 16:02       ` Randy Dunlap
2020-11-02 16:59         ` Mauro Carvalho Chehab
2020-11-02 19:23           ` Randy Dunlap
2020-11-02 20:35             ` Mauro Carvalho Chehab
2020-11-02 20:41               ` Randy Dunlap
2020-11-02 21:59                 ` Mauro Carvalho Chehab
2020-11-02 10:32   ` [PATCH 0/5] Some fixes for ABI documentation Mauro Carvalho Chehab
2020-11-02 10:32     ` [PATCH 1/5] docs: ABI: sysfs-driver-dma-ioatdma: what starts with /sys Mauro Carvalho Chehab
2020-11-02 10:32     ` [PATCH 2/5] docs: ABI: sysfs-class-net: fix a typo Mauro Carvalho Chehab
2020-11-02 10:32     ` [PATCH 3/5] docs: leds: index.rst: add a missing file Mauro Carvalho Chehab
2020-11-02 10:32     ` [PATCH 4/5] scripts: get_abi.pl: Don't let ABI files to create subtitles Mauro Carvalho Chehab
2020-11-02 10:32     ` Mauro Carvalho Chehab [this message]

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=64752a5de06ab8263c296e3ed01414b25861e1eb.1604312590.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=trix@redhat.com \
    --cc=vaibhav@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).