How to find if a section is set to transparent?

I’m trying to create a section template that shows a summary of its pages and its subsections’.

Suppose I have the following structure:

section 1
  page 1.1
  ...
  page 1.5
  section 1.1 [transparent]
    page 1.1.1
    ...
    page 1.1.10
  section 1.2
    page 1.2.1
    ...
    page 1.2.5

Observe that in this example section 1.1 is marked as transparent, and the others are not.

Let’s suppose I wanted to display only 3 pages from each section in my summary. From the “transparent” configuration documentation, I’m assuming that all the pages from section 1.1 now belong to section 1.

What I wanted was to get something like:

Section 1

  • Page 1.1
  • Page 1.1.1
  • Page 1.2

Section 1.2

  • Page 1.2.1
  • Page 1.2.2
  • Page 1.2.3

Keep in mind that the order in which the pages of section 1.1 appear or whether they appear at all is not important right now. The problem I’m facing is that I have no way of determining that section 1.1 is set to be transparent, because it seems that this information is not passed to the macros in the section objects. Even though I skip “childless” sections, what ends up happening is something along the ways of:

Section 1

  • Page 1.1
  • Page 1.1.1
  • Page 1.2

Section 1.1

  • Page 1.1.1
  • Page 1.1.2
  • Page 1.1.3

Section 1.2

  • Page 1.2.1
  • Page 1.2.2
  • Page 1.2.3

Notice that the subsection’s pages are duplicated because section 1.1 is still getting rendered.

So, it seems that when you ask for a section’s pages, you still get them even if it is set as transparent, which makes sense so you can list only its pages on the section page. But the downside is that I have no way of knowing that I already outputted them previously…

Is there any way of getting the behavior I’m expecting without me needing to ask the developers to include this info among the section object’s variables?

Thank you.

My current workaround is to repeat the transparent config inside of the [extra]… It works, but it is not nice having to duplicate info…

We could expose that directly on the section

Ok. If that is something that really makes sense for the project.

I’ll see if there is already some feature request in the GitHub, and if not I’ll add it.

Thank you.

The feature request was this one.

It’s added in the next branch

1 Like