Module:Transcluder/doc/zh

{{#switch: {{languages|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.

模块
模块的主入口是 方法.


 * — 获取请求的页面（与正常的嵌入包含有完全相同的结果）
 * — 获取请求页面的序言章节
 * — 获取请求的章节或标签（包括所有子章节）

and tags are handled the usual way and there's also an optional second parameter to exclude various elements from the result:


 * — 排除所有文件
 * — 排除除第一个文件外的所有文件
 * — 排除除第二个文件外的所有文件
 * — Exclude all files except the first and second
 * — Exclude all files except the first, second and third
 * — Exclude all files except the first, third, fourth and fifth
 * — Exclude the second file
 * — Exclude the second and third files
 * — Exclude the first, third, fourth and fifth files
 * — Exclude all files except A.png
 * — Exclude A.png
 * — Exclude all files except A.png, B.jpg and C.gif
 * — Exclude A.png, B.jpg and C.gif
 * — Exclude all files except the first and third
 * — Exclude the first and third files
 * — Exclude A.png and B.jpg
 * — Exclude all files except PNG files (see Lua patterns)
 * — Exclude all PNG files

The very same syntax can be used to exclude many other elements:


 * — Exclude all subsections
 * — Exclude all subsections except 'History' and 'Causes'
 * — Exclude all lists except the first
 * — Exclude all tables except the one with id 'stats'
 * — Exclude all paragraphs except the first, second and third
 * — Exclude all references
 * — Exclude all categories
 * — Exclude infobox templates
 * — Exclude all parameters from all templates except the one named 'image'

Options can be combined at will. For example:


 * — Exclude all subsections, all files except the first, and all paragraphs except the first three

You can also get only some elements like so:


 * — Get only the files
 * — Get only the first list
 * — Get only the table with id 'stats'
 * — Get only the first, third, fourth and fifth paragraph
 * — Get only the infobox
 * — Get only the parameter called 'abstract' and remove all the references from it

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


 * — 不要跟从重定向
 * — Link the bold title or synonym near the start of the text
 * — 删除加粗文字
 * — Remove comments
 * — Remove all links
 * — 删除自我链接
 * — Remove non-free files (currently identified by having the words 'non-free' in their local description or at Commons)
 * — 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

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.

模板
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 or tag (includes any subsections)
 * — Transclude the requested section, excluding subsections
 * — Transclude only the first file of the page
 * — Transclude only the second table of the requested section
 * — Transclude only the paragraphs of the lead section and link the bold text

Synchronizer


參見

 * Module:Transcluder/testcases
 * c:Data:i18n/Module:Transcluder.tab

}}
 * #default=