الگو:Mlx (ویرایش|بحث|تاریخچه|پیوندها|پی‌گیری|سیاهه‌ها) is used to display a module name as a link surrounded by braces with the {{#invoke}} راهنما:کلمات جادویی, thus showing the module name as code rather than actually invoking it. Its primary use is in instruction and documentation where it is used to refer to a module by name without invoking it. It is also supports the definition of a function and parameters.

Examples ویرایش

Code Result Notes
{{Mlx|Example}} {{#invoke:Example|function}} Usage without function name. This does not produce a usable invocation.
{{Mlx|Example|hello}} {{#invoke:Example|hello}} Usage with a function name.
{{Mlx|Example|count_fruits|4=bananas=5|5=apples=10}} {{#invoke:Example|count_fruits|bananas=5|apples=10}} Usage with a function name and parameters.
{{Mlx|Example|count_fruits|bananas{{=}}5|apples{{=}}10}} {{#invoke:Example|count_fruits|bananas=5|apples=10}} Usage with a function name and parameters, using {{=}}.

TemplateData ویرایش

این، توضیحاتِ الگوداده است که توسط TemplateWizard، ویرایشگر دیداری و دیگر ابزارها استفاده می‌شود. گزارش خطای ماهیانه برای این الگو را ببینید.

الگوداده Mlx

This template displays a module name as a link surrounded by braces with the {{#invoke}} parser function, thus showing how the module name would be used in code. Its primary use is in instruction and documentation.

پارامترهای الگو

پارامترتوضیحاتنوعوضعیت
module name1

the module name without the namespace prefix “Module:”, which is added automatically

رشتهضروری
function name2

the function name within the module to call

رشتهضروری
parameter 13

the name (and value) of the first parameter, use {{=}} to add an equal sign

رشتهاختیاری
parameter 24

the name (and value) of the second parameter, use {{=}} to add an equal sign

رشتهاختیاری
parameter 35

the name (and value) of the third parameter, use {{=}} to add an equal sign

رشتهاختیاری

See also ویرایش

  • {{ml}} - Similar function but not surrounded in <code>...</code> tags.
  • {{tlx}} - A version of this template for templates instead of modules.

قالب‌بندی به‌کارگیری عمومی ویرایش

مقایسهٔ الگوهای پیونددهی به الگو مطابق با سبک متن و پیوند تولیدشده
سبک متن ↓ گزینه‌های {{الگوع}}[نکته ۱]
برای دستیابی به سبک متن
سبک پیوند
با پیوند بدون پیوند با پیوند و جانشانی با پیوند شامل براکت‌ها با پیوند و متن جایگزین
گزینه‌های {{الگوع}}[نکته ۱]
برای دستیابی به سبک پیوند
پیش‌فرض nolink=yes subst=yes braceinside=yes alttext=فلان
2=فلان
معمولی پیش‌فرض {{الگوع}}[نکته ۱]
{{الگو}}
{{الگوپ|۱|۲|...}}[نکته ۲]
{{الگو:الگوف}}[نکته ۳]
{{الگوخ}}[نکته ۲]
<پیوند الگو>
{{جا:الگوج}}
{{جا:الگو:الگوفج}}[نکته ۳]
{{الگون}} {{الگوم}}
کد code=yes {{الگو۲}}
{{الگوب}}
{{الگو:الگوفگ}}۳[نکته ۳]
{{الگوک}}[نکته ۲]
<پیوند الگو>
{{الگوخالی}}
<پیوند الگو>
{{جا:الگوگج}}
تک‌فاصله plaincode=yes[نکته ۴] {{جا:الگوعج}}[نکته ۵]
kbd kbd=yes[نکته ۵]
پررنگ bold=yes {{الگوپر}}
پررنگ+کد bold=yes|code=yes {{الگوگپ}}
کج+کد italic=yes|code=yes {{الگوگک}}
  1. ۱٫۰ ۱٫۱ ۱٫۲ {{الگوع}} عمومی‌ترین الگو است که امکان انتخاب گزینه‌هایی برای هرگونه ترکیب سبک متن و/یا سبم پیوند را فراهم می‌کند.
  2. ۲٫۰ ۲٫۱ ۲٫۲ با قرار دادن متن در میان برچسب‌های <span class="nowrap">...</span> از شکسته‌شدن آن جلوگیری می‌کند.
  3. ۳٫۰ ۳٫۱ ۳٫۲ امکان پیونددهی به الگوها در هر فضای نامی را فراهم می‌کند.
  4. {{الگوع|plaincode=yes}} از <code style="border:none; background-color:transparent;">...</code> استفاده می‌کند.
  5. ۵٫۰ ۵٫۱ با استفاده از <span style="font-family:monospace;">...</span> قلم تک‌فاصله را نمایش می‌دهد.

سایر الگوهای قالب‌بندی ویرایش

الگوهای تولیدکنندهٔ اثرهای قالب‌بندی اختصاصی برای الگوها، پودمان یا پارامترهای مشخص‌شده
نمونه کد اثر توضیح
{{الگو۲|Hatnote|lang=fr}} {{Hatnote}} از پیوند به پروژه‌های خواهد پشتیبانی می‌کند (مثلاً fr:Hatnote)
{{الگوف|کاربر:Jeeputer/شمار ویرایش‌ها}} {{کاربر:Jeeputer/شمار ویرایش‌ها}} از پیونددهی به هر فضای نامی پشتیبانی می‌کند
{{دمو|<nowiki>{{سرنویس|lang=fa|کمی متن}}</nowiki>}}
{{سرنویس|lang=fa|کمی متن}}

کد و نمونه‌اش را نمایش می‌دهد
{{دمگ|سرنویس|کمی متن برای سرنویس}} "{{سرنویس|کمی متن برای سرنویس}}" می‌دهد "" [۱] کد، نمونه و پیوندی برای بسط کد الگو را نمایش می‌دهد
{{tln|Hatnote}} الگو:Tln Produces a normal link to the template
{{elc|Template:Hatnote}}
{{elc|Template:Hatnote|Hatnote}}
الگو:Elc
الگو:Elc
Formats wikilink, with optional piped link text and blended suffix
{{ml|Example|hello}} پودمان:Example (بحث · ویرایش · تاریخچه · پیوندها · توضیحات · زیرصفحه‌ها · آزمایش (نتایج)) Counterpart to {{tl}} for linking to Lua modules
{{mlx|Example|hello}} {{#invoke:Example|hello}} Counterpart to {{tlx}} for linking to Lua modules
{{para|title|<var>book title</var>}} |title=book title Formats template parameters for display, with or without values
{{sclx|LASTING}} [[WP:LASTING]] Takes a shortcut suffix in project namespace and displays it with brackets and the WP: alias in a <code>...</code> tag.
{{tag|ref}}
{{xtag|templatedata}}
<ref>...</ref>
<templatedata>
Formats [X]HTML tags; can add content, choose opening, closing, or self-closing
{{dtl|Ping project}} الگو:Dtl Wikidata counterpart to {{tl}}
{{pf|if}}
{{pf|if|{{{1}}}|true|false}}
{{#if}}
{{#if:{{{1}}}|true|false}}
Parser function equivalent to {{tl}}
{{magic word|uc:}} الگو:Magic word Magic word links

With utility links ویرایش

Templates producing utility links for a given template (Hatnote used here as example)
Code example Effect
{{lt|Hatnote}} الگو:Hatnote (ویرایش|بحث|تاریخچه|پیوندها|پی‌گیری|سیاهه‌ها)
{{lts|Hatnote}} الگو:Hatnote(ویرایش بحث پیوندها تاریخچه)
{{t links|Hatnote}} Hatnote&#x20;(edit · talk · history · links · /subpages · /doc · /doc edit · /sbox · /sbox&nbsp;diff · /test · Module:hatnote)
{{tfd links|Hatnote}} Template:Hatnote&nbsp;(edit⧼tpt-languages-separator⧽talk⧼tpt-languages-separator⧽history⧼tpt-languages-separator⧽links⧼tpt-languages-separator⧽logs⧼tpt-languages-separator⧽subpages⧼tpt-languages-separator⧽delete)
{{tetl|Hatnote}} {{&#160;Hatnote&#160;}}
links&#160;talk&#160;view
{{tsetl|Hatnote}} {{&#160;subst:Hatnote&#160;}}
&#160;links&#160;talk&#160;view
{{ti|Hatnote}} الگو:Hatnote (بحث، پیوندها، ویرایش)
{{tic|Hatnote}} Template:Hatnote (talk, links, edit)
{{tim|Hatnote}} m:Template:Hatnote (talk, backlinks, edit)
{{tiw|Hatnote}} الگو:Hatnote (backlinks, edit)
{{tlt|Hatnote}} {{Hatnote}} (بحث)
{{ttl|Hatnote}} &#123;{Hatnote}}&nbsp;(t/l)
{{twlh|Hatnote}} الگو:Hatnote (پیوندها، بحث)