Википедија:Документирање на предлошкиПредлошките (порано наречени „предлошки“) се многу моќна алатка на МедијаВики, но во исто време збунувачки за новите корисници, па дури и поискусните корисници со потешкотии го разбираат значењето на посложените предлошки. Предлошките треба да бидат проследени со соодветна документација за да се објасни и зголеми нивната употреба. Документацијата треба да објасни зошто служи и како се користи предлошката. Треба да биде едноставна за да може и корисниците без некои пошироки познавања на синтаксата на предлошката, во кои спаѓаат и многу искусни уредувачи кои своето внимание го имаат фокусирано на друго место, да може правилно и успешно да го користат. Ова посебно е важно за предлошките кои се користат многу често. Што да се вклучи во документацијатаДокументацијата треба да го опфати следново:
Template documentation is often placed in a subpage of the template itself, which is then transcluded at the end of the template page. This separates the often complex template code from the documentation, making the documentation easier to edit. It also allows templates to be protected where necessary, while allowing anyone to edit the documentation. This method is sometimes referred to as the "template doc page pattern". Documentation of any sort on a template page should always be enclosed by <noinclude>...</noinclude> tags, so that it does not show up when the template is used on another page. Text on the template page itself adds to the amount of text which must be processed when displaying the template, which is limited for performance reasons. Placing the documentation in a subpage avoids this (MediaWiki developers have recommended it for this reason). Како да создадете потстраница на документацијатаDocumentation subpages should be named and formatted using the following general pattern, for consistency. Suppose your template is named Template:X. Create a subpage with the name Template:X/doc. Use the following wikitext as a start for the documentation:
The top line will display one of two templates – at the top of the documentation; this makes it clear to the reader that what followes is documentation, and provides a link to edit the /doc subpage. Insert the documentation, categories and interwikis as below the appropriate comment lines – leaving the comments in place so that the layout is preserved when the page is edited in future. Save the subpage, and return to the template itself, Template:X in this example. Edit the template and append the following at the end of the template code:
Важно: Make sure the opening <noinclude> begins on the same line as the last character of the template code (or text), and not on a new line. Otherwise, extra space will be inserted below the template when it is used, which is usually not wanted. If the template is already protected, ask an administrator to do this, or request an edit by using {{editprotected}} on the template's talk page. If documentation, categories and interwiki links already exist in a section enclosed with <nowiki> tags, move them into the documentation subpage, as it is best not to have documentation split across two separate pages. ПримерSee the heavily-used Template:Наведена мрежна страница for an example of detailed template documentation. Note that the template itself is protected, but the documentation subpage, Template:Наведена мрежна страница/doc is unprotected and can still be edited. Поврзано |
Portal di Ensiklopedia Dunia