跳转到内容

模組:Hatnote list/doc

维基百科,自由的百科全书

这是本页的一个历史版本,由Yangfl留言 | 贡献2018年5月12日 (六) 14:15 建立内容为“ == Usage from wikitext == This module cannot be used from wikitext. == Usage from Lua == To call the module, use <source lang="lua">local mHatLis…”的新页面)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

这是Module:Hatnote list的文档页面

Usage from wikitext

This module cannot be used from wikitext.

Usage from Lua

To call the module, use

local mHatList = require('Module:Hatnote list')

or similar, then access its methods through the mHatList variable (or whatever was used).

andList

andList takes a list in table form, and returns a string with the list separated with "and" and commas as appropriate.

orList

orList takes a list in table form, and returns a string with the list separated with "or" and commas as appropriate.

forSee

_forSee takes three arguments: a table of trimmed arguments with blanks removed, a "from" number with the index to start at, and an options table, and returns a string with a number of "For X, see [[Y]]" sentences. The links are formatted using the methods from 模块:Hatnote.

As a convenience, the forSee method (without the leading underscore) takes the same arguments except with a frame instead of an args table, using getArgs() from 模块:Arguments to preprocess the arguments.