bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sectional table of contents in HTML output


From: Patrice Dumas
Subject: Re: Sectional table of contents in HTML output
Date: Thu, 23 Jan 2020 19:56:24 +0100

On Mon, Jan 20, 2020 at 02:12:16PM +0000, Gavin Smith wrote:
> On Sun, Nov 03, 2019 at 10:17:05AM +0100, Patrice Dumas wrote:
> > I attach an example that generates such a list right after the heading.
> > Something that looks strange is that the node names are used in the 
> > navigation header, while the sections names are used in the list of 
> > subordinate sections/nodes.
> 
> I'm trying to work on changing the navigation header, but finding it 
> hard to understand the code.  I think I need to make _element_direction 
> return the text of the section name rather than the text of the node 
> name.  (_element_direction is called from _default_node_direction.)  I 
> found there were directions "Up", "Next" and "Prev" corresponding to 
> "section_up", "section_next" and "section_prev" in Texinfo::Structuring, 
> but these appear to refer to the same elements as "node_up", etc.

It is probably normal, as, in the classical case, elements are associated 
both to a section and a node.  I think that it is a good thing that 
the href is the element href, independently of the name shown.  
Looking at Structuring.pm, it seems that the option to use sections as
element_command, however, is available with split_by_section.  Maybe you
could try to set USE_NODES to false.  I think that it won't be
enough, however, as in _default_node_direction the call to
_element_direction is explicitly set with 'node'.  So you may also need
to have the call like 

  my $node;
  if ($self->get_conf('USE_SECTION_IN_NAME')) {
    $node =  $self->_element_direction($self->{'current_element'},
                                           $direction);
  } else {
    $node = $self->_element_direction($self->{'current_element'},
                                           $direction, 'node');
  }

There is probably an alternate way.  If I recall well, I did the 
_default_node_direction function to be sure that node names are used in
any case.  Maybe simply changing 'SECTION_BUTTONS' to be

'SECTION_BUTTONS'      => ['Next', 'Prev', 'Up', ' ', 'Contents', 'Index']

could give you what you are looking for, providing USE_NODES is 
false.  Then you would also probably need something for the footer to
avoir the rel, maybe passing something to _default_button_formatting
though I couldn't see an easy way to do that if going through
'NODE_FOOTER_BUTTONS' and not in other cases.  But maybe it would make
sense to have format_navigation_header_panel/_default_navigation_header_panel
know whether the panel is a footer or a header in general.

I could also look at that later, but not soon, too much work...

-- 
Pat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]