Heading problem
Have tens of topics. In the every topics are usual headings, everytime started from the level1 - like:
Heading 1
heading 2
etc.
Now, need make one BigTopic with %TOC%, for printing and/or for OpenOffice Export like:
%INCLUDE{"TopicA"}%
%INCLUDE{"TopicB"}%
%INCLUDE{"TopicB"}%
- With the simple include I will get result like bellow in "standard" TAB.
- But, I want achieve something like in "wanted" TAB.
Standard
As you can see, every topic is starting with heading level1. It is OK, when displaying topic alone, but not soo good when want make an BigTopic like a book with includes.
Contents
Admininstration
Admin tasks
Configure
Configure examples
Setting up new user
Caveats
Userguide
Welcome
Wanted
This is the book, what i want get from my topics. Book format, and TOC with nested topics, need change the headings level at the moment of include. Now scroll down bellow.
Contents
Admininstration
Admin tasks
Configure
Configure examples
Setting up new user
Caveats
Userguide
Welcome
Ofc, i dont want re-edit every topic to achieve correct heading nesting. About the nesting want decide when making a BigTopic. Therefore, I make one small Plugin what i can use in form
%STARTHSHIFT{0}% %INCLUDE{"TopicA"}% %ENDHSHIFT%
%STARTHSHIFT{2}% %INCLUDE{"TopicB"}% %ENDHSHIFT%
%STARTHSHIFT{2}% %INCLUDE{"TopicC"}% %ENDHSHIFT%
%STARTHSHIFT{0}% %INCLUDE{"TopicD"}% %ENDHSHIFT%
The argument tell how many levels need shift. (0-do nothing, 1-will increase the number of '+' by one, so transform ---+ to ---++ and so on...)
Its working somewhat, but using commonTagsHandler (what should be avoidable) and Foswiki::Func::expandCommonVariables, so break some things.
- What is the solution?
- Is possible achieve this with the current foswiki? (without need of re-edit every topic)
- if need a plugin, how to avoid using commonTagsHandler (START-STOP thing?)
--
JozefMojzis - 30 Nov 2011
you mean like the
level="1" Override the root heading level to the specified number functionality (seemingly for perl doc only) described on
VarINCLUDE ?
i seriously thought we'd implemented this years ago.
its needed anywhere that we have transclusion going on - INCLUDE, SEARCH, FORMAT, TMPL?
see
http://twiki.org/cgi-bin/view/Codev/AllowIncludeOrSearchToChangeHeaderLevels (so make/update a feature req at
AllowIncludeOrSearchToChangeHeaderLevels? please.
It'd be nice if this code could be done without re-re-regexing but that may require the TOM dream :/
additionally, it would be even better if we can use that opportunity to normalise - if an output has h2's but no h1's, then move them all up - that kind of thing.
--
SvenDowideit - 01 Dec 2011
This topic: Sandbox
> JomoFeatureRequest
Topic revision:
01 Dec 2011, SvenDowideit
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. 
