Don't chunk first section on parent site when it has children
| From: | Christian Weiske | Date: | Thu, 30 Oct 2008 05:52:07 +0000 |
| Subject: | Don't chunk first section on parent site when it has children | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969379582@lists.php.net to get a copy of this message | ||
Hello all,
In peardoc we're facing the problem described in bug #46415 [1].
PhD automatically puts the first section of a chapter on its parent's
(the chapter's) chunk:
<chapter>
<para>...</para>
<section>1</section>
<section>2</section>
<section>3</section>
</chapter>
Phd generated three pages for this scenario:
- one for the chapter, including the first section
- one for each of the other sections
This is great behavior for introductionary sections, but it completely
fails for sections that have subsections themselves. It leads to the
title of section 1 being on the chapter page, the TOC being malformed
(subsections of section 1 are on the same level as section 2 and 3).
So the chunker in PhDReader.class.php should decide to chunk the
section in isSectionChunk() if the section has subsections itself.
Unfortunately, PhD doesn't read ahead so we don't know if the current
section has subsections in advance. We *could* make PhDReader move
ahead to the next CHUNK_ME element or the section's closing tag and go
back to the opening section tag then. This could mean a performance
loss (though I didn't do any measurements).
Any ideas how we could do this differently?
[1] http://bugs.php.net/?id=46415
--
Regards/Mit freundlichen Grüßen
Christian Weiske
-= Geeking around in the name of science since 1982 =-
Attachment: [application/pgp-signature] signature.asc
Attachment: [application/pgp-signature] signature.asc