texi2html-bug
[Top][All Lists]
Advanced

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

Re: [Texi2html-bug] Some more questions about texi2html


From: Reinhold Kainhofer
Subject: Re: [Texi2html-bug] Some more questions about texi2html
Date: Wed, 19 Mar 2008 19:53:29 +0100
User-agent: KMail/1.9.6

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Mittwoch, 19. März 2008 schrieb Patrice Dumas:
> > However, where I'm currently failing is in traversing the element tree.
> > From book.init I see how to get the top node (and the full path of the
> > current element), but how can I traverse the tree then? It seems that the
> > Top node has only "forward", but not "FastForward" set, the first real
> > chapter has 'next' set, the first section uses entirely different keys,
> > and there is no key  of immediate children in all cases...
>
> Uhm, this should be much simpler... If you only follow sections (and not
> nodes). There is no iterator, but there is 'sectionup', 'sectionnext',
> and @'section_childs'.

Okay, sectionnext seems to work, thanks for the hint. However, the problems 
are now:

1) If I start with the top node, it doesn't have any useful keys set, except 
NodeNext, which appears to point to the first section, fine. Unfortunately, 
that node for the very first node does not have any @'section_childs' set 
(since apparently it comes from a @node and not a @chapter)...
My code to obtain the top node is:
    # Get the top node:
    while ( defined($current_element->{'sectionup'}) and
                 ($current_element->{'sectionup'} ne $current_element))
    {
        $current_element = $current_element->{'sectionup'};
    }
    # Now loop through all top-level chapters, unfortunately, the top
    # node does not have a section_childs key, so I have to use NodeNext
    $current_element = $current_element->{'NodeNext'};
    while (defined($current_element)) {
        push (@toc_entries, generate_ly_toc_entries($current_element, ...));
        $current_element = $current_element->{'sectionnext'};
    }

The first chapter (the one obtained with NodeNext) does not have any 
section_childs and also does not describe the chapter, but the @node before 
it... All following chapters have section_childs and work just fine. See e.g.
http://kainhofer.com/~lilypond/texi2html-out/Divisi-lyrics.html

2) The indices seem to be split up into multiple chapters, cluttering the TOC 
with lots of entries at the end, which I don't want printed at all (and which 
are not printed in texi2html's TOC). Apparently, these index pages are 
included with sectionnext...

Cheers,
Reinhold
- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH4WEtTqjEwhXvPN0RAog9AKC9c3O2cNfAsZxE3pI9hamhinq2DgCgyTHY
jEtKlU2bpEx0AbRq3aNQfmc=
=DoVR
-----END PGP SIGNATURE-----




reply via email to

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