texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_


From: Patrice Dumas
Subject: branch master updated: * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_accessorize, new) (_texinfo_handle_element_end): add texinfo_perldoc_url_prefix accessor with default based on Pod::Simple::XHTML perldoc_url_prefix.
Date: Sun, 27 Oct 2024 13:24:59 -0400

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 653eb0f10b * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm 
(_accessorize, new) (_texinfo_handle_element_end): add 
texinfo_perldoc_url_prefix accessor with default based on Pod::Simple::XHTML 
perldoc_url_prefix.
653eb0f10b is described below

commit 653eb0f10b3103441029a07176c0624a3863f445
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Oct 27 18:24:49 2024 +0100

    * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_accessorize, new)
    (_texinfo_handle_element_end): add texinfo_perldoc_url_prefix
    accessor with default based on Pod::Simple::XHTML perldoc_url_prefix.
    
    * Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t (run_test): set
    texinfo_perldoc_url_prefix to have more reproducible test results
    as Pod::Simple::XHTML perldoc_url_prefix changed in 2019.
---
 ChangeLog                                    | 10 ++++++++++
 Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm | 13 ++++++++++---
 Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t    |  4 ++++
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a1a3c36e67..db2dd3af71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-10-27  Patrice Dumas  <pertusus@free.fr>
+
+       * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm (_accessorize, new)
+       (_texinfo_handle_element_end): add texinfo_perldoc_url_prefix
+       accessor with default based on Pod::Simple::XHTML perldoc_url_prefix.
+
+       * Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t (run_test): set
+       texinfo_perldoc_url_prefix to have more reproducible test results
+       as Pod::Simple::XHTML perldoc_url_prefix changed in 2019.
+
 2024-10-27  Patrice Dumas  <pertusus@free.fr>
 
        * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm: document
diff --git a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm 
b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
index 033351321f..e514750c7c 100644
--- a/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
+++ b/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
@@ -46,8 +46,8 @@ use Carp qw(cluck);
 use Pod::Simple::PullParser ();
 
 # use idify from this package to be sure that the target is set by
-# MetaCPAN::Pod::HTML as anchor.  And also take perldoc_url_prefix
-# from this package.
+# MetaCPAN::Pod::HTML as anchor.  Take texinfo_perldoc_url_prefix
+# default from this package.
 use Pod::Simple::XHTML;
 
 # for parselink()
@@ -109,6 +109,7 @@ __PACKAGE__->_accessorize(
   'texinfo_internal_pod_manuals',
   'texinfo_man_url_prefix',
   'texinfo_main_command_sectioning_style',
+  'texinfo_perldoc_url_prefix',
   'texinfo_section_nodes',
   'texinfo_sectioning_base_level',
   'texinfo_sectioning_style',
@@ -137,6 +138,7 @@ sub new
   $new->texinfo_sectioning_style($sectioning_style);
   $new->texinfo_add_upper_sectioning_command(1);
   $new->texinfo_external_pod_as_url(1);
+  $new->texinfo_perldoc_url_prefix($pod_links_html_parser->perldoc_url_prefix);
   return $new;
 }
 
@@ -981,7 +983,7 @@ sub _texinfo_handle_element_end($$$)
               } elsif (defined($texinfo_node) and $texinfo_node ne '') {
                 $node_manual .= ' '.$texinfo_node;
               }
-              my $href = $pod_links_html_parser->perldoc_url_prefix
+              my $href = $self->texinfo_perldoc_url_prefix
                   . $manual_text;
               if (defined($explanation)) {
                 my $target = $pod_links_html_parser->idify($section_text, 1);
@@ -1221,6 +1223,11 @@ which the C<numbered> style is used in the default case.
 String used as a prefix for man page urls.  Default
 is C<http://man.he.net/man>.
 
+=item texinfo_perldoc_url_prefix
+
+String used as a prefix for external Pod if texinfo_external_pod_as_url
+is set.  Default is L<Pod::Simple::XHTML/perldoc_url_prefix>.
+
 =item texinfo_section_nodes
 
 If set, add C<@node> and not C<@anchor> for each sectioning command.
diff --git a/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t 
b/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t
index ac215412f1..6583669c4a 100644
--- a/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t
+++ b/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t
@@ -50,6 +50,10 @@ sub run_test($$$;$$$)
 
   my $parser = Pod::Simple::Texinfo->new();
 
+  # The default, based on Pod::Simple::XHTML perldoc_url_prefix changed in
+  # 2019.  For reproducible results, set it explicitely to the 2024 value
+  $parser->texinfo_perldoc_url_prefix('https://metacpan.org/pod/');
+
   $parser->set_source(\$in);
   $parser->texinfo_external_pod_as_url($external_pod_as_url)
     if (defined($external_pod_as_url));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]