bug-texinfo
[Top][All Lists]
Advanced

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

Re: modernizing html output


From: Gavin Smith
Subject: Re: modernizing html output
Date: Wed, 30 Jan 2019 07:38:44 +0000

On 1/2/19, Per Bothner <address@hidden> wrote:
>>> I suggest two categories of <div> elements:
>>> A "node" includes all the content of a single node,
>>> but *not* sub-nodes.leaves unanswered
>>> A "chapter" or "section" (or "part" or whatever) <div>
>>> encloses the current node - and sub-nodes.
>>
>> This is not what your patch implemented, though.  The "node" <div> only
>> surrounds the navigation bar.  The "chapter" <div> doesn't start until
>> after the navigation bar, and does not enclose sub-ordinate sections.
>> See test file and output.
>
> Indeed you're right. It wasn't as obvious when I looked at multi-page
> output.
>
> Not sure how to do better, but I believe the DocBook output generates the
> correctly nested elements, so it is presumably feasible.
>
> I'll take a look, but if you have a suggestion that would be great.

Looking at DocBook.pm, the opening tag for a section is output when
the section is first seen, and closing tags may be output at the end
of a section for that section and containing sections. The condition
is that the section should not have subordinate sections. Sections are
closed up to the level when more sections follow on the same level.
The code is right at the end of "_convert":

    if (!($root->{'section_childs'} and scalar(@{$root->{'section_childs'}}))
        or $command_texi eq 'top') {
      $result .= "</$command>\n";
      my $current = $root;
      while ($current->{'section_up'}
             # the most up element is a virtual sectioning root element, this
             # condition avoids getting into it
             and $current->{'section_up'}->{'cmdname'}
             and !$current->{'section_next'}
             and $self->_level_corrected_section($current->{'section_up'}) ne
>'top') {
        $current = $current->{'section_up'};
        $result .= '</'.$self->_docbook_section_element($current) .">\n";
      }
    }



reply via email to

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