<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://www.wikiw.cn/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3ALabelled_list_hatnote</id>
	<title>模块:Labelled list hatnote - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://www.wikiw.cn/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3ALabelled_list_hatnote"/>
	<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Labelled_list_hatnote&amp;action=history"/>
	<updated>2026-04-08T18:45:03Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Labelled_list_hatnote&amp;diff=163&amp;oldid=prev</id>
		<title>Admin：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Labelled_list_hatnote&amp;diff=163&amp;oldid=prev"/>
		<updated>2025-06-20T16:45:33Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2025年6月21日 (六) 00:45的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Labelled_list_hatnote&amp;diff=162&amp;oldid=prev</id>
		<title>wikiw&gt;Xiplus-abot：​已更改“Module:Labelled list hatnote”的保护等级：高風險模板：15429引用&lt;!-- 機器人3 --&gt;（[编辑=仅允许模板编辑员和管理员]（无限期）[移动=仅允许模板编辑员和管理员]（无限期））</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Labelled_list_hatnote&amp;diff=162&amp;oldid=prev"/>
		<updated>2020-08-17T04:09:50Z</updated>

		<summary type="html">&lt;p&gt;已更改“&lt;a href=&quot;/index.php?title=%E6%A8%A1%E5%9D%97:Labelled_list_hatnote&quot; title=&quot;模块:Labelled list hatnote&quot;&gt;Module:Labelled list hatnote&lt;/a&gt;”的保护等级：高風險模板：15429引用&amp;lt;!-- &lt;a href=&quot;/index.php?title=%E7%94%A8%E6%88%B7:Xiplus-abot/task/3&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;用户:Xiplus-abot/task/3（页面不存在）&quot;&gt;機器人3&lt;/a&gt; --&amp;gt;（[编辑=仅允许模板编辑员和管理员]（无限期）[移动=仅允许模板编辑员和管理员]（无限期））&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--                               Labelled list                                --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- This module does the core work of creating a hatnote composed of a list    --&lt;br /&gt;
-- prefixed by a colon-terminated label, i.e. &amp;quot;LABEL: [andList of pages]&amp;quot;,    --&lt;br /&gt;
-- for {{see also}} and similar templates.                                    --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local mHatnote = require(&amp;#039;Module:Hatnote&amp;#039;)&lt;br /&gt;
local mHatlist = require(&amp;#039;Module:Hatnote list&amp;#039;)&lt;br /&gt;
local mArguments --initialize lazily&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Defaults global to this module&lt;br /&gt;
-- 本地化注意&lt;br /&gt;
local defaults = {&lt;br /&gt;
	label = &amp;#039;参见&amp;#039;, --Final fallback for label argument&lt;br /&gt;
	labelForm = &amp;#039;%s：%s&amp;#039;,&lt;br /&gt;
	prefixes = {&amp;#039;label&amp;#039;, &amp;#039;label &amp;#039;, &amp;#039;l&amp;#039;},&lt;br /&gt;
	template = &amp;#039;Module:Labelled list hatnote&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Helper function that pre-combines display parameters into page arguments.&lt;br /&gt;
-- Also compresses sparse arrays, as a desirable side-effect.&lt;br /&gt;
function p.preprocessDisplays (args, prefixes)&lt;br /&gt;
	-- Prefixes specify which parameters, in order, to check for display options&lt;br /&gt;
	-- They each have numbers auto-appended, e.g. &amp;#039;label1&amp;#039;, &amp;#039;label 1&amp;#039;, &amp;amp; &amp;#039;l1&amp;#039;&lt;br /&gt;
	prefixes = prefixes or defaults.prefixes&lt;br /&gt;
	local pages = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if type(k) == &amp;#039;number&amp;#039; then&lt;br /&gt;
			local display&lt;br /&gt;
			for i = 1, #prefixes do&lt;br /&gt;
				display = args[prefixes[i] .. k]&lt;br /&gt;
				if display then break end&lt;br /&gt;
			end&lt;br /&gt;
			local page = display and&lt;br /&gt;
				string.format(&amp;#039;%s|%s&amp;#039;, string.gsub(v, &amp;#039;|.*$&amp;#039;, &amp;#039;&amp;#039;), display) or v&lt;br /&gt;
			pages[#pages + 1] = page&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return pages&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Produces a labelled pages-list hatnote.&lt;br /&gt;
-- The main frame (template definition) takes 1 or 2 arguments, for a singular&lt;br /&gt;
-- and (optionally) plural label respectively:&lt;br /&gt;
-- * {{#invoke:Labelled list hatnote|labelledList|Singular label|Plural label}}&lt;br /&gt;
-- The resulting template takes pagename &amp;amp; label parameters normally.&lt;br /&gt;
function p.labelledList (frame)&lt;br /&gt;
	mArguments = require(&amp;#039;Module:Arguments&amp;#039;)&lt;br /&gt;
	local labels = {frame.args[1] or defaults.label}&lt;br /&gt;
	labels[2] = frame.args[2] or labels[1]&lt;br /&gt;
	local template = frame:getParent():getTitle()&lt;br /&gt;
	local args = mArguments.getArgs(frame, {parentOnly = true})&lt;br /&gt;
	local pages = p.preprocessDisplays(args)&lt;br /&gt;
	local options = {&lt;br /&gt;
		extraclasses = frame.args.extraclasses,&lt;br /&gt;
		category = args.category,&lt;br /&gt;
		selfref = frame.args.selfref or args.selfref,&lt;br /&gt;
		template = template&lt;br /&gt;
	}&lt;br /&gt;
	return p._labelledList(pages, labels, options)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._labelledList (pages, labels, options)&lt;br /&gt;
	labels = labels or {}&lt;br /&gt;
	if #pages == 0 then&lt;br /&gt;
		-- 本地化注意&lt;br /&gt;
		return mHatnote.makeWikitextError(&lt;br /&gt;
			&amp;#039;未指定页面名称&amp;#039;,&lt;br /&gt;
			(options.template or defaults.template) .. &amp;#039;#错误&amp;#039;,&lt;br /&gt;
			options.category&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	label = (#pages == 1 and labels[1] or labels[2]) or defaults.label&lt;br /&gt;
	local text = string.format(&lt;br /&gt;
		options.labelForm or defaults.labelForm,&lt;br /&gt;
		label,&lt;br /&gt;
		mHatlist.andList(pages, true)&lt;br /&gt;
	)&lt;br /&gt;
	local hnOptions = {&lt;br /&gt;
		extraclasses = options.extraclasses,&lt;br /&gt;
		selfref = options.selfref&lt;br /&gt;
	}&lt;br /&gt;
	return mHatnote._hatnote(text, hnOptions)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikiw&gt;Xiplus-abot</name></author>
	</entry>
</feed>