[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Tue, 24 Oct 2023 18:42:13 -0400 (EDT) |
branch: master
commit c85be722b71818649664e3e5edb53b59389e1b71
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Oct 25 00:42:13 2023 +0200
* tp/Texinfo/Structuring.pm (import, split_by_node, split_by_section),
tp/Texinfo/Convert/HTML.pm (_prepare_conversion_units)
(_prepare_units_directions_files): remove overriding of split_by_node
and split_by_section, as it is not needed in HTML. It is still in
structuring_transfo/StructuringTransfo.xs and could be overriden again
if there is an actual case in which overriding the functions is
interesting.
---
ChangeLog | 10 +++++++
tp/Texinfo/Convert/HTML.pm | 6 ++---
tp/Texinfo/Structuring.pm | 66 +++++++++-------------------------------------
3 files changed, 25 insertions(+), 57 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f6a9129458..20b14a62bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-10-24 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Structuring.pm (import, split_by_node, split_by_section),
+ tp/Texinfo/Convert/HTML.pm (_prepare_conversion_units)
+ (_prepare_units_directions_files): remove overriding of split_by_node
+ and split_by_section, as it is not needed in HTML. It is still in
+ structuring_transfo/StructuringTransfo.xs and could be overriden again
+ if there is an actual case in which overriding the functions is
+ interesting.
+
2023-10-24 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Structuring.pm (import, split_pages): remove overriding
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 7ba44a7d76..1099187716 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -9305,9 +9305,9 @@ sub _prepare_conversion_units($$$)
}
if ($self->get_conf('USE_NODES')) {
- $output_units = Texinfo::Structuring::split_by_node($root, 1);
+ $output_units = Texinfo::Structuring::split_by_node($root);
} else {
- $output_units = Texinfo::Structuring::split_by_section($root, 1);
+ $output_units = Texinfo::Structuring::split_by_section($root);
}
# Needs to be set early in case it would be needed to find some region
@@ -9390,7 +9390,7 @@ sub _prepare_units_directions_files($$$$$$$$)
$self->_prepare_output_units_global_targets($output_units, $special_units,
$associated_special_units);
- Texinfo::Structuring::split_pages($output_units, $self->get_conf('SPLIT'),
1);
+ Texinfo::Structuring::split_pages($output_units, $self->get_conf('SPLIT'));
# determine file names associated with the different pages, and setup
# the counters for special element pages.
diff --git a/tp/Texinfo/Structuring.pm b/tp/Texinfo/Structuring.pm
index 28feae11e3..e9c0dc2f22 100644
--- a/tp/Texinfo/Structuring.pm
+++ b/tp/Texinfo/Structuring.pm
@@ -134,25 +134,21 @@ sub import {
"Texinfo::StructTransf::number_floats"
);
Texinfo::XSLoader::override(
- "Texinfo::Structuring::_XS_split_by_node",
- "Texinfo::StructTransf::split_by_node"
- );
- Texinfo::XSLoader::override(
- "Texinfo::Structuring::_XS_split_by_section",
- "Texinfo::StructTransf::split_by_section"
- );
+ "Texinfo::Structuring::rebuild_output_units",
+ "Texinfo::StructTransf::rebuild_output_units");
Texinfo::XSLoader::override(
"Texinfo::Structuring::_XS_unsplit",
- "Texinfo::StructTransf::unsplit"
- );
- Texinfo::XSLoader::override(
- "Texinfo::Structuring::rebuild_output_units",
- "Texinfo::StructTransf::rebuild_output_units"
- );
- # Not useful for HTML as a function, as the calling function is
+ "Texinfo::StructTransf::unsplit");
+ # Not useful for HTML as functions, as the calling functions are
# already overriden
# Could be readded when other converters than HTML are done in C
#Texinfo::XSLoader::override(
+ # "Texinfo::Structuring::split_by_node",
+ # "Texinfo::StructTransf::split_by_node");
+ #Texinfo::XSLoader::override(
+ # "Texinfo::Structuring::_XS_split_by_section",
+ # "Texinfo::StructTransf::split_by_section");
+ #Texinfo::XSLoader::override(
# "Texinfo::Structuring::split_pages",
# "Texinfo::StructTransf::split_pages"
#);
@@ -1659,36 +1655,16 @@ if (0) {
}
-sub _XS_split_by_node($)
-{
- my $root = shift;
-
- return undef;
-}
-
# Return a list of output units. Each output unit starts with a @node as its
# first content (except possibly the first one). It is important that this
# function reassociates all the root commands such that the result does not
# depend on the previous association (if any).
-# The $NO_XS argument signals that splitting should not be done
-# separately in XS, but is already done in other XS code (for HTML).
-sub split_by_node($;$)
+sub split_by_node($)
{
my $root = shift;
- my $no_XS = shift;
my $output_units;
- if (!$no_XS) {
- $output_units = _XS_split_by_node($root);
-
- # If the XS code returns something, we use it as it will have the
references
- # needed for XS code called later on.
- if (defined($output_units)) {
- return $output_units;
- }
- }
-
my $current = { 'unit_type' => 'unit' };
push @$output_units, $current;
my @pending_parts = ();
@@ -1733,35 +1709,17 @@ sub split_by_node($;$)
return $output_units;
}
-sub _XS_split_by_section($)
-{
- my $root = shift;
-
- return undef;
-}
-
# Return a list of output units. Each output unit starts with the @node
# associated with a sectioning command or with the sectioning command if there
# is no associated node. It is important that this function reassociates all
# the root commands such that the result does not depend on the previous
# association (if any).
-# The $NO_XS argument signals that splitting should not be done
-# separately in XS, but is already done in other XS code (for HTML).
-sub split_by_section($;$)
+sub split_by_section($)
{
my $root = shift;
- my $no_XS = shift;
my $output_units;
- if (!$no_XS) {
- $output_units = _XS_split_by_section($root);
-
- if (defined($output_units)) {
- return $output_units;
- }
- }
-
my $current = { 'unit_type' => 'unit' };
push @$output_units, $current;
foreach my $content (@{$root->{'contents'}}) {