-
Распространяем знания без феминистской идеологии.Противодействие культуре насилия и идеологии ненависти.Эта wiki в процессе подготовки: Хочешь участвовать? Перейди по ссылке на наш сайт!
Шаблон:Doc
Этот шаблон[wp] показывает окно документации, как вы можете видеть прямо сейчас. Оно включает в себя текст подстраницы [[<Pagename>/doc]]
.
This template should be used for all templates. Этот шаблон следует использовать для всех шаблонов.
Причина
The separation of programming code and documentation makes the source code more readable and, more important, releases work from the parser: On each page view, the whole text of the template is freshly evaluated, again and again - including the documentation, which is at last left out anyway. In spite of this, <noinclude>
s are evaluated before the real includes, so you can drastically reduce the "Pre-expand include size", if you move the documentations into subpages. That's why the description always should be ausgelagert from the template proper. By this way, the use of more templates per article page is enabled.
Как использовать
This Template does not expect any parameters. It is sufficient if you put <noinclude>{{Documentation}}</noinclude>
at the end of a template and create the documentation page [[<Pagename>/doc]]
. A subpage named /meta
may contain the metadata for this template (please read the section Noteworthy about this), otherwise these can be put between the "noinclude"-tags at the end of the template. The metadata include the categories[wp] and interwiki links[wp]. After creating the documentation, advices for creating are provided (preload).
In the subpages, the following codelines ensure the reference
- /doc
<noinclude>{{Doc/docpage}}</noinclude>
- /meta
<noinclude>{{Doc/metapage}}</noinclude><includeonly> … Meta … </includeonly>
- /test
<noinclude>{{Doc/testpage}}</noinclude>
- /maintenance
<noinclude>{{Doc/maintenancepage}}</noinclude>
- /print
<noinclude>{{Doc/printversion}}</noinclude>
- /editnotice
<noinclude>{{Doc/editnoticepage}}</noinclude>
- /subpage
<noinclude>{{Doc/subpage}}</noinclude>
Noteworthy
If the template is located in the user namespace, the metadata won't be included, and neither the template nor the subpage are sorted into categories.
Subpages
/meta
- Such a subpage is most of all supposed to be for locked pages, which couldn't be interwiki-fied otherwise.
/XML
- If the template has an XML description (besides the documentation) for the Template master, an advice about this is shown.
/maintenance
- If there should be a maintenance page for the template, an advice is shown too.
/test
- An advice is also shown for test subpages.
/print
- A special version of the template, which is used together with the Book tool.
/editnotice
- A special advice, which is shown while editing.
Create subpages
If you activate the MediaWiki:Gadget-Personendaten in the preferences, you'll get it displayed on template pages with documentation links for the easier creation / editing of the subpages.
If you have questions about this Template[wp], you may ask the Template workshop[wp]. |
|