“模块:WikidataIB/titleformats”的版本间的差异

来自中文乐谱库
wiki_>Xiplus
(已保护“模块:WikidataIB/titleformats”:高風險模板:121374引用([编辑=仅管理员](无限期)[移动=仅管理员](无限期)))
 
(导入1个版本)
 
(没有差异)

2020年7月7日 (二) 23:15的最新版本

此模块的文档可以在模块:WikidataIB/titleformats/doc创建

脚本错误:Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted

--[[
To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised,
and others are quoted.
This submodule lists the entity-ids used in 'instance of' (P31),
which allows a module to identify the values that should be formatted.
The table p.formats is indexed by entity-id, and contains the value " or ''
--]]

local p = {}

p.italics = {
	"Q571",			-- book
	"Q13593966",	-- literary trilogy
	"Q277759",		-- book series
	"Q2188189",		-- musical work
	"Q11424",		-- film
	"Q13593818",	-- film trilogy
	"Q24856",		-- film series
	"Q5398426",		-- television series
	"Q482994",		-- album
	"Q169930",		-- extended play
	"Q1760610",		-- comic book
	"Q7889",		-- video game
	"Q7058673",		-- video game series
	"Q25379",		-- play
	"Q2743",		-- musical
	"Q37484",		-- epic poem
}

p.quotes = { 
	"Q207628",		-- musical composition
}

p.size = 0
p.formats = {}

for i, v in ipairs(p.italics) do
	p.formats[v] = ""
	p.size = p.size + 1
end

for i, v in ipairs(p.quotes) do
	p.formats[v] = '"'
	p.size = p.size + 1
end

return p