[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Improve links to internal pod without a section
From: |
Patrice Dumas |
Subject: |
branch master updated: Improve links to internal pod without a section |
Date: |
Fri, 14 Jan 2022 09:52:50 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 0b65467b78 Improve links to internal pod without a section
0b65467b78 is described below
commit 0b65467b783a870bdde874e70a53b0e975c5e080
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Jan 14 15:52:39 2022 +0100
Improve links to internal pod without a section
* Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_convert_pod):
use the pod manual as section name for internal links to avoid ending
up with the non informative 'NAME'.
---
ChangeLog | 8 ++++++++
Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm | 19 +++++++++++--------
tp/Texinfo/ParserNonXS.pm | 2 +-
3 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 22ffdbc4ff..0181ae96eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-01-14 Patrice Dumas <pertusus@free.fr>
+
+ Improve links to internal pod without a section
+
+ * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_convert_pod):
+ use the pod manual as section name for internal links to avoid ending
+ up with the non informative 'NAME'.
+
2022-01-14 Patrice Dumas <pertusus@free.fr>
Update DevHelp TODO entry
diff --git a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
index 6877d6b77d..e7ff2d749d 100644
--- a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
+++ b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
@@ -508,6 +508,9 @@ sub _convert_pod($)
# here, maybe this should be in the Texinfo HTML converter.
# However, there is a 'man' category here and not in Texinfo,
# so the information is more precise in pod.
+ # NOTE 3: the section within the man (and not the numeric section
in the
+ # man page specification) whic is in $token->attr('section') is
ignored.
+ # Maybe there would be a way to specify it, but it is not very
important.
my $replacement_arg = $token->attr('to').'';
# regexp from Pod::Simple::HTML resolve_man_page_link
# since it is very small, it is likely that copyright cannot be
@@ -538,20 +541,20 @@ sub _convert_pod($)
$section .= '' if (defined($section));
if (0) {
my $section_text = 'UNDEF';
- if (defined($section)) {
- $section_text = $section;
- }
+ $section_text = $section if (defined($section));
my $manual_text = 'UNDEF';
- if (defined($manual)) {
- $manual_text = $manual;
- }
- print STDERR "L: $linktype $manual_text/$section_text\n";
+ $manual_text = $manual if (defined($manual));
+ print STDERR "L,M/S: $linktype $manual_text/$section_text\n";
}
if (defined($manual)) {
if (! defined($section) or $section !~ m/\S/) {
if ($self->{'texinfo_internal_pod_manuals_hash'}->{$manual}) {
- # FIXME the rendering is not necessarily the best
$section = 'NAME';
+ # use the manual name as texinfo section name, otherwise
+ # it will be the section associated with the node, which is
+ # the non informative 'NAME' section name
+ $texinfo_section = _normalize_texinfo_name(
+ _protect_comma(_protect_text($manual)), 'section');
}
}
if ($self->{'texinfo_internal_pod_manuals_hash'}->{$manual}) {
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index eeef0f9272..4e2fa43ab5 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -6228,7 +6228,7 @@ The errors collected during the tree parsing are
registered in a
C<Texinfo::Report> object. This object is available with
C<registered_errors>. The errors registered in the C<Texinfo::Report>
object are available through the C<errors> method. This method is
-described in L<errors|Texinfo::Report ($error_warnings_list, $error_count) =
errors ($registrar)>.
+described in L<errors|Texinfo::Report/($error_warnings_list, $error_count) =
errors ($registrar)>.
=over
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Improve links to internal pod without a section,
Patrice Dumas <=