[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/t/test_utils.pl (test): read 'FORMAT_MENU' a
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/t/test_utils.pl (test): read 'FORMAT_MENU' as a structuring option. Only call Texinfo::Structuring::complete_node_tree_with_menus and Texinfo::Structuring::check_nodes_are_referenced if 'FORMAT_MENU' is set to menu. |
Date: |
Sat, 31 Dec 2022 18:38:22 -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 12ed34e607 * tp/t/test_utils.pl (test): read 'FORMAT_MENU' as a
structuring option. Only call
Texinfo::Structuring::complete_node_tree_with_menus and
Texinfo::Structuring::check_nodes_are_referenced if 'FORMAT_MENU' is set to
menu.
12ed34e607 is described below
commit 12ed34e6077b04888efd0b9f39989d1cf5541163
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 1 00:38:11 2023 +0100
* tp/t/test_utils.pl (test): read 'FORMAT_MENU' as a structuring
option. Only call Texinfo::Structuring::complete_node_tree_with_menus
and Texinfo::Structuring::check_nodes_are_referenced if 'FORMAT_MENU'
is set to menu.
* tp/Makefile.tres, tp/t/30sectioning.t: add
chapter_between_nodes_with_appendix and
chapter_between_nodes_with_appendix_nomenu tests, in particular to
have a case with Top next node automatic direction being determined
by the menu.
* tp/t/10menu.t: remove 'FORMAT_MENU' => 'nomenu' from the
converter/structuring options of simple_no_menu test, as it does not
change the output.
---
ChangeLog | 17 +
tp/Makefile.tres | 2 +
tp/Texinfo/Convert/HTML.pm | 1 -
tp/t/10menu.t | 4 +-
tp/t/30sectioning.t | 25 +
.../chapter_between_nodes_with_appendix.pl | 558 +++++++++++++++++++++
.../chapter_between_nodes_with_appendix_nomenu.pl | 554 ++++++++++++++++++++
tp/t/test_utils.pl | 11 +-
8 files changed, 1166 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ed18288fd3..228dd9341e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2022-12-31 Patrice Dumas <pertusus@free.fr>
+
+ * tp/t/test_utils.pl (test): read 'FORMAT_MENU' as a structuring
+ option. Only call Texinfo::Structuring::complete_node_tree_with_menus
+ and Texinfo::Structuring::check_nodes_are_referenced if 'FORMAT_MENU'
+ is set to menu.
+
+ * tp/Makefile.tres, tp/t/30sectioning.t: add
+ chapter_between_nodes_with_appendix and
+ chapter_between_nodes_with_appendix_nomenu tests, in particular to
+ have a case with Top next node automatic direction being determined
+ by the menu.
+
+ * tp/t/10menu.t: remove 'FORMAT_MENU' => 'nomenu' from the
+ converter/structuring options of simple_no_menu test, as it does not
+ change the output.
+
2022-12-31 Patrice Dumas <pertusus@free.fr>
* tp/Makefile.am (test_files), tp/t/09indices.t,
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 6a71ef9afc..48668c9c8a 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -1837,6 +1837,8 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/sectioning/chapter_before_part.pl \
t/results/sectioning/chapter_between_nodes.pl \
t/results/sectioning/chapter_between_nodes/res_latex/chapter_between_nodes.tex \
+ t/results/sectioning/chapter_between_nodes_with_appendix.pl \
+ t/results/sectioning/chapter_between_nodes_with_appendix_nomenu.pl \
t/results/sectioning/chapter_node_before_and_after_part.pl \
t/results/sectioning/chapter_sections.pl \
t/results/sectioning/character_and_spaces_in_node.pl \
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index e46c438442..79e86cf185 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -3561,7 +3561,6 @@ sub _default_panel_button_dynamic_direction($$;$$$)
undef, undef, $source_command);
my $node;
-
if ($self->get_conf('xrefautomaticsectiontitle') eq 'on') {
$node = $self->from_element_direction($direction, 'section');
}
diff --git a/tp/t/10menu.t b/tp/t/10menu.t
index 6d281ff17e..35ba624852 100644
--- a/tp/t/10menu.t
+++ b/tp/t/10menu.t
@@ -36,7 +36,9 @@ Horizontal space
@node subnode
'],
['simple', $simple_menu_text],
-['simple_no_menu', $simple_menu_text, {'FORMAT_MENU' => 'nomenu'},
{'FORMAT_MENU' => 'nomenu'}],
+# there could be a nomenu in the converter/structuring options hash,
+# too, but it would not change the output.
+['simple_no_menu', $simple_menu_text, {}, {'FORMAT_MENU' => 'nomenu'}],
['menu_entry_node',
'@menu
* (f)a1::
diff --git a/tp/t/30sectioning.t b/tp/t/30sectioning.t
index 5d781c533f..e2b0790959 100644
--- a/tp/t/30sectioning.t
+++ b/tp/t/30sectioning.t
@@ -302,6 +302,19 @@ second node
@subsection subsection
';
+my $chapter_between_nodes_with_appendix = '@node Top
+@top top section
+@chapter Main
+Top node
+
+@menu
+* Additional::
+@end menu
+
+@node Additional
+@appendix Annex
+';
+
my @tests_converted = (
['contents',
$test_text.
@@ -905,6 +918,18 @@ section.
@contents
', {}, {'CONTENTS_OUTPUT_LOCATION' => 'inline'}],
+# quite similar with previous test, but the following sectioning
+# command is also at chapter level
+['chapter_between_nodes_with_appendix',
+$chapter_between_nodes_with_appendix
+],
+# this difference is interesting, as with something else than menu,
+# the node_next direction of Top node is not determined, and it is
+# a similar setup with texi2any --html.
+['chapter_between_nodes_with_appendix_nomenu',
+$chapter_between_nodes_with_appendix,
+{'FORMAT_MENU' => 'nomenu'},
+],
['section_before_after_top_node_last_node',
'@unnumbered before
diff --git a/tp/t/results/sectioning/chapter_between_nodes_with_appendix.pl
b/tp/t/results/sectioning/chapter_between_nodes_with_appendix.pl
new file mode 100644
index 0000000000..7267636136
--- /dev/null
+++ b/tp/t/results/sectioning/chapter_between_nodes_with_appendix.pl
@@ -0,0 +1,558 @@
+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{'chapter_between_nodes_with_appendix'} = {
+ 'contents' => [
+ {
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'Top'
+ }
+ ],
+ 'normalized' => 'Top'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top section'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Main'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top node
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'menu',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => '* ',
+ 'type' => 'menu_entry_leading_text'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'Additional'
+ }
+ ],
+ 'type' => 'menu_entry_node'
+ },
+ {
+ 'text' => '::',
+ 'type' => 'menu_entry_separator'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'type' => 'preformatted'
+ }
+ ],
+ 'type' => 'menu_entry_description'
+ }
+ ],
+ 'extra' => {
+ 'menu_entry_description' => {},
+ 'menu_entry_node' => {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'Additional'
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ },
+ 'type' => 'menu_entry'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'menu'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'menu'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 6,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Additional'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'Additional'
+ }
+ ],
+ 'normalized' => 'Additional'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Annex'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'appendix',
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[1]{'extra'}{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[3]{'contents'}[2]{'contents'}[0]{'extra'}{'menu_entry_description'}
=
$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[3]{'contents'}[2]{'contents'}[0]{'args'}[3];
+$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[3]{'contents'}[2]{'contents'}[0]{'extra'}{'menu_entry_node'}{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[3]{'contents'}[2]{'contents'}[0]{'args'}[1]{'contents'}[0];
+$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[4]{'extra'}{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[4]{'args'}[0]{'contents'}[0];
+$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[4]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix'}{'contents'}[4]{'args'}[0]{'contents'}[0];
+
+$result_texis{'chapter_between_nodes_with_appendix'} = '@node Top
+@top top section
+@chapter Main
+Top node
+
+@menu
+* Additional::
+@end menu
+
+@node Additional
+@appendix Annex
+';
+
+
+$result_texts{'chapter_between_nodes_with_appendix'} = 'top section
+***********
+1 Main
+******
+Top node
+
+* Additional::
+
+Appendix A Annex
+****************
+';
+
+$result_sectioning{'chapter_between_nodes_with_appendix'} = {
+ 'structure' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ },
+ 'info' => {},
+ 'structure' => {}
+ }
+ },
+ 'info' => {},
+ 'structure' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'info' => {},
+ 'structure' => {
+ 'section_level' => 1,
+ 'section_number' => 1,
+ 'section_up' => {},
+ 'toplevel_prev' => {},
+ 'toplevel_up' => {}
+ }
+ },
+ {
+ 'cmdname' => 'appendix',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Additional'
+ },
+ 'info' => {},
+ 'structure' => {}
+ }
+ },
+ 'info' => {},
+ 'structure' => {
+ 'section_level' => 1,
+ 'section_number' => 'A',
+ 'section_prev' => {},
+ 'section_up' => {},
+ 'toplevel_prev' => {},
+ 'toplevel_up' => {}
+ }
+ }
+ ],
+ 'section_level' => 0,
+ 'section_up' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
=
$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_prev'}
=
$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_up'}
=
$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[1]{'structure'}{'section_prev'}
=
$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[1]{'structure'}{'section_up'}
=
$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[1]{'structure'}{'toplevel_prev'}
=
$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[1]{'structure'}{'toplevel_up'}
=
$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix'}{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
= $result_sectioning{'chapter_between_nodes_with_appendix'};
+
+$result_nodes{'chapter_between_nodes_with_appendix'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {},
+ 'info' => {},
+ 'structure' => {}
+ },
+ 'menus' => [
+ {
+ 'cmdname' => 'menu'
+ }
+ ],
+ 'normalized' => 'Top'
+ },
+ 'info' => {},
+ 'structure' => {
+ 'menu_child' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'appendix',
+ 'extra' => {},
+ 'info' => {},
+ 'structure' => {
+ 'section_number' => 'A'
+ }
+ },
+ 'normalized' => 'Additional'
+ },
+ 'info' => {},
+ 'structure' => {
+ 'node_prev' => {},
+ 'node_up' => {}
+ }
+ },
+ 'node_next' => {}
+ }
+};
+$result_nodes{'chapter_between_nodes_with_appendix'}{'structure'}{'menu_child'}{'structure'}{'node_prev'}
= $result_nodes{'chapter_between_nodes_with_appendix'};
+$result_nodes{'chapter_between_nodes_with_appendix'}{'structure'}{'menu_child'}{'structure'}{'node_up'}
= $result_nodes{'chapter_between_nodes_with_appendix'};
+$result_nodes{'chapter_between_nodes_with_appendix'}{'structure'}{'node_next'}
=
$result_nodes{'chapter_between_nodes_with_appendix'}{'structure'}{'menu_child'};
+
+$result_menus{'chapter_between_nodes_with_appendix'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ },
+ 'info' => {},
+ 'structure' => {
+ 'menu_child' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Additional'
+ },
+ 'info' => {},
+ 'structure' => {
+ 'menu_up' => {},
+ 'menu_up_hash' => {
+ 'Top' => 1
+ }
+ }
+ }
+ }
+};
+$result_menus{'chapter_between_nodes_with_appendix'}{'structure'}{'menu_child'}{'structure'}{'menu_up'}
= $result_menus{'chapter_between_nodes_with_appendix'};
+
+$result_errors{'chapter_between_nodes_with_appendix'} = [];
+
+
+$result_floats{'chapter_between_nodes_with_appendix'} = {};
+
+
+
+$result_converted{'info'}->{'chapter_between_nodes_with_appendix'} = 'This is
, produced from .
+
+
+File: , Node: Top, Next: Additional, Up: (dir)
+
+top section
+***********
+
+* Menu:
+
+* Additional::
+
+1 Main
+******
+
+Top node
+
+* Menu:
+
+* Additional::
+
+
+File: , Node: Additional, Prev: Top, Up: Top
+
+Appendix A Annex
+****************
+
+
+
+Tag Table:
+Node: Top27
+Node: Additional180
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
+';
+
+
+$result_converted{'html'}->{'chapter_between_nodes_with_appendix'} =
'<!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 section</title>
+
+<meta name="description" content="top section">
+<meta name="keywords" content="top section">
+<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">
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a href="#Additional" accesskey="n" rel="next">Annex</a> </p>
+</div>
+<h1 class="top" id="top-section">top section</h1>
+<ul class="mini-toc">
+<li><a href="#Main" accesskey="1">Main</a></li>
+<li><a href="#Additional" accesskey="2">Annex</a></li>
+</ul>
+<div class="chapter-level-extent" id="Main">
+<h2 class="chapter">1 Main</h2>
+<p>Top node
+</p>
+
+<hr>
+</div>
+<div class="appendix-level-extent" id="Additional">
+<div class="nav-panel">
+<p>
+Previous: <a href="#Top" accesskey="p" rel="prev">top section</a>, Up: <a
href="#Top" accesskey="u" rel="up">top section</a> </p>
+</div>
+<h2 class="appendix" id="Annex">Appendix A Annex</h2>
+</div>
+</div>
+
+
+
+</body>
+</html>
+';
+
+1;
diff --git
a/tp/t/results/sectioning/chapter_between_nodes_with_appendix_nomenu.pl
b/tp/t/results/sectioning/chapter_between_nodes_with_appendix_nomenu.pl
new file mode 100644
index 0000000000..ee278a79ea
--- /dev/null
+++ b/tp/t/results/sectioning/chapter_between_nodes_with_appendix_nomenu.pl
@@ -0,0 +1,554 @@
+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{'chapter_between_nodes_with_appendix_nomenu'} = {
+ 'contents' => [
+ {
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'Top'
+ }
+ ],
+ 'normalized' => 'Top'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top section'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Main'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top node
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'menu',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => '* ',
+ 'type' => 'menu_entry_leading_text'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'Additional'
+ }
+ ],
+ 'type' => 'menu_entry_node'
+ },
+ {
+ 'text' => '::',
+ 'type' => 'menu_entry_separator'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'type' => 'preformatted'
+ }
+ ],
+ 'type' => 'menu_entry_description'
+ }
+ ],
+ 'extra' => {
+ 'menu_entry_description' => {},
+ 'menu_entry_node' => {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'Additional'
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ },
+ 'type' => 'menu_entry'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'menu'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'menu'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 6,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Additional'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'nodes_manuals' => [
+ {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'Additional'
+ }
+ ],
+ 'normalized' => 'Additional'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Annex'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'appendix',
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[1]{'extra'}{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[3]{'contents'}[2]{'contents'}[0]{'extra'}{'menu_entry_description'}
=
$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[3]{'contents'}[2]{'contents'}[0]{'args'}[3];
+$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[3]{'contents'}[2]{'contents'}[0]{'extra'}{'menu_entry_node'}{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[3]{'contents'}[2]{'contents'}[0]{'args'}[1]{'contents'}[0];
+$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[4]{'extra'}{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[4]{'args'}[0]{'contents'}[0];
+$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[4]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
=
$result_trees{'chapter_between_nodes_with_appendix_nomenu'}{'contents'}[4]{'args'}[0]{'contents'}[0];
+
+$result_texis{'chapter_between_nodes_with_appendix_nomenu'} = '@node Top
+@top top section
+@chapter Main
+Top node
+
+@menu
+* Additional::
+@end menu
+
+@node Additional
+@appendix Annex
+';
+
+
+$result_texts{'chapter_between_nodes_with_appendix_nomenu'} = 'top section
+***********
+1 Main
+******
+Top node
+
+* Additional::
+
+Appendix A Annex
+****************
+';
+
+$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'} = {
+ 'structure' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ },
+ 'info' => {},
+ 'structure' => {}
+ }
+ },
+ 'info' => {},
+ 'structure' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'info' => {},
+ 'structure' => {
+ 'section_level' => 1,
+ 'section_number' => 1,
+ 'section_up' => {},
+ 'toplevel_prev' => {},
+ 'toplevel_up' => {}
+ }
+ },
+ {
+ 'cmdname' => 'appendix',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Additional'
+ },
+ 'info' => {},
+ 'structure' => {}
+ }
+ },
+ 'info' => {},
+ 'structure' => {
+ 'section_level' => 1,
+ 'section_number' => 'A',
+ 'section_prev' => {},
+ 'section_up' => {},
+ 'toplevel_prev' => {},
+ 'toplevel_up' => {}
+ }
+ }
+ ],
+ 'section_level' => 0,
+ 'section_up' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
=
$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_prev'}
=
$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_up'}
=
$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[1]{'structure'}{'section_prev'}
=
$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[1]{'structure'}{'section_up'}
=
$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[1]{'structure'}{'toplevel_prev'}
=
$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[1]{'structure'}{'toplevel_up'}
=
$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
= $result_sectioning{'chapter_between_nodes_with_appendix_nomenu'};
+
+$result_nodes{'chapter_between_nodes_with_appendix_nomenu'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {},
+ 'info' => {},
+ 'structure' => {}
+ },
+ 'menus' => [
+ {
+ 'cmdname' => 'menu'
+ }
+ ],
+ 'normalized' => 'Top'
+ },
+ 'info' => {},
+ 'structure' => {
+ 'menu_child' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'appendix',
+ 'extra' => {},
+ 'info' => {},
+ 'structure' => {
+ 'section_number' => 'A'
+ }
+ },
+ 'normalized' => 'Additional'
+ },
+ 'info' => {},
+ 'structure' => {
+ 'node_up' => {}
+ }
+ }
+ }
+};
+$result_nodes{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'menu_child'}{'structure'}{'node_up'}
= $result_nodes{'chapter_between_nodes_with_appendix_nomenu'};
+
+$result_menus{'chapter_between_nodes_with_appendix_nomenu'} = {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ },
+ 'info' => {},
+ 'structure' => {
+ 'menu_child' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Additional'
+ },
+ 'info' => {},
+ 'structure' => {
+ 'menu_up' => {},
+ 'menu_up_hash' => {
+ 'Top' => 1
+ }
+ }
+ }
+ }
+};
+$result_menus{'chapter_between_nodes_with_appendix_nomenu'}{'structure'}{'menu_child'}{'structure'}{'menu_up'}
= $result_menus{'chapter_between_nodes_with_appendix_nomenu'};
+
+$result_errors{'chapter_between_nodes_with_appendix_nomenu'} = [];
+
+
+$result_floats{'chapter_between_nodes_with_appendix_nomenu'} = {};
+
+
+
+$result_converted{'info'}->{'chapter_between_nodes_with_appendix_nomenu'} =
'This is , produced from .
+
+
+File: , Node: Top, Up: (dir)
+
+top section
+***********
+
+* Menu:
+
+* Additional::
+
+1 Main
+******
+
+Top node
+
+* Menu:
+
+* Additional::
+
+
+File: , Node: Additional, Up: Top
+
+Appendix A Annex
+****************
+
+
+
+Tag Table:
+Node: Top27
+Node: Additional161
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
+';
+
+
+$result_converted{'html'}->{'chapter_between_nodes_with_appendix_nomenu'} =
'<!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 section</title>
+
+<meta name="description" content="top section">
+<meta name="keywords" content="top section">
+<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">
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+ </p>
+</div>
+<h1 class="top" id="top-section">top section</h1>
+<ul class="mini-toc">
+<li><a href="#Main" accesskey="1">Main</a></li>
+<li><a href="#Additional" accesskey="2">Annex</a></li>
+</ul>
+<div class="chapter-level-extent" id="Main">
+<h2 class="chapter">1 Main</h2>
+<p>Top node
+</p>
+
+<hr>
+</div>
+<div class="appendix-level-extent" id="Additional">
+<div class="nav-panel">
+<p>
+Up: <a href="#Top" accesskey="u" rel="up">top section</a> </p>
+</div>
+<h2 class="appendix" id="Annex">Appendix A Annex</h2>
+</div>
+</div>
+
+
+
+</body>
+</html>
+';
+
+1;
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index 7415635823..0b9b19f808 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -903,11 +903,11 @@ sub test($$)
delete $parser_options->{'TREE_TRANSFORMATIONS'};
}
- # always set FORMAT_MENU to menu, which is the default for parser
+ # set FORMAT_MENU default to menu, which is the default for parser
my $added_main_configurations = {'FORMAT_MENU' => 'menu'};
# this is only used for index keys sorting in structuring
- foreach my $structuring_and_converter_option (('ENABLE_ENCODING')) {
+ foreach my $structuring_and_converter_option ('ENABLE_ENCODING') {
if (defined($parser_options->{$structuring_and_converter_option})) {
$added_main_configurations->{$structuring_and_converter_option}
= $parser_options->{$structuring_and_converter_option};
@@ -917,7 +917,8 @@ sub test($$)
}
}
- foreach my $structuring_option (('CHECK_NORMAL_MENU_STRUCTURE')) {
+ foreach my $structuring_option ('CHECK_NORMAL_MENU_STRUCTURE',
+ 'FORMAT_MENU') {
if (defined($parser_options->{$structuring_option})) {
$added_main_configurations->{$structuring_option}
= $parser_options->{$structuring_option};
@@ -1108,7 +1109,9 @@ sub test($$)
$structure_information->{'top_node'} = $top_node;
}
- if (defined($nodes_list)) {
+ if (defined($nodes_list)
+ and (not defined($main_configuration->get_conf('FORMAT_MENU'))
+ or $main_configuration->get_conf('FORMAT_MENU') eq 'menu')) {
Texinfo::Structuring::complete_node_tree_with_menus($registrar,
$main_configuration, $nodes_list, $top_node);
Texinfo::Structuring::check_nodes_are_referenced($registrar,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/t/test_utils.pl (test): read 'FORMAT_MENU' as a structuring option. Only call Texinfo::Structuring::complete_node_tree_with_menus and Texinfo::Structuring::check_nodes_are_referenced if 'FORMAT_MENU' is set to menu.,
Patrice Dumas <=