[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Wed, 2 Oct 2024 02:23:56 -0400 (EDT) |
branch: master
commit 57542083fc13d0df7987118314cca1441f97bd35
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Jul 30 16:22:04 2024 +0200
* tp/Texinfo/XS/convert/ConvertXS.xs (html_converter_initialize_sv),
tp/Texinfo/XS/convert/convert_html.c
(html_converter_init_special_unit, html_converter_initialize),
tp/Texinfo/XS/convert/get_html_perl_info.c
(html_converter_init_special_unit_sv, html_converter_initialize_sv):
split html_converter_init_special_unit out of
html_converter_initialize and html_converter_init_special_unit_sv out
of html_converter_initialize_sv and modify
html_converter_initialize_sv in ConvertXS.xs to setup first the the
special unit info, as the special unit directions are needed for the
remainder of initialization. Therefore special unit Perl
customization needs to be read and special unit initialization in C
code needs to be run too before doing the remaining.
* tp/Texinfo/XS/convert/get_html_perl_info.c
(html_converter_initialize_sv): do not use the default special unit
info, but the customized special units info.
* tp/Makefile.tres, tp/t/init_files_tests.t
(button_replacement_and_direction_customization): test both special
unit direction customization an replacement of button in buttons
specifications.
---
ChangeLog | 25 ++
tp/Makefile.tres | 2 +
tp/Texinfo/XS/convert/ConvertXS.xs | 27 ++
tp/Texinfo/XS/convert/convert_html.c | 89 ++++---
tp/Texinfo/XS/convert/convert_html.h | 1 +
tp/Texinfo/XS/convert/get_html_perl_info.c | 172 ++++++------
tp/Texinfo/XS/convert/get_html_perl_info.h | 3 +-
tp/t/init_files_tests.t | 6 +
...tton_replacement_and_direction_customization.pl | 290 +++++++++++++++++++++
.../res_html/chapter.html | 41 +++
.../res_html/index.html | 58 +++++
11 files changed, 600 insertions(+), 114 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c24fd331d6..0fd0c9e92d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,31 @@
(converter_initialize): readd converter_initialize that was mistakenly
removed.
+2024-07-30 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/convert/ConvertXS.xs (html_converter_initialize_sv),
+ tp/Texinfo/XS/convert/convert_html.c
+ (html_converter_init_special_unit, html_converter_initialize),
+ tp/Texinfo/XS/convert/get_html_perl_info.c
+ (html_converter_init_special_unit_sv, html_converter_initialize_sv):
+ split html_converter_init_special_unit out of
+ html_converter_initialize and html_converter_init_special_unit_sv out
+ of html_converter_initialize_sv and modify
+ html_converter_initialize_sv in ConvertXS.xs to setup first the the
+ special unit info, as the special unit directions are needed for the
+ remainder of initialization. Therefore special unit Perl
+ customization needs to be read and special unit initialization in C
+ code needs to be run too before doing the remaining.
+
+ * tp/Texinfo/XS/convert/get_html_perl_info.c
+ (html_converter_initialize_sv): do not use the default special unit
+ info, but the customized special units info.
+
+ * tp/Makefile.tres, tp/t/init_files_tests.t
+ (button_replacement_and_direction_customization): test both special
+ unit direction customization an replacement of button in buttons
+ specifications.
+
2024-07-30 Patrice Dumas <pertusus@free.fr>
* tp/Makefile.am (test_files), tp/Makefile.tres,
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 95ceef5c6b..51ef94b326 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -1102,6 +1102,8 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/info_tests/xref_test.pl \
t/results/init_files_tests/access_document_name_in_handler.pl \
t/results/init_files_tests/access_document_name_in_handler/res_html \
+ t/results/init_files_tests/button_replacement_and_direction_customization.pl
\
+
t/results/init_files_tests/button_replacement_and_direction_customization/res_html
\
t/results/init_files_tests/button_replacement_for_special_unit_direction.pl \
t/results/init_files_tests/button_replacement_for_special_unit_direction/res_html
\
t/results/init_files_tests/customize_special_element.pl \
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 2e4e819ebb..01c5e6345d 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -580,6 +580,33 @@ html_format_setup ()
void
html_converter_initialize_sv (SV *converter_in, SV
*default_formatting_references, SV *default_css_string_formatting_references,
SV *default_commands_open, SV *default_commands_conversion, SV
*default_css_string_commands_conversion, SV *default_types_open, SV
*default_types_conversion, SV *default_css_string_types_conversion, SV
*default_output_units_conversion, SV *default_special_unit_body, SV
*customized_upper_case_commands, SV *customized_special_unit_info, SV
*default_converted_dire [...]
+ PREINIT:
+ CONVERTER *self;
+ CODE:
+ self = get_sv_converter (converter_in,
"html_converter_initialize_sv");
+
+ /* initialize first the special unit info, as the special unit
+ directions are needed for the remainder of initialization.
+ Therefore special unit Perl customization needs to be read
+ and splecial unit initialization in C code needs to be run
+ too before doing the remaining */
+ html_converter_init_special_unit_sv (converter_in,
+ customized_special_unit_info);
+ html_converter_init_special_unit (self);
+ html_converter_initialize_sv (converter_in,
+ default_formatting_references,
+ default_css_string_formatting_references,
+ default_commands_open,
+ default_commands_conversion,
+ default_css_string_commands_conversion,
+ default_types_open,
+ default_types_conversion,
+ default_css_string_types_conversion,
+ default_output_units_conversion,
+ default_special_unit_body,
+ customized_upper_case_commands,
+ default_converted_directions_strings);
+
void
html_conversion_initialization (SV *converter_in, const char *context, SV
*document_in=0)
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 0b89056583..9c02cdec9b 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -3044,8 +3044,15 @@ direction_string (CONVERTER *self, int direction,
if (direction < 0)
return 0;
+ /* To debug:
+ fprintf (stderr, "DS: %d %s %s %s\n", direction,
+ direction_string_type_names[string_type],
+ direction_string_context_names[context],
+ self->direction_unit_direction_name[direction]);
+ */
if (direction >= FIRSTINFILE_MIN_IDX && direction <= FIRSTINFILE_MAX_IDX)
{
+ /* in general the offset is negative */
direction += FIRSTINFILE_OFFSET;
direction_unit_direction_idx = direction;
}
@@ -17313,47 +17320,11 @@ new_special_unit_info_type (int
special_units_varieties_nr)
return special_unit_info;
}
-/* most of the initialization is done by html_converter_initialize_sv
- in get_perl_info, the initialization that do not require information
- directly from perl data is done here. This is called after information
- from perl has been gathered */
void
-html_converter_initialize (CONVERTER *self)
+html_converter_init_special_unit (CONVERTER *self)
{
- int i;
int nr_special_units;
- /* counters of external formatting functions */
- int external_special_unit_body_formatting_function = 0;
- int external_output_unit_conversion_function = 0;
- int external_command_conversion_function = 0;
- int external_command_open_function = 0;
- int external_type_conversion_function = 0;
- int external_type_open_function = 0;
- int external_formatting_function = 0;
-
-#ifdef USE_PERL_HASHMAP
- init_registered_ids_hv (self);
-#else
- self->registered_ids = new_string_list ();
-#endif
-
- /* for @sc */
- for (i = 0; default_upper_case_commands[i]; i++)
- self->upper_case[default_upper_case_commands[i]] = 1;
-
- /* initialization needing some information from perl */
-
- if (self->html_customized_upper_case_commands)
- {
- for (i = 0; self->html_customized_upper_case_commands[i].cmd; i++)
- {
- COMMAND_INTEGER_INFORMATION *customized_upper
- = &self->html_customized_upper_case_commands[i];
- self->upper_case[customized_upper->cmd] = customized_upper->integer;
- }
- }
-
/* NOTE if the special units can be customized, then
self->special_unit_varieties should be used directly instead.
Also default special units and special units indices should be
@@ -17367,6 +17338,7 @@ html_converter_initialize (CONVERTER *self)
/* set to defaults */
if (nr_special_units > 0)
{
+ int i;
enum special_unit_info_type j;
for (j = 0; j < SPECIAL_UNIT_INFO_TYPE_NR; j++)
{
@@ -17398,7 +17370,50 @@ html_converter_initialize (CONVERTER *self)
self->special_unit_info[type][variety_idx] = 0;
}
}
+}
+
+/* most of the initialization is done by html_converter_initialize_sv
+ in get_perl_info, the initialization that do not require information
+ directly from perl data is done here. This is called after information
+ from perl has been gathered */
+void
+html_converter_initialize (CONVERTER *self)
+{
+ int i;
+ int nr_special_units;
+
+ /* counters of external formatting functions */
+ int external_special_unit_body_formatting_function = 0;
+ int external_output_unit_conversion_function = 0;
+ int external_command_conversion_function = 0;
+ int external_command_open_function = 0;
+ int external_type_conversion_function = 0;
+ int external_type_open_function = 0;
+ int external_formatting_function = 0;
+
+#ifdef USE_PERL_HASHMAP
+ init_registered_ids_hv (self);
+#else
+ self->registered_ids = new_string_list ();
+#endif
+
+ /* for @sc */
+ for (i = 0; default_upper_case_commands[i]; i++)
+ self->upper_case[default_upper_case_commands[i]] = 1;
+
+ /* initialization needing some information from perl */
+
+ if (self->html_customized_upper_case_commands)
+ {
+ for (i = 0; self->html_customized_upper_case_commands[i].cmd; i++)
+ {
+ COMMAND_INTEGER_INFORMATION *customized_upper
+ = &self->html_customized_upper_case_commands[i];
+ self->upper_case[customized_upper->cmd] = customized_upper->integer;
+ }
+ }
+ nr_special_units = self->special_unit_varieties.number;
self->direction_unit_direction_name = (const char **) malloc
((nr_special_units + NON_SPECIAL_DIRECTIONS_NR +1) * sizeof (char *));
diff --git a/tp/Texinfo/XS/convert/convert_html.h
b/tp/Texinfo/XS/convert/convert_html.h
index 887caffc81..1f47086667 100644
--- a/tp/Texinfo/XS/convert/convert_html.h
+++ b/tp/Texinfo/XS/convert/convert_html.h
@@ -46,6 +46,7 @@ extern COMMAND_ID_LIST no_arg_formatted_cmd;
void html_format_setup (void);
+void html_converter_init_special_unit (CONVERTER *self);
void html_converter_initialize (CONVERTER *self);
void html_initialize_output_state (CONVERTER *self, const char *context);
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.c
b/tp/Texinfo/XS/convert/get_html_perl_info.c
index 7fd27e5ab9..5b0413dcc3 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.c
@@ -129,6 +129,90 @@ compare_ints (const void *a, const void *b)
return (*int_a > *int_b) - (*int_a < *int_b);
}
+void
+html_converter_init_special_unit_sv (SV *converter_sv,
+ SV *customized_special_unit_info)
+{
+ CONVERTER *converter;
+ const STRING_LIST *special_unit_varieties;
+
+ dTHX;
+
+ converter = get_sv_converter (converter_sv,
+ "html_converter_init_special_unit_sv");
+
+ /* NOTE if the special units can be customized, then the
+ converter->special_unit_varieties should be set and used instead */
+ special_unit_varieties = &default_special_unit_varieties;
+ /*
+ special_unit_varieties = &converter->special_unit_varieties;
+ */
+
+ if (customized_special_unit_info && SvOK (customized_special_unit_info))
+ {
+ enum special_unit_info_type j;
+ HV *special_unit_info_hv;
+
+ STRING_LIST *customized_special_unit_varieties
+ = &converter->customized_special_unit_varieties;
+ clear_strings_list (customized_special_unit_varieties);
+
+ special_unit_info_hv = (HV *) SvRV(customized_special_unit_info);
+
+ for (j = 0; j < SPECIAL_UNIT_INFO_TYPE_NR; j++)
+ {
+ SV **special_unit_info_type_sv;
+ const char *sui_type = special_unit_info_type_names[j];
+ special_unit_info_type_sv = hv_fetch (special_unit_info_hv,
+ sui_type, strlen (sui_type),
0);
+ if (special_unit_info_type_sv && SvOK (*special_unit_info_type_sv))
+ {
+ I32 hv_number;
+ I32 i;
+ HV *special_unit_info_type_hv;
+
+ special_unit_info_type_hv
+ = (HV *) SvRV(*special_unit_info_type_sv);
+
+ hv_number = hv_iterinit (special_unit_info_type_hv);
+
+ for (i = 0; i < hv_number; i++)
+ {
+ HE *next = hv_iternext (special_unit_info_type_hv);
+ SV *variety_sv = hv_iterkeysv (next);
+ char *variety = (char *) SvPVutf8_nolen (variety_sv);
+ SV *value_sv = HeVAL(next);
+ char *value = 0;
+ /* the customized_special_unit_varieties are not used
+ further but is filled to retain the information on
+ the variety customized, even if they are ignored */
+ size_t customized_variety_nr = find_string (
+ customized_special_unit_varieties,
+ variety);
+ size_t variety_nr = find_string (special_unit_varieties,
+ variety);
+
+ if (!customized_variety_nr)
+ {
+ add_string (variety, customized_special_unit_varieties);
+ }
+
+ if (variety_nr)
+ {
+
+ if (SvOK (value_sv))
+ value = (char *) SvPVutf8_nolen (value_sv);
+
+ html_add_special_unit_info (
+ &converter->customized_special_unit_info, j,
+ variety_nr, value);
+ }
+ }
+ }
+ }
+ }
+}
+
void
html_converter_initialize_sv (SV *converter_sv,
SV *default_formatting_references,
@@ -142,7 +226,6 @@ html_converter_initialize_sv (SV *converter_sv,
SV *default_output_units_conversion,
SV *default_special_unit_body,
SV *customized_upper_case_commands,
- SV *customized_special_unit_info,
SV *default_converted_directions_strings
)
{
@@ -194,12 +277,8 @@ html_converter_initialize_sv (SV *converter_sv,
converter = get_sv_converter (converter_sv, "html_converter_initialize_sv");
- /* NOTE if the special units can be customized, then the
- converter->special_unit_varieties should be set and used instead */
- special_unit_varieties = &default_special_unit_varieties;
- /*
special_unit_varieties = &converter->special_unit_varieties;
- */
+
converter_hv = (HV *)SvRV (converter_sv);
default_formatting_references_hv
@@ -239,70 +318,6 @@ html_converter_initialize_sv (SV *converter_sv,
}
}
- if (customized_special_unit_info && SvOK (customized_special_unit_info))
- {
- enum special_unit_info_type j;
- HV *special_unit_info_hv;
-
- STRING_LIST *customized_special_unit_varieties
- = &converter->customized_special_unit_varieties;
- clear_strings_list (customized_special_unit_varieties);
-
- special_unit_info_hv = (HV *) SvRV(customized_special_unit_info);
-
- for (j = 0; j < SPECIAL_UNIT_INFO_TYPE_NR; j++)
- {
- SV **special_unit_info_type_sv;
- const char *sui_type = special_unit_info_type_names[j];
- special_unit_info_type_sv = hv_fetch (special_unit_info_hv,
- sui_type, strlen (sui_type),
0);
- if (special_unit_info_type_sv && SvOK (*special_unit_info_type_sv))
- {
- I32 hv_number;
- I32 i;
- HV *special_unit_info_type_hv;
-
- special_unit_info_type_hv
- = (HV *) SvRV(*special_unit_info_type_sv);
-
- hv_number = hv_iterinit (special_unit_info_type_hv);
-
- for (i = 0; i < hv_number; i++)
- {
- HE *next = hv_iternext (special_unit_info_type_hv);
- SV *variety_sv = hv_iterkeysv (next);
- char *variety = (char *) SvPVutf8_nolen (variety_sv);
- SV *value_sv = HeVAL(next);
- char *value = 0;
- /* the customized_special_unit_varieties are not used
- further but is filled to retain the information on
- the variety customized, even if they are ignored */
- size_t customized_variety_nr = find_string (
- customized_special_unit_varieties,
- variety);
- size_t variety_nr = find_string (special_unit_varieties,
- variety);
-
- if (!customized_variety_nr)
- {
- add_string (variety, customized_special_unit_varieties);
- }
-
- if (variety_nr)
- {
-
- if (SvOK (value_sv))
- value = (char *) SvPVutf8_nolen (value_sv);
-
- html_add_special_unit_info (
- &converter->customized_special_unit_info, j,
- variety_nr, value);
- }
- }
- }
- }
- }
-
/* Should always be true */
if (default_converted_directions_strings
&& SvOK (default_converted_directions_strings))
@@ -340,9 +355,8 @@ html_converter_initialize_sv (SV *converter_sv,
if (i < FIRSTINFILE_MIN_IDX)
direction_name = html_button_direction_names[i];
else
- /* FIXME if special units are dynamic this is incorrect */
direction_name
- = default_special_unit_info[SUI_type_direction]
+ = converter->special_unit_info[SUI_type_direction]
[i - FIRSTINFILE_MIN_IDX];
spec_sv = hv_fetch (direction_hv, direction_name,
@@ -957,9 +971,8 @@ html_converter_initialize_sv (SV *converter_sv,
if (i < FIRSTINFILE_MIN_IDX)
direction_name = html_button_direction_names[i];
else
- /* FIXME if special units are dynamic this is incorrect */
direction_name
- = default_special_unit_info[SUI_type_direction]
+ = converter->special_unit_info[SUI_type_direction]
[i - FIRSTINFILE_MIN_IDX];
spec_sv = hv_fetch (direction_hv, direction_name,
@@ -1169,9 +1182,8 @@ html_converter_initialize_sv (SV *converter_sv,
if (i < FIRSTINFILE_MIN_IDX)
direction_name = html_button_direction_names[i];
else
- /* FIXME if special units are dynamic this is incorrect */
direction_name
- = default_special_unit_info[SUI_type_direction]
+ = converter->special_unit_info[SUI_type_direction]
[i - FIRSTINFILE_MIN_IDX];
context_sv = hv_fetch (direction_hv, direction_name,
@@ -1218,6 +1230,14 @@ html_converter_initialize_sv (SV *converter_sv,
continue;
}
}
+ /* this happens if the direction strings are undef
+ else
+ {
+ fprintf (stderr,
+ "customized_direction_strings: %s: %s not found\n",
+ type_name, direction_name);
+ }
+ */
}
}
}
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.h
b/tp/Texinfo/XS/convert/get_html_perl_info.h
index 7ff9ed4cd8..4be91621a3 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.h
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.h
@@ -9,6 +9,8 @@
int get_output_units_descriptor_converter_sv (SV *converter_in);
+void html_converter_init_special_unit_sv (SV *converter_sv,
+ SV *customized_special_unit_info);
void html_converter_initialize_sv (SV *converter_sv,
SV *default_formatting_references,
SV *default_css_string_formatting_references,
@@ -21,7 +23,6 @@ void html_converter_initialize_sv (SV *converter_sv,
SV *default_output_units_conversion,
SV *default_special_unit_body,
SV *customized_upper_case_commands,
- SV *customized_special_unit_info,
SV *default_converted_directions_strings
);
diff --git a/tp/t/init_files_tests.t b/tp/t/init_files_tests.t
index b87788bac6..8d2ffd3439 100644
--- a/tp/t/init_files_tests.t
+++ b/tp/t/init_files_tests.t
@@ -276,6 +276,12 @@ $special_unit_direction_customization_text,
$special_unit_direction_customization_text,
{'init_files' => ['button_replacement_for_special_unit_direction.pm']},
],
+['button_replacement_and_direction_customization',
+$special_unit_direction_customization_text,
+{'init_files' => ['special_unit_direction_customization.pm',
+ 'button_replacement_for_special_unit_direction.pm']},
+],
+
);
foreach my $test (@test_cases) {
diff --git
a/tp/t/results/init_files_tests/button_replacement_and_direction_customization.pl
b/tp/t/results/init_files_tests/button_replacement_and_direction_customization.pl
new file mode 100644
index 0000000000..4651b7b174
--- /dev/null
+++
b/tp/t/results/init_files_tests/button_replacement_and_direction_customization.pl
@@ -0,0 +1,290 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'button_replacement_and_direction_customization'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => '
+',
+ 'type' => 'rawline_arg'
+ }
+ ],
+ 'cmdname' => 'contents',
+ 'extra' => {},
+ 'source_info' => {
+ 'line_nr' => 1
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'Top'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 3
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'chapter'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'chapter'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 6
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'chap'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'section_number' => '1'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 7
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'button_replacement_and_direction_customization'} = '@contents
+
+@node Top
+@top top
+
+@node chapter
+@chapter chap
+';
+
+
+$result_texts{'button_replacement_and_direction_customization'} = '
+top
+***
+
+1 chap
+******
+';
+
+$result_sectioning{'button_replacement_and_direction_customization'} = {
+ 'extra' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'chapter'
+ }
+ },
+ 'section_directions' => {
+ 'up' => {}
+ },
+ 'section_level' => 1,
+ 'section_number' => '1',
+ 'toplevel_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ }
+ }
+ }
+ ],
+ 'section_level' => 0,
+ 'sectioning_root' => {},
+ 'toplevel_directions' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'button_replacement_and_direction_customization'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'section_directions'}{'up'}
=
$result_sectioning{'button_replacement_and_direction_customization'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'button_replacement_and_direction_customization'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'prev'}
=
$result_sectioning{'button_replacement_and_direction_customization'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'button_replacement_and_direction_customization'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'up'}
=
$result_sectioning{'button_replacement_and_direction_customization'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'button_replacement_and_direction_customization'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
= $result_sectioning{'button_replacement_and_direction_customization'};
+
+$result_nodes{'button_replacement_and_direction_customization'} = [
+ {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {}
+ },
+ 'node_directions' => {
+ 'next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'section_number' => '1'
+ }
+ },
+ 'node_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'normalized' => 'chapter'
+ }
+ }
+ },
+ 'normalized' => 'Top'
+ }
+ },
+ {}
+];
+$result_nodes{'button_replacement_and_direction_customization'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
= $result_nodes{'button_replacement_and_direction_customization'}[0];
+$result_nodes{'button_replacement_and_direction_customization'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
= $result_nodes{'button_replacement_and_direction_customization'}[0];
+$result_nodes{'button_replacement_and_direction_customization'}[1] =
$result_nodes{'button_replacement_and_direction_customization'}[0]{'extra'}{'node_directions'}{'next'};
+
+$result_menus{'button_replacement_and_direction_customization'} = [
+ {
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'chapter'
+ }
+ }
+];
+
+$result_errors{'button_replacement_and_direction_customization'} = [];
+
+
+$result_floats{'button_replacement_and_direction_customization'} = {};
+
+
+1;
diff --git
a/tp/t/results/init_files_tests/button_replacement_and_direction_customization/res_html/chapter.html
b/tp/t/results/init_files_tests/button_replacement_and_direction_customization/res_html/chapter.html
new file mode 100644
index 0000000000..7eae7b1a80
--- /dev/null
+++
b/tp/t/results/init_files_tests/button_replacement_and_direction_customization/res_html/chapter.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>chapter (top)</title>
+
+<meta name="description" content="chapter (top)">
+<meta name="keywords" content="chapter (top)">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="index.html" rel="start" title="Top">
+<link href="index.html#SEC_Contents" title="Table of Contents">
+<link href="index.html" rel="up" title="Top">
+<link href="index.html" rel="prev" title="Top">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="chapter-level-extent" id="chapter">
+<div class="nav-panel">
+<p>
+Previous: <a href="index.html" accesskey="p" rel="prev">top</a>, Up: <a
href="index.html" accesskey="u" rel="up">top</a> [<a
href="index.html#SEC_Contents"></a>]</p>
+</div>
+<hr>
+<h2 class="chapter" id="chap"><span>1 chap<a class="copiable-link"
href="#chap"> ¶</a></span></h2>
+</div>
+
+
+
+</body>
+</html>
diff --git
a/tp/t/results/init_files_tests/button_replacement_and_direction_customization/res_html/index.html
b/tp/t/results/init_files_tests/button_replacement_and_direction_customization/res_html/index.html
new file mode 100644
index 0000000000..e4f30d197f
--- /dev/null
+++
b/tp/t/results/init_files_tests/button_replacement_and_direction_customization/res_html/index.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Top (top)</title>
+
+<meta name="description" content="Top (top)">
+<meta name="keywords" content="Top (top)">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<link href="#SEC_Contents" title="Table of Contents">
+<link href="chapter.html" rel="next" title="chapter">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+ul.toc-numbered-mark {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a href="chapter.html" accesskey="n" rel="next">chap</a> [<a
href="#SEC_Contents"></a>]</p>
+</div>
+<hr>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<div class="region-contents" id="SEC_Contents">
+<h2 class="contents-heading">Table of Contents</h2>
+
+<div class="contents">
+
+<ul class="toc-numbered-mark">
+ <li><a id="toc-chap" href="chapter.html">1 chap</a></li>
+</ul>
+</div>
+</div>
+</div>
+<hr>
+<div class="nav-panel">
+<p>
+Next: <a href="chapter.html" accesskey="n" rel="next">chap</a> [<a
href="#SEC_Contents"></a>]</p>
+</div>
+
+
+
+</body>
+</html>