Изменения

Перейти к: навигация, поиск

Справка:Функции парсера

71 байт добавлено, 16:41, 23 января 2010
м
Нет описания правки
The {{mediawiki|Extension:ParserFunctions|ParserFunctions}} extension provides ten additional parser functions to supplement the "[[HelpСправка:Magic words#Parser functionsКлючевые слова|magic words]]", which are already present in MediaWiki. All the parser functions provided by this extension take the form:
:<tt><nowiki>{{</nowiki> '''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... <nowiki>}}</nowiki></tt>
:<tt><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></tt> &rarr; the code '''<tt><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></tt>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.
{{warning|The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as [[HelpСправка:Magic words#VariablesКлючевые слова|variables]] or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]].}}
===Tables ===
Parser functions will mangle [[mediawikiwiki:Help:Tables|wikitable]] syntax, treating all the raw pipe characters as parameter divisors. To avoid this, most wikis create the template [[{{ns:10}}:!]] with its contents only a raw pipe character. This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded. Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.
{{admin tip|You can improve the reliability of HTML table code (and other raw HTML input) by using HTML tidy. See {{mediawiki|Manual:Build Tidy from source|Installing Tidy}} and {{mediawiki|Manual:$wgUseTidy|$wgUseTidy}}.}}
{{admin tip|You can also use the {{mediawiki|Extension:Pipe Escape|Pipe Escape}} extension to improve the handling of pipe characters.}}
==See also==
 *[[mediawikiwiki:Help:Parser functions in templates]]*{{Mediawiki|meta:Help:Newlines and spaces|Help:Newlines and spaces}}*{{Mediawiki|Help:Magic words}}* [[mediawikiwiki:Extension:StringFunctions]]
[[Category:Extension help|ParserFunctions]]

Навигация