public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] docparse: Make tags in table clickable
@ 2021-05-03 15:04 Petr Vorel
  2021-05-04 12:03 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2021-05-03 15:04 UTC (permalink / raw)
  To: ltp

linked to the section.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

minor but useful improvement.

 docparse/testinfo.pl | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/docparse/testinfo.pl b/docparse/testinfo.pl
index ccce67be4..76ca7a66c 100755
--- a/docparse/testinfo.pl
+++ b/docparse/testinfo.pl
@@ -125,7 +125,12 @@ sub paragraph
 
 sub reference
 {
-	return "xref:$_[0]\[$_[0]\]" . (defined($_[1]) ? $_[1] : "") . "\n";
+	my ($link, %args) = @_;
+
+	$args{text} //= $link;
+	$args{delimiter} //= "";
+
+	return "xref:$link\[$args{text}\]$args{delimiter}\n";
 }
 
 sub table
@@ -179,7 +184,7 @@ sub get_test_names
 			$content .= "\n";
 		}
 
-		$content .= reference($name, " ");
+		$content .= reference($name, delimiter => " ");
 		$prev_letter = $letter;
 	}
 	$content .= "\n";
@@ -242,6 +247,7 @@ sub content_filters
 	for my $k (sort keys %$data) {
 		my $tag = tag2title($k);
 		my ($letter, $prev_letter);
+		$content .= label($k);
 		$content .= h2($tag);
 		$content .= paragraph("Tests containing $tag flag.");
 		$content .= get_test_names(\@{$h{$k}});
@@ -357,7 +363,7 @@ sub content_all_tests
 				$content .= table . "|Key|Value\n\n"
 			}
 
-			$content .= "|" . tag2title($k) . "\n|";
+			$content .= "|" . reference($k, text => tag2title($k)) . "\n|";
 
 			if (ref($v) eq 'ARRAY') {
 				# two dimensional array
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-04 13:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-03 15:04 [LTP] [PATCH 1/1] docparse: Make tags in table clickable Petr Vorel
2021-05-04 12:03 ` Cyril Hrubis
2021-05-04 13:08   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox