Help:LabeledSectionTransclusion

From Apache OpenOffice Wiki
Jump to: navigation, search

See: Extension:Labeled_Section_Transclusion

This extension allows selective transclusion of marked-off sections of text.

How it works

Step 1: Mark off sections

Mark off sections in the text using <section> tags like this:

<section begin=chapter1 />this is a chapter<section end=chapter1 />

Note that this uses two individual markers, rather than normal XML open/close tags, which simplifies nested or overlapping sections. This allows you to insert section tags without worrying about interfering with other sections.

Step 2a: Transclude the section

Call the parser function #lst to transclude it, i.e. to transclude a section called chapter1 from a page called articleX:

 {{#lst:articleX|chapter1}}

The target article defines the location of the section; its behavior is determined by the parser function.

Step 2b: Transclude the page but excluding the section

To transclude a page, but exclude a specified section, use the #lstx function:

{{#lstx:articleX|chapter1}}

Optionally, you may add replacement text to the excluded section.

{{#lstx:articleX|chapter1|replacement_text}}

Example:

{{#lstx:articleX|chapter1|See chapter 1 in [[articleX]].}}

The replacement text will appear in the area where the section is skipped (excluded).

Personal tools