| Parameter: | Description: | Default: |
|---|---|---|
headingoffset="2" |
Adjust the level of headings in the included topic. A "2" or "+2" increases the level by two, e.g. a ---+ H1 turns into a ---+++ H3. Positive and negative values are supported. Adjusted min and max levels are H1 and H6, respectively. |
no adjustment |
---+ Cars ---++ Sedans ---+++ BMW ---+++ Mercedes ---++ Trucks ---+++ Mack ---+++ VolvoNow, if you
%INCLUDE{ "SomeTopic" headingoffset="1" }% you get this result after the include:
---++ Cars ---+++ Sedans ---++++ BMW ---++++ Mercedes ---+++ Trucks ---++++ Mack ---++++ VolvoE.g. it changes H1 to H3, H2 to H4, etc. -- Contributors: PeterThoeny - 2010-06-22
---++ H2
%INCLUDE{PageBeginningAtH1,"header_level=3"}%
-- AndyGlew - 26 Oct 2004
Interesting idea. If we had ParameterizedIncludes you could do this:
---++ H2
%INCLUDE{"PageBeginningAtH1" hbase="+++"}%
and then in the page
---%hbase% A heading-- CrawfordCurrie - 26 Oct 2004 I asked the same question in Support.AdjustingHeadingsDuringInclude -- MartinCleaver - 26 Oct 2004 It's not clear from above if this is intended so I'll say it. The base should be reletive to the lowest non-hidden (from TOC) heading of the included topic. So if you include with a base of ---+++, it would skip a ---+!! heading, find the lowest (not necessarily first) non-hidden heading of ---++ and then increase all headings by 1. -- SamHasler - 26 Oct 2004 Dynamically showing sections depending on their header level was not meant, I think. Wouldn't NamedIncludeSections and hand-crafted including topics already address that need? AndyGlew addressed tho old problem, that topics have fixed header levels in them. If you want to re-use a topic in a bigger paper, the header levels can be right only for one view. So either your single page has odd tiny headings, or your big printed manual has a lousy table of contents, see TWikiForBookAuthoring or PrintUsingPDF. The proposed syntax of
INCLUDE{... hbase="+++"} looks good.
Not sure I would want to edit all included topics to switch to
---%hbase% A Variable Heading.
Why not simply let them as-is,
implicitely adding the hbase on the go?
So you write
---+ A Fixed Heading Level 1,
but within an
INCLUDE{... hbase="2"} it would turn into <h3>.
Recursive INCLUDES should add relative to the current shift level,
then the end of the INCLUDE would restore the previous shift level.
An absolute shift is easier to implement,
but would introduce the same problem again,
if you include including pages.
hshift
-- PeterKlausner - 29 Oct 2004
"Dynamically showing sections depending on their header level was not meant, I think."
It's not what I meant either.
By skip I meant for the purposes of determining relative heading levels, all the included content would still be included.
Now that I think about it, it's not a good idea. Headings that don't appear in the TOC are usually
The reason I think the base should be relative is so that you can change the depth of all the headings in the included topic to be one deeper/less deep without affecting their depth in the topic they are included into.
| Base to Include at | Headings in topic to include | Headings how they will appear once included |
|---|---|---|
| ---++ | ---+ ---++ ---+++ |
---++ ---+++ ---++++ |
| ---+++ | ---+ ---++ ---+++ |
---+++ ---++++ ---+++++ |
| ---+++ | ---++ ---+++ ---++++ |
---+++ ---++++ ---+++++ |
| ---+++ |
---+ %STARTINCLUDE% ---++ ---+++ |
---+++ ---++++ |
%INCLUDE{ "UsingAMainpage" level="-1" }%
-- PeterThoeny - 21 Feb 2005
rather than specifying a parameter for the inlcuded headings, why not just make them all relative to the location in the parent document they're being included into? So if they are included after a ---++ the included H1 becomes an H3?
-- MattWilkie - 21 Feb 2005
I think that the suggestion is better than the current behaviour. How about we introduce a flag and preference to disable the suggested new behaviour?
-- MartinCleaver - 13 May 2005
Which suggestion?
-- ArthurClemens - 13 May 2005
I recently brushedoff my LaTeX for some documents. One of the first things I did was create "dySection" commands to allow me to include other files and adjust the heading level.
-- AndyGlew - 24 Jun 2005
Is there anyone working on this? Or is there another means that this functionality has been implemented?
-- DanielHelsten - 05 Jun 2006
The direction I am headed towards is to include all of the wiki markup language, scan it, look for the highest heading level, and use that to adjust the heading level.
E.g.
| Level Including at | Headngs In Text | Effective Level |
| 2 ---++ | ---+, ---++ | ---+++, ---++++ |
| 2 ---++ | ----++ | ---+++ |
| Level Including at | Headngs In Text | Effective Level |
| 2 ---++ | ---+, ---++ | ---+++, ---++++ |
| 2 ---++ | ----++ | ---+++ |
---+++ and you are including text that is at level ---+? Should that become ---++++? What about if you include text that is at level ---++ and below. What should that become? My intuition says ---++++, but probably a good argument could be made for ---+++++ also.
Further, what should happen if text is included that is below a heading, but the %STARTINCLUDE% is after the heading? Does it get the level it has in the included topic or is it assumed to be outside all levels?
Depending how fancy this should be, we need something like the solution for NeedBeforeIncludeHandler.
-- ThomasWeigert - 13 Nov 2006
Auto-adjusting levels sounds useful. For compatibility I suggest to add an explicit flag, such as autoheadinglevels="on".
-- PeterThoeny - 13 Nov 2006
RE: ThomasWeigert - 13 Nov 2006 | destination-Topic | source-Topic | result |
|---|---|---|
| ---+++ | ---+ | ---++++ |
| ---+ | ---+++ | ---++ |
---+ inside a ---+++ will result in the same header level ---++++ as the other way around.
IMHO, the depth of INCLUDEs should not be taken under consideration when computing the resulting level, as these might happen quite arbitrary.
-- MichaelDaum - 29 Nov 2007
considering the numbe rof times i've come across a topic that has no h1 and h2 headers 'because they looked too big' I agree with what Michael is saying:
the header depths should be brought in as relative, not absolute, with the lowest level in the INCLUDEd section being either the same as the current level they are brought in to, or one smaller.
This is probably time for a diagram, but I think I'll goto sleep instead.
-- SvenDowideit - 29 Nov 2007
I agree that relative is more useful than absolute. I'd go so far to use an offset, e.g. a %INCLUDE{ "SomeTopic" headingoffset="+2" }% changes H1 to H3, H2 to H4, etc. (I just realize that was already suggested inSupport.IncludingTopicButLoweringHeadingLevel.)
-- PeterThoeny - 03 Dec 2007
fix for the previously documented implementation
| ChangeProposalForm | |
|---|---|
| TopicClassification | FeatureRequest |
| TopicSummary | Add a parameter to INCLUDE to indicate what heading level ---+ should correspond to |
| CurrentState | MergedToCore |
| CommittedDeveloper | PeterThoeny |
| ReasonForDecision | AcceptedBy7DayFeedbackPeriod |
| DateOfCommitment | 2010-06-22 |
| ConcernRaisedBy | |
| BugTracking |
TWikibug:Item6515 |
| OutstandingIssues | |
| RelatedTopics | RelativeHeadingLevelsforSEARCH |
| InterestedParties | DanielHelsten |
| ProposedFor | IstanbulRelease |
| TWikiContributors | |
| I | Attachment | History | Action | Size | Date | Who | Comment |
|---|---|---|---|---|---|---|---|
| |
simple-include-offset-headings-v0.2.diff | r1 | manage | 8.6 K | 2007-11-27 - 23:18 | UnknownUser | Simple include offset headings, v0.2 |
| |
simple-include-offset-headings-v0.3.diff.gz | r1 | manage | 2.6 K | 2008-01-29 - 14:39 | UnknownUser | Simple headings offset patch, v0.3 |
| |
simple-include-offset-headings.diff | r1 | manage | 7.0 K | 2007-11-27 - 15:51 | UnknownUser | Simple headings offset patch |