Include Inline

Posted by ErichSteinboeck on 21 Mar 2009 11:57, last edited by GoVegan on 09 May 2010 05:50

: include inline

rating: +11

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

Step 1

Create your included page with

  1. a leading comment ([!----]) and
  2. a trailing backslash (\)

e. g.

[!----]included //inline// and **may** contain formatting\

Step 2

Create your include statement with

  1. a trailing backslash (\) added to the text that goes before the inline include, and
  2. a leading comment ([!----]) before the text that goes after the inline include

e. g.

Text can be \
[[include inc]]
[!----] tags as you like

Examples

What you type … What you get …

Text can be \
[[include inc]]
[!----] tags as you like

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:

  1. remove the first line break by appending a trailing backslash (“\”) to the line preceding the two line breaks, and
  2. 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).

Backlinks

Author

ErichSteinboeck ErichSteinboeck . Please visit his/her userPage.


Related articles

Comments

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.
Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).
Notify administrators if there is objectionable content in this page.
Something does not work as expected? Find out what you can do.
General Wikidot.com documentation and help section.
Wikidot.com Terms of Service - what you can, what you should not etc.
Wikidot.com Privacy Policy.

AltStyle によって変換されたページ (->オリジナル) /