Posted by ErichSteinboeck on 21 Mar 2009 11:57, last edited by James Kanjo on 09 May 2010 05:50
As implemented, the [[include …]] tag allows to include a block of text as separate lines or paragraphs, but does not allow to include text “inline,” i. e. within a single line.
There have been quite some discussions if and how such an “inline include” could be done. Here is a workaround how to do it.
Step by Step
Create your included page with
- a leading comment ([!----]) and
- a trailing backslash (\)
[!----]included //inline// and **may** contain formatting\
Create your include statement with
- a trailing backslash (\) added to the text that goes before the inline include, and
- a leading comment ([!----]) before the text that goes after the inline include
Text can be \
[!----] tags as you like
|What you type …||What you get …|
Text can be \
|Text can be included inline and may contain formatting tags as you like|
How it Works
As an [[include …]] introduces two consecutive line breaks both before and after the include, a way to remove those two line breaks is:
- remove the first line break by appending a trailing backslash (“\”) to the line preceding the two line breaks, and
- remove the second line break by prepending a leading Wikidot comment ([!----]) to the line following the two line breaks (similar to how a trailing “\” removes the following line break, a leading comment will remove the previous line break).