openSUSE / suse-xsl

DocBook XSL Stylesheets for SUSE branding
Other
11 stars 10 forks source link

Table of contents lacks sect1 sections if part of a preface #425

Closed cwickert closed 3 years ago

cwickert commented 3 years ago

Problem Description

In the context of the recent discussions about the preface "About this Guide", I stumbled across the following bug: Currently the table of contents in PDFs only lists <sec2>s inside <preface>s, not <sec1>. This is inconsistent with the structure and very confusing. One cannot understand the title of a section without the context of the section it's part of.

Screenshot of the Admin Guide:

As you can see, the outline on the right lists all sections inside of the preface, while the TOC only lists the <sec2>s.

The problem only affects preface. If you change it to <chapter>, everything is fine.

Expected Behaviour

TOC and outline should be consistent. All <sec1>s and <sec2>s should show up in the TOC. Basically the TOC part of the <preface> should look the same as for other <chapter>s

tomschr commented 3 years ago

This is clearly a bug. Thanks for the report, Christoph.

Actually when I've implemented it, my idea was to scrub all sections and subsections from preface. Only the preface title should appear in the TOC. Mostly for the following reasons:

I had something like this in my mind (see the following screenshot):

Screenshot_20210203_191905

tomschr commented 3 years ago

Here is another attempt to compare it with https://github.com/openSUSE/suse-xsl/issues/425#issuecomment-772720047 This time, with sect1/sect2 under the preface title.

Screenshot_20210204_163725