Mô đun:Author/tài liệu

Văn thư lưu trữ mở Wikisource

Đây là trang dành cho tài liệu về Mô đun:Author.

Mô đun này xử lý logic trong các trang không gian tên Tác gia. Nó dùng Wikidata khi có thể, và cho phép ghi đè nếu cần.

Kiểm thử tại Mô đun:Author/kiểm thử và kết quả có thể xem tại Thảo luận Mô đun:Author/kiểm thử.

Hàm: dates[sửa]

Lấy chuỗi ngày tháng trang tác gia và ghi thể loại.

Cách dùng
Thường dùng: {{#gọi|Author|dates}}
Đầy đủ tham số: {{#gọi|Author|dates|birthyear=|deathyear=|dates=|wikidata_id=}}

{{#gọi|Author|dates|năm sinh=|năm mất=|năm=|mã wikidata=}}

Tham số
  • năm — nếu có thì dùng chính tham số để hiển thị năm (tuy nhiên, năm sinh và năm mất vẫn có thể dùng để tạo thể loại)
  • năm sinhnăm mất — năm sinh và mất, theo định dạng sau:
    • năm số
    • "?" hoặc để trống nếu không rõ (hoặc còn sống)
    • dùng TCN cho năm trước Năm 1
    • Năm xấp xỉ:
      • Thập niên hoặc thế kỷ: "1930s" or "20th century"
      • Circa: "c/1930" or "c. 1930" or "ca 1930" or "circa 1930"
      • Tenuous year: "1932/?"
      • Choice of two or more years: "1932/1933"
  • wikidata_id — the Wikidata identifier to use. Will default to the current page if not supplied.
  • pagetitle — a page title to use instead of the current page (only used for testing purposes).
Returns
This function returns the author's birth and death years, wrapped in parentheses and separated by an en dash. The return string is prefixed with a <br />, and suffixed with the list of appropriate categories (see below).

Thể loại[sửa]

Hàm này thêm trang vào các thể loại sau:

  1. Trong mọi trường hợp (khi có thể):
  2. Nếu năm sinh và/hoặc năm mất bị ghi đè:

Function: date[sửa]

Get a single formatted date, with no categories.

Usage
Common usage: {{#invoke|Author|date|type=}}
All parameters: {{#invoke|Author|date|type=|year=|wikidata_id=}}
Parameters
  • type — either birth or death.
  • year — the year to display, following the same format as birthyear in the dates function above.
  • wikidata_id — the Wikdiata Q-identifier of the author to use.
Returns
A simple string with no categories or leading or trailing line breaks.