* [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
* [LTP] [PATCH 1/1] docparse: Make tags in table clickable
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
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2021-05-04 12:03 UTC (permalink / raw)
To: ltp
Hi!
> linked to the section.
Looks good, acked.
Btw, when I was looking at the page today I noticed that in the tags
table the tag points to the git/CVE page and not the actuall hash or ID.
I would expect that linux-git would be normal text and the commit id
would link to the kernel.org repo, and same for the CVE...
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [PATCH 1/1] docparse: Make tags in table clickable
2021-05-04 12:03 ` Cyril Hrubis
@ 2021-05-04 13:08 ` Petr Vorel
0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2021-05-04 13:08 UTC (permalink / raw)
To: ltp
Hi Cyril,
> Hi!
> > linked to the section.
> Looks good, acked.
> Btw, when I was looking at the page today I noticed that in the tags
> table the tag points to the git/CVE page and not the actuall hash or ID.
> I would expect that linux-git would be normal text and the commit id
> would link to the kernel.org repo, and same for the CVE...
Well, no problem, but I'd prefer for commits to move the hash to the text, e.g.
from:
|linux-git-fbe0e839d1e2 | futex: Prevent overflow by strengthen input validation|
to:
|linux-git | fbe0e839d1e2 ("futex: Prevent overflow by strengthen input validation")|
I'll send v2 where I'll implement it and as a second commit I'll change "CVE"
and "linux-git" (and others) pointing to tags metadata.html#tags.
And as TODO I should divide .tags into subsections containing list of actual tag
values (e.g. list of CVE, linux-git (and others)) and point these links to these
sections.
Thanks for your time!
Kind regards,
Petr
^ permalink raw reply [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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.