Bước tới nội dung

Bản mẫu:Liên kết hàm mô đun/doc

Bách khoa toàn thư mở Wikipedia

{{mfl}} is similar to {{ml}}, but assumes that the function specified is documented, and thus creates a link to a section of the same name expected to be found in the documentation. Another difference with {{ml}} is that the behaviour of empty and undefined in the second parameter here is inverted.

Code Result Notes
{{mfl|Example}} {{#invoke:Example}} Omits the function name
{{mfl|Example|hello}} {{#invoke:Example|hello}} Usage with a function name.
{{mfl|Example|count_fruit|3=bananas=10|4=kiwis=5}} {{#invoke:Example|count_fruit|bananas=10|kiwis=5}} Usage with a function name and parameters.
{{mfl|Example|count_fruit|Fred|bananas{{=}}10|apples{{=}}5}} {{#invoke:Example|count_fruit|Fred|bananas=10|apples=5}} Usage with a function name and parameters, using {{=}}.
{{mfl|Example|}} {{#invoke:Example|hàm}} Usage with a generic function name. This does not produce a usable invocation.

TemplateData

[sửa mã nguồn]
Đây là tài liệu Dữ liệu bản mẫu cho bản mẫu này được sử dụng bởi Trình soạn thảo trực quan và các công cụ khác; xem báo cáo sử dụng tham số hàng tháng cho bản mẫu này.

Dữ liệu bản mẫu cho Liên kết hàm mô đun

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

Tham số bản mẫu

Nên dùng bản mẫu này với các tham số đặt trên cùng một hàng.

Tham sốMiêu tảKiểuTrạng thái
module name1

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

Chuỗi dàibắt buộc
function name2

the function name within the module to call, expected to be documented

Chuỗi dàitùy chọn
parameter 13

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

Chuỗi dàitùy chọn
parameter 24

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

Chuỗi dàitùy chọn
parameter 35

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

Chuỗi dàitùy chọn
  • {{ml}} - Similar function but without generating links
  • {{tl}} - A version of this template for templates instead of modules.

Định dạng mục đích chung

[sửa mã nguồn]
  • 1 {{tlg}} là tổng quát nhất, cho phép bất kỳ sự kết hợp của kiểu chữ và/hoặc tùy chọn kiểu liên kết.
  • 2 Ngăn chữ xuống dòng bằng cách đặt nó bên trong thẻ <span class="nowrap">...</span>.
  • 3 Cho phép liên kết đến các bản mẫu trong bất kỳ không gian tên.
  • 4|plaincode=yes sử dụng <code style="border:none; background-color:transparent;">...</code>.
  • 5 Sử dụng phông chữ đơn cách nhưng không dùng <code>...</code>.

Bản mẫu định dạng khác

[sửa mã nguồn]
Mã ví dụ Hiệu ứng Ghi chú
{{tl2|Hatnote|lang=fr}} {{hatnote}} Hỗ trợ kết nối với các dự án chị em (ví dụ, fr:Hatnote)
{{tlu|Thành viên:Ví dụ/Trang con mẫu}} {{Thành viên:Ví dụ/Trang con mẫu}} Hỗ trợ kết nối với bất kỳ không gian tên
{{demo|<nowiki>{{Hatnote|lang=fr|Vài chữ}}</nowiki>}}
{{hatnote|lang=fr|Vài chữ}}
Hiển thị mã và ví dụ
{{xpd|Hatnote|Vài chữ hatnote}} "{{hatnote|Vài chữ hatnote}}" cho ra "" [1] Hiển thị mã, ví dụ và một liên kết để mở rộng bản mẫu mã
{{para|tiêu đề|<var>tiêu đề sách</var>}} |tiêu đề=tiêu đề sách Các tham số bản mẫu định dạng cho màn hình, có hoặc không có giá trị

Với các liên kết tiện ích

[sửa mã nguồn]
Mã ví dụ Hiệu ứng
{{lts|Hatnote}} Bản mẫu:Hatnote(sửa thảo luận liên kết lịch sử)
{{t links|Hatnote}} Hatnote (sửa thảo luận lịch sử liên kết # /trang con /doc /doc sửa /sbox /sbox diff /kiểm thử)
{{tfd links|Hatnote}} Bản mẫu:Hatnote (sửa · thảo luận · lịch sử · liên kết · nhật trình · trang con · xóa)
{{tiw|Hatnote}} Bản mẫu:hatnote (liên kết nền sửa)
{{tltt|Hatnote}} {{Hatnote}}
{{tetl|Hatnote}} {{ Hatnote }}
links talk view
{{tsetl|Hatnote}} {{thế:Hatnote}}
 liên kết thảo luận sửa
{{ti|Hatnote}} Bản mẫu:Hatnote (thảo luận · liên kết · sửa)
{{tic|Hatnote}} Bản mẫu:Hatnote (thảo luận liên kết sửa)
{{tiw|Hatnote}} Bản mẫu:Hatnote (liên kết nền sửa)
{{tlt|Hatnote}} {{Hatnote}} (thảo luận)
{{ttl|Hatnote}} {{Hatnote}} (t/l)