From Wikipedia, the free encyclopedia

local p = {}

local uc = {births="Births", deaths="Deaths"}



local page_content = {}

local function get_section(frame, page_name, section_name)

	if page_contentpage_name == nil then

		local title = mw.title.new(page_name)

		if title then

			if title.redirectTarget then title = title.redirectTarget end

			page_contentpage_name = title:getContent()

		end

	end

	if page_contentpage_name then

		if mw.ustring.find(page_contentpage_name], "=%s*" .. section_name .. "%s*=", 1, false) then

			return frame:preprocess("{{#section-h::" .. page_name .. "|".. section_name .. "}}")

		end

	end

	return ''

end



local function transclude(frame, entry, year, article)

	local s = "'''{{dr|y|y|" .. year .. "|0|{{#ifexpr: " .. year ..

		" <= 100|na|n}}}}''' "

	s = frame:preprocess(s) .. get_section(frame, article, ucentry])

	s = mw.ustring.gsub(s, '==+[^=]-==+%s*%c*', '')

	return mw.ustring.match(s, '.*%*.*%a.+')

end



function p.main(frame)

	local decade = mw.text.trim(frame.args1 or frame:getParent().args1 or '0')

	local result = {}

	local article_list = {}

	local year_list = {}



	if decade:sub(1, 1) == '-' then

		for i = -9, (decade == '-0' and -1 or 0)  do

			table.insert(article_list, frame:expandTemplate {

				title = "Year article",

				args = { decade .. '0', tostring(i) }

			})

			table.insert(year_list, decade .. math.abs(i))

		end

	else

		for i = (decade == '0' and 1 or 0), 9 do

			table.insert(article_list, frame:expandTemplate {

				title = "Year article",

				args = { decade .. '0', tostring(i) }

			})

			table.insert(year_list, decade .. tostring(i))

		end

	end

			

	for i, entry in ipairs({"births", "deaths"}) do

		table.insert(result, '== ' .. ucentry .. '==\n')

		table.insert(result, frame:expandTemplate { title = "transcluding article", args = article_list})



		for i, article in ipairs(article_list) do

			table.insert(result, transclude(frame, entry, year_listi], article))

		end

	end

	

	return table.concat(result)

end



return p
From Wikipedia, the free encyclopedia

local p = {}

local uc = {births="Births", deaths="Deaths"}



local page_content = {}

local function get_section(frame, page_name, section_name)

	if page_contentpage_name == nil then

		local title = mw.title.new(page_name)

		if title then

			if title.redirectTarget then title = title.redirectTarget end

			page_contentpage_name = title:getContent()

		end

	end

	if page_contentpage_name then

		if mw.ustring.find(page_contentpage_name], "=%s*" .. section_name .. "%s*=", 1, false) then

			return frame:preprocess("{{#section-h::" .. page_name .. "|".. section_name .. "}}")

		end

	end

	return ''

end



local function transclude(frame, entry, year, article)

	local s = "'''{{dr|y|y|" .. year .. "|0|{{#ifexpr: " .. year ..

		" <= 100|na|n}}}}''' "

	s = frame:preprocess(s) .. get_section(frame, article, ucentry])

	s = mw.ustring.gsub(s, '==+[^=]-==+%s*%c*', '')

	return mw.ustring.match(s, '.*%*.*%a.+')

end



function p.main(frame)

	local decade = mw.text.trim(frame.args1 or frame:getParent().args1 or '0')

	local result = {}

	local article_list = {}

	local year_list = {}



	if decade:sub(1, 1) == '-' then

		for i = -9, (decade == '-0' and -1 or 0)  do

			table.insert(article_list, frame:expandTemplate {

				title = "Year article",

				args = { decade .. '0', tostring(i) }

			})

			table.insert(year_list, decade .. math.abs(i))

		end

	else

		for i = (decade == '0' and 1 or 0), 9 do

			table.insert(article_list, frame:expandTemplate {

				title = "Year article",

				args = { decade .. '0', tostring(i) }

			})

			table.insert(year_list, decade .. tostring(i))

		end

	end

			

	for i, entry in ipairs({"births", "deaths"}) do

		table.insert(result, '== ' .. ucentry .. '==\n')

		table.insert(result, frame:expandTemplate { title = "transcluding article", args = article_list})



		for i, article in ipairs(article_list) do

			table.insert(result, transclude(frame, entry, year_listi], article))

		end

	end

	

	return table.concat(result)

end



return p

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook