Some things are quite difficult to realise in XWiki if things are to happen automatically, such as indenting paragraphs depending on the nesting depth of the headings.
In this case, it is possible to achieve these effects through rather brutal CSS not perfect instructions:
(Small insertion:
{{insertCSS}}
h2 {margin-left:0pt ! important}
h2 + *{margin-left:20pt !important}
h2 ~ *{margin-left:20pt}
h3 {margin-left:20pt !important}
h2 ~ h3{margin-left:20pt !important}
h2 ~ h3 + * {margin-left:40pt !important}
h2 ~ h3 ~ * {margin-left:40pt}
h2 ~ h3 ~ h4 {margin-left:40pt !important}
h2 ~ h3 ~ h4 + *{margin-left:60pt !important}
h2 ~ h3 ~ h4 ~ *{margin-left:60pt}
h5 {margin-left:60pt !important}
h2 ~ h3 ~ h4 ~ h5 + *{margin-left:80pt}
h2 ~ h3 ~ h4 ~ h5 ~ *{margin-left:80pt}
h6 {margin-left:80pt !important}
h2 ~ h3 ~ h4 ~ h5 ~ h6 + *{margin-left:100pt}
h2 ~ h3 ~ h4 ~ h5 ~ h6 ~ *{margin-left:100pt}
{{/insertCSS}}
with insertCSS by
{{groovy}}
xwiki.linkx.use("data:text/css,"+xwiki.context.macro.content, ['type': 'text/css', 'rel': 'stylesheet'])
""
{{/groovy}}
) but mostly one is forced to work with the help of macros that have to be entered and called at all places, at every heading, at every table, at every illustration, at every list, and so on.
From the author’s point of view, this is annoying, because one would actually like to have something like this automated: Do this or that at every heading, at every table.
I don’t think it’s desirable to tinker with the XWiki syntax, but what about the following idea:
Similar to how there are extension points for certain positions on a page, create extension points for “structures”. So to be able to say, call this macro given by me at the beginning of each heading line, at the beginning of each table, etc.
Of course, it would then need access to the content of the heading line, the table.
In my opinion, such an approach would drastically expand the possible uses of the XWiki.
Well, this is an idea, perhaps I am overlooking many problems.
Norbert