Opened 9 years ago

Closed 8 years ago

# Decrease headline level for included pages

Reported by: Owned by: birne@… coderanger normal IncludeMacro normal headline smart hierarchy lei@… 0.11

### Description

First I would like to say, that I love this macro as I can now use meta wiki pages constructing a kind of "book" of selected content in my wiki.

There are only two things I am missing:

• Incomplete TOC as already described in Ticket #2306
• Decreasing the level of all headlines in included wiki pages

Example: MainArticle goes like

= User Guide =
[[Include(wiki:Installation, text/x-trac-wiki)]]
.. more Include follow here ..


and Installation contains:

= Prerequisites =
In order to install .. bla
== Database ==
bla bla


The the resulting should be

= User Guide =
== Prerequisites ==
In order to install .. bla
=== Database ===
bla bla


For best result, a decrease level counter should be passed down on each include. That would allow this feature to work properly even when an included page itself includes other pages (wich itself might again include other pages, ..). Of course a headline can not be below level 7 as this would break the HTML standards. I have no idea how to handle this in a smart way..

Thank you for your attention so far!

### comment:1 Changed 8 years ago by lei@…

• Cc lei@… added; anonymous removed
• Trac Release changed from 0.10 to 0.11

I created a patch for the decreasing of headlines, which is attached. The patch is based on [3615] of the IncludeMacro and works with Trac 0.11.

Feel free to provide feedback.

### comment:2 Changed 8 years ago by coderanger

• Resolution set to wontfix
• Status changed from new to closed

Because this macro uses the already modular mimeview API, I would recommend making this into a formatter of some form, so you can package it independently. As this is not generalized, it won't be included in the macro directly.

### comment:3 Changed 8 years ago by lei@…

Hi Coderanger, I am a newbee in python and Trac plugin programming. Thats why I don't get you :) However, it works for me and I am glad if somebody could use it, too.

PS: Just wanted to add something on the use. The new parameter order is as follows:

[[Include(<WikiPage>,<HeadlineLevelDecrease>,<Format>)]]


[[Include(CamelCase)]]
[[Include(CamelCase,1)]]