[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Fix master menu generation with node in its own m
From: |
Patrice Dumas |
Subject: |
branch master updated: Fix master menu generation with node in its own menus |
Date: |
Thu, 11 Apr 2024 17:32:49 -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 9fe1552048 Fix master menu generation with node in its own menus
9fe1552048 is described below
commit 9fe1552048297e613e02135647433ca2226c782a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Apr 11 23:32:35 2024 +0200
Fix master menu generation with node in its own menus
* tp/Texinfo/Common.pm (converter_or_registrar_line_warn),
tp/Texinfo/Indices.pm: move _converter_or_registrar_line_warn from
Indices.pm to Common.pm and rename as
converter_or_registrar_line_warn.
* tp/Texinfo/Structuring.pm (new_master_menu)
(new_complete_menu_master_menu, _print_down_menus),
tp/Texinfo/XS/structuring_transfo/structuring.c (print_down_menus)
(new_master_menu, new_complete_menu_master_menu),
tp/t/do_master_menu.t: add the list of up nodes in print_down_menus
arguments and check if a child node is also an up node, to avoid
infinite recursion. Add error reporting arguments to
print_down_menus, and to caller, new_master_menu and
new_complete_menu_master_menu. Update callers.
* tp/Makefile.tres, tp/t/info_tests.t (recursive_down_menu): add a
test for a node in its own menu with a master menu generation.
---
ChangeLog | 22 +
tp/Makefile.tres | 1 +
tp/Texinfo/Common.pm | 21 +
tp/Texinfo/Indices.pm | 23 +-
tp/Texinfo/Structuring.pm | 46 +-
tp/Texinfo/Transformations.pm | 1 +
tp/Texinfo/XS/convert/convert_html.c | 4 +-
tp/Texinfo/XS/structuring_transfo/structuring.c | 79 +++-
tp/Texinfo/XS/structuring_transfo/structuring.h | 13 +-
.../XS/structuring_transfo/transformations.c | 3 +-
tp/t/do_master_menu.t | 4 +-
tp/t/info_tests.t | 12 +
tp/t/results/info_tests/recursive_down_menu.pl | 519 +++++++++++++++++++++
13 files changed, 696 insertions(+), 52 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 42dacef31f..f803e888fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2024-04-11 Patrice Dumas <pertusus@free.fr>
+
+ Fix master menu generation with node in its own menus
+
+ * tp/Texinfo/Common.pm (converter_or_registrar_line_warn),
+ tp/Texinfo/Indices.pm: move _converter_or_registrar_line_warn from
+ Indices.pm to Common.pm and rename as
+ converter_or_registrar_line_warn.
+
+ * tp/Texinfo/Structuring.pm (new_master_menu)
+ (new_complete_menu_master_menu, _print_down_menus),
+ tp/Texinfo/XS/structuring_transfo/structuring.c (print_down_menus)
+ (new_master_menu, new_complete_menu_master_menu),
+ tp/t/do_master_menu.t: add the list of up nodes in print_down_menus
+ arguments and check if a child node is also an up node, to avoid
+ infinite recursion. Add error reporting arguments to
+ print_down_menus, and to caller, new_master_menu and
+ new_complete_menu_master_menu. Update callers.
+
+ * tp/Makefile.tres, tp/t/info_tests.t (recursive_down_menu): add a
+ test for a node in its own menu with a master menu generation.
+
2024-04-11 Patrice Dumas <pertusus@free.fr>
* tp/t/test_utils.pl (test): initialize test customization variables
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 0b475e7218..97ff55a34d 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -1010,6 +1010,7 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/info_tests/pxref_test.pl \
t/results/info_tests/quote_node_names_info.pl \
t/results/info_tests/quote_node_names_info/res_info \
+ t/results/info_tests/recursive_down_menu.pl \
t/results/info_tests/ref_tests.pl \
t/results/info_tests/space_at_menu_end.pl \
t/results/info_tests/space_in_menu.pl \
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 0c08259bca..291036aa41 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -2589,6 +2589,27 @@ sub get_label_element($)
return undef;
}
+# For code that can be called both from the main
+# context, with a registrar and customization information, and from
+# a converter
+# NOTE it is considered internal and should not be called in user-defined
+# code. If this changes, should be documented.
+sub converter_or_registrar_line_warn($$$$)
+{
+ my $registrar = shift;
+ my $customization_information = shift;
+ my $text = shift;
+ my $error_location_info = shift;
+
+ if (defined($registrar)) {
+ $registrar->line_warn($customization_information, $text,
+ $error_location_info);
+ } else {
+ $customization_information->converter_line_warn($text,
+ $error_location_info);
+ }
+}
+
# functions used for debugging. May be used in other modules.
# Not documented.
diff --git a/tp/Texinfo/Indices.pm b/tp/Texinfo/Indices.pm
index c7e4908243..3824a2afda 100644
--- a/tp/Texinfo/Indices.pm
+++ b/tp/Texinfo/Indices.pm
@@ -211,25 +211,6 @@ sub getSortKey($$) {
package Texinfo::Indices;
-# this is needed here, as the code can be called both from the main
-# context, with a registrar and customization information, and from
-# a converter
-sub _converter_or_registrar_line_warn($$$$)
-{
- my $registrar = shift;
- my $customization_information = shift;
- my $text = shift;
- my $error_location_info = shift;
-
- if (defined($registrar)) {
- $registrar->line_warn($customization_information, $text,
- $error_location_info);
- } else {
- $customization_information->converter_line_warn($text,
- $error_location_info);
- }
-}
-
sub _setup_collator($$)
{
my $use_unicode_collation = shift;
@@ -336,7 +317,7 @@ sub setup_index_entries_sort_strings($$$$;$)
$entry_cmdname
= $main_entry_element->{'extra'}->{'original_def_cmdname'}
if (!defined($entry_cmdname));
- _converter_or_registrar_line_warn($registrar,
+ Texinfo::Common::converter_or_registrar_line_warn($registrar,
$customization_information,
sprintf(__("empty index key in \@%s"),
$entry_cmdname),
@@ -359,7 +340,7 @@ sub setup_index_entries_sort_strings($$$$;$)
$entry_cmdname
= $main_entry_element->{'extra'}->{'original_def_cmdname'}
if (!defined($entry_cmdname));
- _converter_or_registrar_line_warn($registrar,
+ Texinfo::Common::converter_or_registrar_line_warn($registrar,
$customization_information,
sprintf(__("empty index sub entry %d key in \@%s"),
$subentry_nr, $entry_cmdname),
diff --git a/tp/Texinfo/Structuring.pm b/tp/Texinfo/Structuring.pm
index 348d5596c1..161a48d031 100644
--- a/tp/Texinfo/Structuring.pm
+++ b/tp/Texinfo/Structuring.pm
@@ -1512,9 +1512,10 @@ sub new_complete_node_menu
}
# used in Plaintext converter and tree transformations
-sub new_master_menu($$$;$)
+sub new_master_menu($$$$;$)
{
my $customization_information = shift;
+ my $registrar = shift;
my $identifier_target = shift;
my $menus = shift;
my $use_sections = shift;
@@ -1530,7 +1531,9 @@ sub new_master_menu($$$;$)
= _normalized_entry_associated_internal_node($entry,
$identifier_target);
if ($node) {
- push @{$master_menu->{'contents'}}, _print_down_menus($node,
+ push @{$master_menu->{'contents'}}, _print_down_menus($node, undef,
+ $customization_information,
+ $registrar,
$identifier_target, $use_sections);
}
}
@@ -1574,7 +1577,7 @@ sub new_complete_menu_master_menu($$$)
and $node->{'extra'}->{'normalized'} eq 'Top'
and $node->{'extra'}->{'associated_section'}
and $node->{'extra'}->{'associated_section'}->{'cmdname'} eq 'top') {
- my $detailmenu = new_master_menu($self, $labels, [$menu_node]);
+ my $detailmenu = new_master_menu($self, undef, $labels, [$menu_node]);
if ($detailmenu) {
# add a blank line before the detailed node listing
my $menu_comment = {'type' => 'menu_comment',
@@ -1594,10 +1597,13 @@ sub new_complete_menu_master_menu($$$)
return $menu_node;
}
-sub _print_down_menus($$;$);
-sub _print_down_menus($$;$)
+sub _print_down_menus($$$$$;$);
+sub _print_down_menus($$$$$;$)
{
my $node = shift;
+ my $up_nodes = shift;
+ my $customization_information = shift;
+ my $registrar = shift;
my $identifier_target = shift;
my $use_sections = shift;
@@ -1610,8 +1616,7 @@ sub _print_down_menus($$;$)
@menus = @{$node->{'extra'}->{'menus'}};
} else {
my $current_menu
- = Texinfo::Structuring::new_complete_node_menu($node, undef,
- $use_sections);
+ = new_complete_node_menu($node, undef, $use_sections);
if (defined($current_menu)) {
@menus = ( $current_menu );
} else {
@@ -1650,11 +1655,34 @@ sub _print_down_menus($$;$)
_insert_menu_comment_content(\@master_menu_contents, 0,
$node_title_copy, 0);
+ if (!defined($up_nodes)) {
+ $up_nodes = [];
+ }
+ push @$up_nodes, [$node->{'extra'}->{'normalized'}, $node];
# now recurse in the children
foreach my $child (@node_children) {
- push @master_menu_contents, _print_down_menus($child, $identifier_target,
- $use_sections);
+ my $up_node_in_menu = 0;
+ my $normalized_child = $child->{'extra'}->{'normalized'};
+ foreach my $up_node_normalized (@$up_nodes) {
+ if ($normalized_child eq $up_node_normalized->[0]) {
+ Texinfo::Common::converter_or_registrar_line_warn($registrar,
+ $customization_information,
+ sprintf(__("node `%s' appears in its own menus"),
+ target_element_to_texi_label($up_node_normalized->[1])),
+ $up_node_normalized->[1]->{'source_info'});
+ $up_node_in_menu = 1;
+ last;
+ }
+ }
+ if (!$up_node_in_menu) {
+ push @master_menu_contents, _print_down_menus($child,
+ $up_nodes,
+ $customization_information,
+ $registrar,
+ $identifier_target, $use_sections);
+ }
}
+ pop @$up_nodes;
}
return @master_menu_contents;
diff --git a/tp/Texinfo/Transformations.pm b/tp/Texinfo/Transformations.pm
index c24d6d9168..e2ffa6b9dc 100644
--- a/tp/Texinfo/Transformations.pm
+++ b/tp/Texinfo/Transformations.pm
@@ -644,6 +644,7 @@ sub regenerate_master_menu($;$)
my $new_master_menu
= Texinfo::Structuring::new_master_menu($document,
+ $document->registrar(),
$identifier_target, $top_node->{'extra'}->{'menus'},
$use_sections);
return undef if (!defined($new_master_menu));
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index aea7124b26..f27ac232df 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -9985,8 +9985,8 @@ convert_heading_command (CONVERTER *self, const enum
command_id cmd,
if (!menus && automatic_directions)
{
ELEMENT *menu_node
- = new_complete_menu_master_menu (self->conf,
- self->document->identifiers_target, node);
+ = new_complete_menu_master_menu (&self->error_messages,
+ self->conf, self->document->identifiers_target, node);
if (menu_node)
{
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index 1a91518903..5755aa538f 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -35,6 +35,7 @@
#include "utils.h"
/* for copy_tree copy_contents parse_node_manual modify_tree protect_text */
#include "manipulate_tree.h"
+#include "command_stack.h"
#include "node_name_normalization.h"
#include "convert_to_texinfo.h"
#include "targets.h"
@@ -1940,7 +1941,10 @@ new_complete_node_menu (const ELEMENT *node, DOCUMENT
*document,
}
ELEMENT_LIST *
-print_down_menus (const ELEMENT *node, const LABEL_LIST *identifiers_target,
+print_down_menus (const ELEMENT *node, ELEMENT_STACK *up_nodes,
+ ERROR_MESSAGE_LIST *error_messages,
+ const OPTIONS *options,
+ const LABEL_LIST *identifiers_target,
int use_sections)
{
ELEMENT_LIST *master_menu_contents = new_list ();
@@ -2001,6 +2005,7 @@ print_down_menus (const ELEMENT *node, const LABEL_LIST
*identifiers_target,
ELEMENT *node_title_copy;
ELEMENT *associated_section
= lookup_extra_element (node, "associated_section");
+ int new_up_nodes = 0;
if (associated_section)
node_name_element = associated_section->args.list[0];
else
@@ -2013,17 +2018,63 @@ print_down_menus (const ELEMENT *node, const LABEL_LIST
*identifiers_target,
destroy_element (node_title_copy);
+ if (!up_nodes)
+ {
+ new_up_nodes = 1;
+ up_nodes = (ELEMENT_STACK *) malloc (sizeof (ELEMENT_STACK));
+ memset (up_nodes, 0, sizeof (ELEMENT_STACK));
+ }
+
+ push_stack_element (up_nodes, node);
+
/* now recurse in the children */
for (i = 0; i < node_children->number; i++)
{
ELEMENT *child = node_children->list[i];
- ELEMENT_LIST *child_menu_content
- = print_down_menus (child, identifiers_target, use_sections);
- insert_list_slice_into_list (master_menu_contents,
- master_menu_contents->number,
- child_menu_content, 0,
- child_menu_content->number);
- destroy_list (child_menu_content);
+ ELEMENT_LIST *child_menu_content;
+ const char *normalized_child
+ = lookup_extra_string (child, "normalized");
+ size_t i;
+ int up_node_in_menu = 0;
+
+ for (i = 0; i < up_nodes->top; i++)
+ {
+ const ELEMENT *up_node = up_nodes->stack[i];
+ const char *normalized_up_node
+ = lookup_extra_string (up_node, "normalized");
+ if (!strcmp (normalized_child, normalized_up_node))
+ {
+ char *up_node_texi
+ = target_element_to_texi_label (up_node);
+ message_list_command_warn (error_messages, options,
+ up_node, 0,
+ "node `%s' appears in its own menus",
+ up_node_texi);
+ free (up_node_texi);
+ up_node_in_menu = 1;
+ break;
+ }
+ }
+
+ if (!up_node_in_menu)
+ {
+ child_menu_content
+ = print_down_menus (child, up_nodes, error_messages,
+ options, identifiers_target, use_sections);
+ insert_list_slice_into_list (master_menu_contents,
+ master_menu_contents->number,
+ child_menu_content, 0,
+ child_menu_content->number);
+ destroy_list (child_menu_content);
+ }
+ }
+
+ pop_stack_element (up_nodes);
+
+ if (new_up_nodes)
+ {
+ free (up_nodes->stack);
+ free (up_nodes);
}
}
@@ -2033,7 +2084,9 @@ print_down_menus (const ELEMENT *node, const LABEL_LIST
*identifiers_target,
}
ELEMENT *
-new_master_menu (const OPTIONS *options, const LABEL_LIST *identifiers_target,
+new_master_menu (ERROR_MESSAGE_LIST *error_messages,
+ const OPTIONS *options,
+ const LABEL_LIST *identifiers_target,
const ELEMENT_LIST *menus, int use_sections)
{
/* only holds contents here, will be turned into a proper block
@@ -2058,6 +2111,7 @@ new_master_menu (const OPTIONS *options, const LABEL_LIST
*identifiers_target,
if (menu_node)
{
ELEMENT_LIST *down_menus = print_down_menus(menu_node,
+ 0, error_messages, options,
identifiers_target, use_sections);
if (down_menus)
{
@@ -2138,7 +2192,8 @@ protect_colon_in_tree (ELEMENT *tree)
}
ELEMENT *
-new_complete_menu_master_menu (const OPTIONS *options,
+new_complete_menu_master_menu (ERROR_MESSAGE_LIST *error_messages,
+ const OPTIONS *options,
const LABEL_LIST *identifiers_target,
const ELEMENT *node)
{
@@ -2156,8 +2211,8 @@ new_complete_menu_master_menu (const OPTIONS *options,
ELEMENT *detailmenu;
add_to_element_list (menus, menu_node);
- detailmenu = new_master_menu (options, identifiers_target,
- menus, 0);
+ detailmenu = new_master_menu (error_messages, options,
+ identifiers_target, menus, 0);
destroy_list (menus);
if (detailmenu)
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.h
b/tp/Texinfo/XS/structuring_transfo/structuring.h
index a7e02b04a9..82e3a44dce 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.h
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.h
@@ -20,12 +20,15 @@ ELEMENT *new_node_menu_entry (const ELEMENT *node, int
use_sections);
ELEMENT *new_complete_node_menu (const ELEMENT *node, DOCUMENT *document,
const OPTIONS *options, int use_sections);
void new_block_command (ELEMENT *element, enum command_id cmd);
-ELEMENT *new_master_menu (const OPTIONS *options, const LABEL_LIST
*identifiers_target,
- const ELEMENT_LIST *menus, int use_sections);
+ELEMENT *new_master_menu (ERROR_MESSAGE_LIST *error_messages,
+ const OPTIONS *options,
+ const LABEL_LIST *identifiers_target,
+ const ELEMENT_LIST *menus, int use_sections);
-ELEMENT *new_complete_menu_master_menu (const OPTIONS *options,
- const LABEL_LIST *identifiers_target,
- const ELEMENT *node);
+ELEMENT *new_complete_menu_master_menu (ERROR_MESSAGE_LIST *error_messages,
+ const OPTIONS *options,
+ const LABEL_LIST *identifiers_target,
+ const ELEMENT *node);
ELEMENT *protect_colon_in_tree (ELEMENT *tree);
#endif
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index 607542105d..0b219f7c5b 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -1149,7 +1149,8 @@ regenerate_master_menu (DOCUMENT *document, int
use_sections)
else
return 0;
- master_menu = new_master_menu (document->options, identifiers_target,
+ master_menu = new_master_menu (document->error_messages,
+ document->options, identifiers_target,
menus, use_sections);
/* no need for a master menu */
diff --git a/tp/t/do_master_menu.t b/tp/t/do_master_menu.t
index 5add63c8c2..bdc547cb79 100644
--- a/tp/t/do_master_menu.t
+++ b/tp/t/do_master_menu.t
@@ -126,11 +126,11 @@ my $no_detailmenu = _get_in('');
my $parser = Texinfo::Parser::parser();
my $document = $parser->parse_texi_piece($in_detailmenu);
Texinfo::Structuring::associate_internal_references($document);
-#Texinfo::Document::rebuild_document($document);
my $identifier_target = $document->labels_information();
my $top_node = $identifier_target->{'Top'};
# FIXME does not test XS
my $master_menu = Texinfo::Structuring::new_master_menu($parser,
+ $document->registrar(),
$identifier_target,
$top_node->{'extra'}->{'menus'});
my $out = Texinfo::Convert::Texinfo::convert_to_texinfo($master_menu);
@@ -173,11 +173,11 @@ is ($out, $reference, 'master menu');
$parser = Texinfo::Parser::parser();
$document = $parser->parse_texi_piece($no_detailmenu);
Texinfo::Structuring::associate_internal_references($document);
-#Texinfo::Document::rebuild_document($document);
$identifier_target = $document->labels_information();
$top_node = $identifier_target->{'Top'};
# FIXME does not test XS
$master_menu = Texinfo::Structuring::new_master_menu($parser,
+ $document->registrar(),
$identifier_target,
$top_node->{'extra'}->{'menus'});
$out = Texinfo::Convert::Texinfo::convert_to_texinfo($master_menu);
diff --git a/tp/t/info_tests.t b/tp/t/info_tests.t
index 6c52b3a069..77902936ee 100644
--- a/tp/t/info_tests.t
+++ b/tp/t/info_tests.t
@@ -989,6 +989,18 @@ Some text.
@printindex cp
'],
+['recursive_down_menu',
+'@node Top
+@top top
+
+@node chapN
+@chapter Intro
+
+@menu
+* chapN::
+@end menu
+', {'test_formats' => ['html']},
+ {'FORMAT_MENU' => 'menu'}],
);
my @file_tests = (
diff --git a/tp/t/results/info_tests/recursive_down_menu.pl
b/tp/t/results/info_tests/recursive_down_menu.pl
new file mode 100644
index 0000000000..4274f825e2
--- /dev/null
+++ b/tp/t/results/info_tests/recursive_down_menu.pl
@@ -0,0 +1,519 @@
+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{'recursive_down_menu'} = {
+ 'contents' => [
+ {
+ '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' => 1
+ }
+ },
+ {
+ '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' => 2
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'chapN'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'chapN'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Intro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'menu',
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '* ',
+ 'type' => 'menu_entry_leading_text'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'chapN'
+ }
+ ],
+ 'extra' => {
+ 'node_content' => {
+ 'contents' => [
+ {}
+ ]
+ },
+ 'normalized' => 'chapN'
+ },
+ 'type' => 'menu_entry_node'
+ },
+ {
+ 'text' => '::',
+ 'type' => 'menu_entry_separator'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'type' => 'preformatted'
+ }
+ ],
+ 'type' => 'menu_entry_description'
+ }
+ ],
+ 'source_info' => {
+ 'line_nr' => 8
+ },
+ 'type' => 'menu_entry'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'menu'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'menu'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 9
+ }
+ }
+ ],
+ 'source_info' => {
+ 'line_nr' => 7
+ }
+ }
+ ],
+ 'extra' => {
+ 'section_number' => '1'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 5
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'recursive_down_menu'}{'contents'}[4]{'contents'}[1]{'contents'}[0]{'contents'}[1]{'extra'}{'node_content'}{'contents'}[0]
=
$result_trees{'recursive_down_menu'}{'contents'}[4]{'contents'}[1]{'contents'}[0]{'contents'}[1]{'contents'}[0];
+
+$result_texis{'recursive_down_menu'} = '@node Top
+@top top
+
+@node chapN
+@chapter Intro
+
+@menu
+* chapN::
+@end menu
+';
+
+
+$result_texts{'recursive_down_menu'} = 'top
+***
+
+1 Intro
+*******
+
+* chapN::
+';
+
+$result_sectioning{'recursive_down_menu'} = {
+ 'extra' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'chapN'
+ }
+ },
+ '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{'recursive_down_menu'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'section_directions'}{'up'}
= $result_sectioning{'recursive_down_menu'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'recursive_down_menu'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'prev'}
= $result_sectioning{'recursive_down_menu'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'recursive_down_menu'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'up'}
= $result_sectioning{'recursive_down_menu'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'recursive_down_menu'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
= $result_sectioning{'recursive_down_menu'};
+
+$result_nodes{'recursive_down_menu'} = [
+ {
+ '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' => 'chapN'
+ }
+ }
+ },
+ 'normalized' => 'Top'
+ }
+ },
+ {}
+];
+$result_nodes{'recursive_down_menu'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
= $result_nodes{'recursive_down_menu'}[0];
+$result_nodes{'recursive_down_menu'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
= $result_nodes{'recursive_down_menu'}[0];
+$result_nodes{'recursive_down_menu'}[1] =
$result_nodes{'recursive_down_menu'}[0]{'extra'}{'node_directions'}{'next'};
+
+$result_menus{'recursive_down_menu'} = [
+ {
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ {
+ 'extra' => {
+ 'menu_directions' => {
+ 'up' => {}
+ },
+ 'menus' => [
+ {}
+ ],
+ 'normalized' => 'chapN'
+ }
+ }
+];
+$result_menus{'recursive_down_menu'}[1]{'extra'}{'menu_directions'}{'up'} =
$result_menus{'recursive_down_menu'}[1];
+
+$result_errors{'recursive_down_menu'} = [
+ {
+ 'error_line' => 'warning: node up pointer for `chapN\' is `Top\' but up is
`chapN\' in menu
+',
+ 'line_nr' => 4,
+ 'text' => 'node up pointer for `chapN\' is `Top\' but up is `chapN\' in
menu',
+ 'type' => 'warning'
+ }
+];
+
+
+$result_floats{'recursive_down_menu'} = {};
+
+
+
+$result_converted{'html'}->{'recursive_down_menu'} = '<!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</title>
+
+<meta name="description" content="top">
+<meta name="keywords" content="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">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+pre.menu-comment-preformatted {font-family: serif}
+span:hover a.copiable-link {visibility: visible}
+td.menu-entry-description {vertical-align: top}
+td.menu-entry-destination {vertical-align: top}
+th.menu-comment {text-align:left}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a href="#chapN" accesskey="n" rel="next">Intro</a> </p>
+</div>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<table class="menu" border="0" cellspacing="0">
+<tr><td class="menu-entry-destination">• <a href="#chapN"
accesskey="1">chapN</a>:</td><td> </td><td
class="menu-entry-description">
+</td></tr>
+<tr><th class="menu-comment" colspan="3"><pre
class="menu-comment-preformatted">
+
+</pre></th></tr><tr><th class="menu-comment" colspan="3"><pre
class="menu-comment-preformatted"> — The Detailed Node Listing —
+
+Intro
+
+</pre></th></tr><tr><td class="menu-entry-destination">• <a href="#chapN"
accesskey="2">chapN</a>:</td><td> </td><td
class="menu-entry-description">
+</td></tr>
+</table>
+<hr>
+<div class="chapter-level-extent" id="chapN">
+<div class="nav-panel">
+<p>
+Previous: <a href="#Top" accesskey="p" rel="prev">top</a>, Up: <a href="#Top"
accesskey="u" rel="up">top</a> </p>
+</div>
+<h2 class="chapter" id="Intro"><span>1 Intro<a class="copiable-link"
href="#Intro"> ¶</a></span></h2>
+
+<table class="menu" border="0" cellspacing="0">
+<tr><td class="menu-entry-destination">• <a href="#chapN"
accesskey="1">chapN</a>:</td><td> </td><td
class="menu-entry-description">
+</td></tr>
+</table>
+</div>
+</div>
+
+
+
+</body>
+</html>
+';
+
+$result_converted_errors{'html'}->{'recursive_down_menu'} = [
+ {
+ 'error_line' => 'warning: node `chapN\' appears in its own menus
+',
+ 'line_nr' => 4,
+ 'text' => 'node `chapN\' appears in its own menus',
+ 'type' => 'warning'
+ }
+];
+
+
+
+$result_converted{'info'}->{'recursive_down_menu'} = 'This is , produced from .
+
+
+File: , Node: Top, Next: chapN, Up: (dir)
+
+top
+***
+
+* Menu:
+
+* chapN::
+
+ -- The Detailed Node Listing --
+
+Intro
+
+* chapN::
+
+
+File: , Node: chapN, Prev: Top, Up: Top
+
+1 Intro
+*******
+
+* Menu:
+
+* chapN::
+
+
+Tag Table:
+Node: Top27
+Node: chapN156
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
+';
+
+$result_converted_errors{'info'}->{'recursive_down_menu'} = [
+ {
+ 'error_line' => 'warning: node `chapN\' appears in its own menus
+',
+ 'line_nr' => 4,
+ 'text' => 'node `chapN\' appears in its own menus',
+ 'type' => 'warning'
+ }
+];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Fix master menu generation with node in its own menus,
Patrice Dumas <=