[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sat, 30 Mar 2024 05:57:25 -0400 (EDT) |
branch: master
commit b87ffbf4e325b6ca676368bba51dc3de6e0f9de3
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Mar 30 10:57:05 2024 +0100
* tp/Texinfo/XS/structuring_transfo/structuring.c
(new_complete_node_menu): call copy_contents instead of copy_tree on
part argument.
* tp/Texinfo/Convert/HTML.pm (_convert_printindex_command): call
convert_tree instead of convert_tree_new_formatting_context for the
reference part of seealso when there is no need for multiple pass.
* tp/Texinfo/Convert/HTML.pm (_convert_value_command)
(_default_format_program_string, _default_format_special_body_about),
tp/Texinfo/XS/convert/convert_html.c
(html_default_format_program_string, html_default_format_end_file)
(convert_value_command, default_format_special_body_about): add/fix
explanation argument for tree conversion functions.
* tp/Texinfo/Convert/HTML.pm (_html_convert_output): add unit number
in debug message, as in C.
* tp/Texinfo/XS/convert/convert_html.c
(html_get_css_elements_classes): simplify and comment out C specific
debug message.
---
ChangeLog | 24 +++++++++
tp/Texinfo/Convert/HTML.pm | 71 ++++++++++++++++---------
tp/Texinfo/XS/convert/convert_html.c | 55 ++++++++++---------
tp/Texinfo/XS/structuring_transfo/structuring.c | 2 +-
4 files changed, 100 insertions(+), 52 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3455632a80..9f32ce900d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2024-03-30 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/structuring_transfo/structuring.c
+ (new_complete_node_menu): call copy_contents instead of copy_tree on
+ part argument.
+
+ * tp/Texinfo/Convert/HTML.pm (_convert_printindex_command): call
+ convert_tree instead of convert_tree_new_formatting_context for the
+ reference part of seealso when there is no need for multiple pass.
+
+ * tp/Texinfo/Convert/HTML.pm (_convert_value_command)
+ (_default_format_program_string, _default_format_special_body_about),
+ tp/Texinfo/XS/convert/convert_html.c
+ (html_default_format_program_string, html_default_format_end_file)
+ (convert_value_command, default_format_special_body_about): add/fix
+ explanation argument for tree conversion functions.
+
+ * tp/Texinfo/Convert/HTML.pm (_html_convert_output): add unit number
+ in debug message, as in C.
+
+ * tp/Texinfo/XS/convert/convert_html.c
+ (html_get_css_elements_classes): simplify and comment out C specific
+ debug message.
+
2024-03-30 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm (_convert_printindex_command),
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 87d2573bbb..946f441e39 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -3562,7 +3562,8 @@ sub _convert_value_command($$$$)
my $args = shift;
return $self->convert_tree($self->cdt('@{No value for `{value}\'@}',
- {'value' => {'text' => $args->[0]->{'monospacestring'}}}));
+ {'value' => {'text' => $args->[0]->{'monospacestring'}}}),
+ 'Tr missing value');
}
$default_commands_conversion{'value'} = \&_convert_value_command;
@@ -6586,9 +6587,8 @@ sub _convert_printindex_command($$$$)
} else {
$entry = $self->convert_tree($entry_tree,
$conv_str_entry);
- $reference
- = $self->convert_tree_new_formatting_context($reference_tree,
- $conv_str_reference);
+ $reference = $self->convert_tree($reference_tree,
+ $conv_str_reference);
}
$entry = '<code>' .$entry .'</code>' if ($in_code);
$delimiter = $self->get_conf('INDEX_ENTRY_COLON');
@@ -10961,10 +10961,12 @@ sub _default_format_program_string($)
$self->cdt('This document was generated on @emph{@today{}} using
@uref{{program_homepage}, @emph{{program}}}.',
{ 'program_homepage' => {'text'
=> $self->get_conf('PACKAGE_URL')},
- 'program' => {'text' => $self->get_conf('PROGRAM')} }));
+ 'program' => {'text' => $self->get_conf('PROGRAM')} }),
+ 'Tr program string program');
} else {
return $self->convert_tree(
- $self->cdt('This document was generated on @emph{@today{}}.'));
+ $self->cdt('This document was generated on @emph{@today{}}.'),
+ 'Tr program string date');
}
}
@@ -11405,7 +11407,8 @@ sub _default_format_special_body_about($$$)
}
$about .= "<p>\n";
$about .= $self->convert_tree(
- $self->cdt(' The buttons in the navigation panels have the following
meaning:'))
+ $self->cdt(' The buttons in the navigation panels have the following
meaning:'),
+ 'ABOUT')
. "\n";
$about .= <<EOT;
</p>
@@ -11413,14 +11416,17 @@ sub _default_format_special_body_about($$$)
<tr>
EOT
# TRANSLATORS: direction column header in the navigation help
- $about .= ' <th> '. $self->convert_tree($self->cdt('Button'))." </th>\n".
+ $about .= ' <th> '. $self->convert_tree($self->cdt('Button'), 'ABOUT')
+ ." </th>\n".
# TRANSLATORS: button label column header in the navigation help
- ' <th> ' . $self->convert_tree($self->cdt('Name')) . " </th>\n" .
+ ' <th> ' . $self->convert_tree($self->cdt('Name'), 'ABOUT')
+ . " </th>\n" .
# TRANSLATORS: direction description column header in the navigation help
- ' <th> ' . $self->convert_tree($self->cdt('Go to')) . " </th>\n" .
+ ' <th> ' . $self->convert_tree($self->cdt('Go to'), 'ABOUT')
+ . " </th>\n" .
# TRANSLATORS: section reached column header in the navigation help
- ' <th> ' . $self->convert_tree($self->cdt('From 1.2.3 go to'))."</th>\n"
- . " </tr>\n";
+ ' <th> ' . $self->convert_tree($self->cdt('From 1.2.3 go to'), 'ABOUT')
+ ."</th>\n". " </tr>\n";
my $active_icons;
if ($self->get_conf('ICONS')) {
@@ -11477,7 +11483,9 @@ EOT
<p>
EOT
- $about .= $self->convert_tree($self->cdt(' where the @strong{ Example }
assumes that the current position is at @strong{ Subsubsection One-Two-Three }
of a document of the following structure:')) . "\n";
+ $about .= $self->convert_tree(
+ $self->cdt(' where the @strong{ Example } assumes that the current
position is at @strong{ Subsubsection One-Two-Three } of a document of the
following structure:'),
+ 'ABOUT') . "\n";
# where the <strong> Example </strong> assumes that the current position
# is at <strong> Subsubsection One-Two-Three </strong> of a document of
@@ -11489,10 +11497,12 @@ EOT
EOT
my $non_breaking_space = $self->get_info('non_breaking_space');
# TRANSLATORS: example name of section for section 1
- $about .= ' <li> 1. ' . $self->convert_tree($self->cdt('Section One')) .
"\n" .
+ $about .= ' <li> 1. ' . $self->convert_tree($self->cdt('Section One'),
+ 'ABOUT') . "\n" .
" <ul>\n" .
# TRANSLATORS: example name of section for section 1.1
-' <li>1.1 ' . $self->convert_tree($self->cdt('Subsection One-One')) .
"\n";
+' <li>1.1 ' . $self->convert_tree($self->cdt('Subsection One-One'),
+ 'ABOUT') . "\n";
$about .= <<EOT;
<ul>
<li>...</li>
@@ -11501,29 +11511,36 @@ EOT
EOT
$about .= ' <li>1.2 ' .
# TRANSLATORS: example name of section for section 1.2
- $self->convert_tree($self->cdt('Subsection One-Two')) . "\n" .
+ $self->convert_tree($self->cdt('Subsection One-Two'), 'ABOUT')
+ . "\n" .
" <ul>\n" .
' <li>1.2.1 ' .
# TRANSLATORS: example name of section for section 1.2.1
- $self->convert_tree($self->cdt('Subsubsection One-Two-One')) . "</li>\n" .
+ $self->convert_tree($self->cdt('Subsubsection One-Two-One'), 'ABOUT')
+ . "</li>\n" .
' <li>1.2.2 ' .
# TRANSLATORS: example name of section for section 1.2.2
- $self->convert_tree($self->cdt('Subsubsection One-Two-Two')) . "</li>\n" .
+ $self->convert_tree($self->cdt('Subsubsection One-Two-Two'), 'ABOUT')
+ . "</li>\n" .
' <li>1.2.3 ' .
# TRANSLATORS: example name of section for section 1.2.3
- $self->convert_tree($self->cdt('Subsubsection One-Two-Three'))
+ $self->convert_tree($self->cdt('Subsubsection One-Two-Three'),
+ 'ABOUT')
. " $non_breaking_space $non_breaking_space\n"
.
' <strong><== ' .
- $self->convert_tree($self->cdt('Current Position')) . " </strong></li>\n" .
+ $self->convert_tree($self->cdt('Current Position'), 'ABOUT')
+ . " </strong></li>\n" .
' <li>1.2.4 ' .
# TRANSLATORS: example name of section for section 1.2.4
- $self->convert_tree($self->cdt('Subsubsection One-Two-Four')) . "</li>\n" .
+ $self->convert_tree($self->cdt('Subsubsection One-Two-Four'), 'ABOUT')
+ . "</li>\n" .
" </ul>\n" .
" </li>\n" .
' <li>1.3 ' .
# TRANSLATORS: example name of section for section 1.3
- $self->convert_tree($self->cdt('Subsection One-Three')) . "\n";
+ $self->convert_tree($self->cdt('Subsection One-Three'), 'ABOUT')
+ . "\n";
$about .= <<EOT;
<ul>
<li>...</li>
@@ -11532,7 +11549,8 @@ EOT
EOT
$about .= ' <li>1.4 ' .
# TRANSLATORS: example name of section for section 1.4
- $self->convert_tree($self->cdt('Subsection One-Four')) . "</li>\n";
+ $self->convert_tree($self->cdt('Subsection One-Four'), 'ABOUT')
+ . "</li>\n";
$about .= <<EOT;
</ul>
@@ -12525,8 +12543,9 @@ sub _html_convert_output($$$$$$$$)
# and, for special output unit, to avoid outputting anything if empty.
my $body;
if ($output_unit->{'unit_type'} eq 'special_unit') {
- print STDERR "\nUNIT SPECIAL $output_unit->{'special_unit_variety'}\n"
- if ($self->get_conf('DEBUG'));
+ print STDERR "\nUNIT SPECIAL "
+ ."$output_unit->{'special_unit_variety'} $unit_nr\n"
+ if ($self->get_conf('DEBUG'));
$body = $self->convert_output_unit($output_unit,
"output s-unit $unit_nr");
if ($body eq '') {
@@ -13265,7 +13284,7 @@ sub _convert($$;$)
# cache return value of get_conf for speed
if ($debug) {
- cluck() if (!defined($explanation));
+ #cluck() if (!defined($explanation));
$explanation = 'NO EXPLANATION' if (!defined($explanation));
my $contexts_str = _debug_print_html_contexts($self);
print STDERR "ELEMENT($explanation) ".$contexts_str.", ->";
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index ee5248e0d1..0345d8fcbb 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -4417,12 +4417,13 @@ html_get_css_elements_classes (CONVERTER *self, const
char *filename)
any CSS selector. Also the formatting of the node or
similar command is in general done in global context
so no file is added */
- char *msg;
- xasprintf (&msg, "%s: get CSS could not find page number",
- filename);
+ /* This debug message is C specific
if (self->conf->DEBUG.integer > 0)
- fprintf (stderr, "XS|css: %s\n", msg);
- free (msg);
+ {
+ fprintf (stderr, "XS|css: REMARK: %s: get_css no page
found\n",
+ filename);
+ }
+ */
}
}
if (page_number)
@@ -6554,6 +6555,7 @@ void
html_default_format_program_string (CONVERTER *self, TEXT *result)
{
ELEMENT *tree;
+ const char *explanation;
if (self->conf->PROGRAM.string && strlen (self->conf->PROGRAM.string)
&& self->conf->PACKAGE_URL.string)
{
@@ -6575,14 +6577,16 @@ html_default_format_program_string (CONVERTER *self,
TEXT *result)
self, substrings, 0);
destroy_named_string_element_list (substrings);
/* program and program_homepage are destroyed with the tree */
+ explanation = "Tr program string program";
}
else
{
tree = html_cdt_tree ("This document was generated on @emph{@today{}}.",
self, 0, 0);
+ explanation = "Tr program string date";
}
add_tree_to_build (self, tree);
- convert_to_html_internal (self, tree, result, 0);
+ convert_to_html_internal (self, tree, result, explanation);
remove_tree_to_build (self, tree);
destroy_element_and_children (tree);
}
@@ -6682,9 +6686,10 @@ html_default_format_end_file (CONVERTER *self, const
char *filename,
text_append_n (&result, "\" rel=\"jslicense\"><small>", 25);
tree = html_cdt_tree ("JavaScript license information",
- self, 0, "Tr JS license header");
+ self, 0, 0);
add_tree_to_build (self, tree);
- convert_to_html_internal (self, tree, &result, 0);
+ convert_to_html_internal (self, tree, &result,
+ "Tr JS license header");
remove_tree_to_build (self, tree);
destroy_element_and_children (tree);
@@ -8599,7 +8604,7 @@ convert_value_command (CONVERTER *self, const enum
command_id cmd,
"value", value_text);
tree = html_cdt_tree ("@{No value for `{value}'@}",
- self, substrings, 0);
+ self, substrings, "Tr missing value");
add_tree_to_build (self, tree);
convert_to_html_internal (self, tree, result, 0);
@@ -15561,16 +15566,16 @@ default_format_special_body_about (CONVERTER *self,
text_append_n (result, "<p>\n", 4);
translate_convert_to_html_internal (
" The buttons in the navigation panels have the following meaning:",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, "\n</p>\n<table border=\"1\">\n <tr>\n <th> ");
- translate_convert_to_html_internal ("Button", self, 0, 0, result, 0);
+ translate_convert_to_html_internal ("Button", self, 0, 0, result, "ABOUT");
text_append (result, " </th>\n <th> ");
- translate_convert_to_html_internal ("Name", self, 0, 0, result, 0);
+ translate_convert_to_html_internal ("Name", self, 0, 0, result, "ABOUT");
text_append (result, " </th>\n <th> ");
- translate_convert_to_html_internal ("Go to", self, 0, 0, result, 0);
+ translate_convert_to_html_internal ("Go to", self, 0, 0, result, "ABOUT");
text_append (result, " </th>\n <th> ");
translate_convert_to_html_internal ("From 1.2.3 go to", self, 0, 0,
- result, 0);
+ result, "ABOUT");
text_append (result, "</th>\n </tr>\n");
for (i = 0; i < buttons->number; i++)
@@ -15653,28 +15658,28 @@ default_format_special_body_about (CONVERTER *self,
translate_convert_to_html_internal (
" where the @strong{ Example } assumes that the current position is at "
"@strong{ Subsubsection One-Two-Three } of a document of the following "
- "structure:", self, 0, 0, result, 0);
+ "structure:", self, 0, 0, result, "ABOUT");
text_append_n (result, "\n</p>\n\n<ul>\n", 12);
text_append (result, " <li> 1. ");
translate_convert_to_html_internal ("Section One",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, "\n <ul>\n <li>1.1 ");
translate_convert_to_html_internal ("Subsection One-One",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, "\n <ul>\n <li>...</li>\n"
" </ul>\n </li>\n <li>1.2 ");
translate_convert_to_html_internal ("Subsection One-Two",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, "\n <ul>\n <li>1.2.1 ");
translate_convert_to_html_internal ("Subsubsection One-Two-One",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, "</li>\n <li>1.2.2 ");
translate_convert_to_html_internal ("Subsubsection One-Two-Two",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, "</li>\n <li>1.2.3 ");
translate_convert_to_html_internal ("Subsubsection One-Two-Three",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append_n (result, " ", 1);
text_append_n (result,
self->special_character[SC_non_breaking_space].string,
@@ -15687,17 +15692,17 @@ default_format_special_body_about (CONVERTER *self,
text_append (result, " <strong><== ");
translate_convert_to_html_internal ("Current Position",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, " </strong></li>\n <li>1.2.4 ");
translate_convert_to_html_internal ("Subsubsection One-Two-Four",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, "</li>\n </ul>\n </li>\n <li>1.3 ");
translate_convert_to_html_internal ("Subsection One-Three",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, "\n <ul>\n <li>...</li>\n"
" </ul>\n </li>\n <li>1.4 ");
translate_convert_to_html_internal ("Subsection One-Four",
- self, 0, 0, result, 0);
+ self, 0, 0, result, "ABOUT");
text_append (result, "</li>\n </ul>\n </li>\n</ul>\n");
}
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index 62887575ba..86e8b4b620 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -1885,7 +1885,7 @@ new_complete_node_menu (const ELEMENT *node, DOCUMENT
*document,
if (associated_part && associated_part->args.number > 0)
{
ELEMENT *part_title_copy
- = copy_tree (associated_part->args.list[0]);
+ = copy_contents (associated_part->args.list[0],
ET_NONE);
NAMED_STRING_ELEMENT_LIST *substrings
= new_named_string_element_list ();
ELEMENT *part_title;
- master updated (4fc7ad11f2 -> b87ffbf4e3), Patrice Dumas, 2024/03/30
- [no subject], Patrice Dumas, 2024/03/30
- [no subject], Patrice Dumas, 2024/03/30
- [no subject], Patrice Dumas, 2024/03/30
- [no subject], Patrice Dumas, 2024/03/30
- [no subject],
Patrice Dumas <=
- [no subject], Patrice Dumas, 2024/03/30