Ticket #2423 (closed enhancement: wontfix)

Opened 6 months ago

Last modified 2 months ago

Decrease headline level for included pages

Reported by: birne@007mail.de Assigned to: coderanger
Priority: normal Component: IncludeMacro
Severity: normal Keywords: headline smart hierarchy
Cc: lei@mms-dresden.de Trac Release: 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!

Attachments

macros.py (5.5 kB) - added by lei@mms-dresden.de on 05/14/08 06:15:28.
Headlines hierarchy patch
macros.diff (3.1 kB) - added by lei@mms-dresden.de on 05/14/08 06:17:39.
Headlines hierachy PATCH - I accidently added the macros.py file before

Change History

05/14/08 06:14:30 changed by lei@mms-dresden.de

  • cc set to lei@mms-dresden.de.
  • keywords changed from headline smart to headline smart hierarchy.
  • 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.

05/14/08 06:15:28 changed by lei@mms-dresden.de

  • attachment macros.py added.

Headlines hierarchy patch

05/14/08 06:17:39 changed by lei@mms-dresden.de

  • attachment macros.diff added.

Headlines hierachy PATCH - I accidently added the macros.py file before

05/14/08 06:20:13 changed by coderanger

  • status changed from new to closed.
  • resolution set to wontfix.

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.

05/14/08 06:25:52 changed by lei@mms-dresden.de

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>)]]

HeadlineLevelDecrease? defaults to 1. Examples:

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

Add/Change #2423 (Decrease headline level for included pages)




Change Properties
Action