2853 |
my @texinfo_htmlxref_files = locate_init_file ($texinfo_htmlxref, 1, \@texinfo_config_dirs); |
my @texinfo_htmlxref_files = locate_init_file ($texinfo_htmlxref, 1, \@texinfo_config_dirs); |
2854 |
foreach my $file (@texinfo_htmlxref_files) |
foreach my $file (@texinfo_htmlxref_files) |
2855 |
{ |
{ |
2856 |
|
print STDERR "html refs config file: $file\n" if ($T2H_DEBUG); |
2857 |
open (HTMLXREF, $file); |
open (HTMLXREF, $file); |
2858 |
while (<HTMLXREF>) |
while (<HTMLXREF>) |
2859 |
{ |
{ |
4350 |
# or $novalidate); |
# or $novalidate); |
4351 |
} |
} |
4352 |
#$node_menu_ref->{'menu_node'} = 1; |
#$node_menu_ref->{'menu_node'} = 1; |
4353 |
|
return if ($state->{'detailmenu'}); |
4354 |
if ($state->{'node_ref'}) |
if ($state->{'node_ref'}) |
4355 |
{ |
{ |
4356 |
$node_menu_ref->{'menu_up'} = $state->{'node_ref'}; |
$node_menu_ref->{'menu_up'} = $state->{'node_ref'}; |
4361 |
echo_warn ("menu entry without previous node: $node", $line_nr) unless ($node =~ /\(.+\)/); |
echo_warn ("menu entry without previous node: $node", $line_nr) unless ($node =~ /\(.+\)/); |
4362 |
#warn "$WARN menu entry without previous node: $node\n" unless ($node =~ /\(.+\)/); |
#warn "$WARN menu entry without previous node: $node\n" unless ($node =~ /\(.+\)/); |
4363 |
} |
} |
|
return if ($state->{'detailmenu'}); |
|
4364 |
if ($state->{'prev_menu_node'}) |
if ($state->{'prev_menu_node'}) |
4365 |
{ |
{ |
4366 |
$node_menu_ref->{'menu_prev'} = $state->{'prev_menu_node'}; |
$node_menu_ref->{'menu_prev'} = $state->{'prev_menu_node'}; |
4493 |
my $prev_section = $previous_sections[$section->{'level'}]; |
my $prev_section = $previous_sections[$section->{'level'}]; |
4494 |
$section->{'section_prev'} = $prev_section; |
$section->{'section_prev'} = $prev_section; |
4495 |
$prev_section->{'next'} = $section; |
$prev_section->{'next'} = $section; |
4496 |
|
#FIXME section_next is not used while element->{'next'} is |
4497 |
|
# And there is also element_next... |
4498 |
|
# Moreover element->{'next'} may not be rightly selected when there |
4499 |
|
# are lone nodes after sections, athough this may be what we want. |
4500 |
|
# 'section_prev' is used however, while 'prev' for section is |
4501 |
|
# never used. Should be clened somehow. |
4502 |
|
#$prev_section->{'section_next'} = $section; |
4503 |
$prev_section->{'element_next'} = $section; |
$prev_section->{'element_next'} = $section; |
4504 |
} |
} |
4505 |
# find the up section |
# find the up section |
4624 |
{ # special case for the top node if it isn't associated with |
{ # special case for the top node if it isn't associated with |
4625 |
# a section. The top node element is inserted between the |
# a section. The top node element is inserted between the |
4626 |
# $section_before_top and the $section_after_top |
# $section_before_top and the $section_after_top |
4627 |
|
print STDERR "# Top not associated with a section\n" if ($T2H_DEBUG & $DEBUG_ELEMENTS); |
4628 |
$node_top->{'as_section'} = 1; |
$node_top->{'as_section'} = 1; |
4629 |
$node_top->{'section_ref'} = $node_top; |
$node_top->{'section_ref'} = $node_top; |
4630 |
my @old_element_lists = @elements_list; |
my @old_element_lists = @elements_list; |
4755 |
elsif ($node->{'automatic_directions'} and $node->{'section_ref'} and defined($node->{'section_ref'}->{'up'})) |
elsif ($node->{'automatic_directions'} and $node->{'section_ref'} and defined($node->{'section_ref'}->{'up'})) |
4756 |
{ |
{ |
4757 |
$node->{'up'} = get_node($node->{'section_ref'}->{'up'}); |
$node->{'up'} = get_node($node->{'section_ref'}->{'up'}); |
4758 |
|
print STDERR "# Deducing from section node_up $node->{'up'}->{'texi'} for $node->{'texi'}\n" if ($T2H_DEBUG & $DEBUG_ELEMENTS); |
4759 |
} |
} |
4760 |
elsif ($node->{'menu_up'}) |
elsif ($node->{'menu_up'}) |
4761 |
{ |
{ |
4762 |
$node->{'up'} = $node->{'menu_up'}; |
$node->{'up'} = $node->{'menu_up'}; |
4763 |
|
print STDERR "# Deducing from menu node_up $node->{'menu_up'}->{'texi'} for $node->{'texi'}\n" if ($T2H_DEBUG & $DEBUG_ELEMENTS); |
4764 |
} |
} |
4765 |
|
|
4766 |
if ($node->{'up'} and !$node->{'up'}->{'external_node'}) |
if ($node->{'up'} and !$node->{'up'}->{'external_node'}) |
4901 |
print STDERR "# element first: $element_first->{'texi'}\n" if ($T2H_DEBUG & $DEBUG_ELEMENTS); |
print STDERR "# element first: $element_first->{'texi'}\n" if ($T2H_DEBUG & $DEBUG_ELEMENTS); |
4902 |
print STDERR "# top node: $node_top->{'texi'}\n" if (defined($node_top) and |
print STDERR "# top node: $node_top->{'texi'}\n" if (defined($node_top) and |
4903 |
($T2H_DEBUG & $DEBUG_ELEMENTS)); |
($T2H_DEBUG & $DEBUG_ELEMENTS)); |
4904 |
# If there is no @top section no top node the first node is the top element |
# element top is the element with @top. |
4905 |
|
# If the top node is associated with a section it is the top_element |
4906 |
|
#$element_top = $node_top->{'with_section'} if ((!defined($element_top)) and $node_top->{'with_section'}); |
4907 |
|
# otherwise element top may be the top node |
4908 |
$element_top = $node_top if (!defined($element_top) and defined($node_top)); |
$element_top = $node_top if (!defined($element_top) and defined($node_top)); |
4909 |
|
# If there is no @top section no top node the first node is the top element |
4910 |
$element_top = $element_first unless (defined($element_top)); |
$element_top = $element_first unless (defined($element_top)); |
4911 |
$element_top->{'top'} = 1 if ($element_top->{'node'}); |
$element_top->{'top'} = 1 if ($element_top->{'node'}); |
4912 |
$element_last = $elements_list[-1]; |
$element_last = $elements_list[-1]; |
4918 |
foreach my $element (@elements_list) |
foreach my $element (@elements_list) |
4919 |
{ |
{ |
4920 |
# complete the up for toplevel elements |
# complete the up for toplevel elements |
4921 |
|
print STDERR "# fwd and back for $element->{'texi'}\n" if ($T2H_DEBUG & |
4922 |
|
$DEBUG_ELEMENTS); |
4923 |
if ($element->{'toplevel'} and !defined($element->{'up'}) and $element ne $element_top) |
if ($element->{'toplevel'} and !defined($element->{'up'}) and $element ne $element_top) |
4924 |
{ |
{ |
4925 |
$element->{'up'} = $element_top; |
$element->{'up'} = $element_top; |
4978 |
my $up = $element; |
my $up = $element; |
4979 |
while ($up->{'up'} and !$element->{'following'}) |
while ($up->{'up'} and !$element->{'following'}) |
4980 |
{ |
{ |
4981 |
|
print STDERR "# Going up, searching next section from $up->{'texi'}\n" if ($T2H_DEBUG & $DEBUG_ELEMENTS); |
4982 |
$up = $up->{'up'}; |
$up = $up->{'up'}; |
4983 |
if ($up->{'next_section'}) |
if ($up->{'next'}) |
4984 |
{ |
{ |
4985 |
$element->{'following'} = get_node ($up->{'next_section'}); |
$element->{'following'} = get_node ($up->{'next'}); |
4986 |
} |
} |
4987 |
|
# avoid infinite loop if the top is up for itself |
4988 |
|
last if ($up->{'toplevel'} or $up->{'top'}); |
4989 |
} |
} |
4990 |
} |
} |
4991 |
} |
} |
5470 |
&$Texi2HTML::Config::element_file_name ($element, $is_top, $docu_name); |
&$Texi2HTML::Config::element_file_name ($element, $is_top, $docu_name); |
5471 |
} |
} |
5472 |
} |
} |
5473 |
|
print STDERR "# add_file $element->{'file'} for $element->{'texi'}\n" if ($T2H_DEBUG & $DEBUG_ELEMENTS); |
5474 |
add_file($element->{'file'}); |
add_file($element->{'file'}); |
5475 |
$prev_nr = $doc_nr; |
$prev_nr = $doc_nr; |
5476 |
foreach my $place(@{$element->{'place'}}) |
foreach my $place(@{$element->{'place'}}) |
5522 |
foreach my $file (keys(%files)) |
foreach my $file (keys(%files)) |
5523 |
{ |
{ |
5524 |
last unless ($T2H_DEBUG & $DEBUG_ELEMENTS); |
last unless ($T2H_DEBUG & $DEBUG_ELEMENTS); |
5525 |
print STDERR "$file: $files{$file}->{'counter'}\n"; |
print STDERR "$file: counter $files{$file}->{'counter'}\n"; |
5526 |
} |
} |
5527 |
foreach my $element ((@elements_list, $footnote_element)) |
foreach my $element ((@elements_list, $footnote_element)) |
5528 |
{ |
{ |
5529 |
last unless ($T2H_DEBUG & $DEBUG_ELEMENTS); |
last unless ($T2H_DEBUG & $DEBUG_ELEMENTS); |
5530 |
my $is_toplevel = 'not top'; |
my $is_toplevel = 'not toplevel'; |
5531 |
$is_toplevel = 'top' if ($element->{'toplevel'}); |
$is_toplevel = 'toplevel' if ($element->{'toplevel'}); |
5532 |
print STDERR "$element "; |
print STDERR "$element "; |
5533 |
if ($element->{'index_page'}) |
if ($element->{'index_page'}) |
5534 |
{ |
{ |