Rapporter/rapport

nested rapport calls: increment header level

Closed this issue · 1 comments

I've just pushed a live demo of multiple levels of nested rapports in aL3xa/rapport@c675b18.

There I made up a 3-level templates in templates structure as follows:

  • multivar-descriptive.tpl calls univar-descriptive.tpl
  • univar-descriptive.tpl calls nortest.tpl

It runs fine thanks to modifications done in rapport lately and later, but there are something to tweak :)

Just run an example from multivar-descriptive, eg.:

rapport.html('multivar-descriptive', data=mtcars, vars=c('hp','wt'))

Sorry for not using ius2008 but here I need more then one numeric variable.

The problem in the output is that nested rapport classes retain the header level, which is not the best solution as is screws up the structure of the document IMHO.

Feature request: add an optional parameter to rapport to be able to "lag" header levels by given value. Eg. that way we could call rapport in templates (as nested template) with added parameter, like:

<!--head
....
head-->

## Title

rapport('template', inputs, header.lag=1)

If you are ready with modifying template.R, I am open to implement this quite easily, just ping me.

In that last commit (which was intended to close this issue) I have updated univar-descriptives.tpl for demonstration purposes. What is strange, that I have added nested.levels.offset=2, but the default value (=1 in rapport) is used instead.

As I do not understand why, it should be investigated -> reopening now, not to forget.