Module:Transcluder/doc

This module is a general-purpose transclusion engine, able to transclude any part of any page and with many options that normal transclusion doesn't provide.

Modules
The main entry point for modules is the  method.


 * — Get the wikitext of the requested page
 * — Get the wikitext of the lead section of the requested page
 * — Get the wikitext of the requested section, excluding subsections

The  method always respects and tags.

The module allows to exclude various elements from the transclusion:


 * — Exclude all references
 * — Exclude all categories
 * — Exclude all lists but the first
 * — Exclude all tables but the first and third
 * — Exclude all paragraphs but the first, second and third
 * — Exclude all files but the first, third, fourth and fifth
 * — Exclude the first file
 * — Exclude the second and third files
 * — Exclude the second, third and fourth files
 * — Exclude the first, third, fourth and fifth files
 * — Verbose syntax for advanced uses
 * — Full syntax

The output can be further modified with a few special options:


 * — Link the bold title or synonym near the start of the text
 * — Remove bold text
 * — Remove self links
 * — Remove behavior switches such as
 * — Prefix reference names with 'Title ' to avoid name conflicts when transcluding and rescue references defined outside the requested section to avoid undefined reference errors
 * — Include subsections

Options can be combined at will:


 * — Get only the first file and first three paragraphs of the lead section, link the initial bold text and remove self links

You can also get only one kind of element like so:


 * — Get only the files
 * — Get only the first list
 * — Get only the first and third table
 * — Get only the first, third, fourth and fifth paragraph

Finally, the templates can be excluded in various ways:


 * — Keep all templates except  and
 * — Remove all templates except  and
 * — Keep all block templates (templates that take their own line) except
 * — Remove all block templates (templates that take their own line) except
 * — Keep all inline templates (templates in the middle of text) except
 * — Remove all inline templates (templates in the middle of text) except

Besides the  method, the module exposes several other methods to get specific parts of the wikitext. This allows other modules to combine elements in more advanced ways.

Templates
The main entry point for templates is the  method. It's essentially a wrapper of the  method to make it usable for templates. See the documentation of the  method for more details and options.


 * — Transclude the requested page
 * — Transclude the lead section of the requested page
 * — Transclude the requested section, excluding subsections
 * — Transclude the requested section, including subsections
 * — Transclude the first file of the page
 * — Transclude the second table of the requested section
 * — Transclude only the paragraphs of the lead section and link the bold text

Tests

 * Module:Transclude/testcases