<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://battleint.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AWorks_by_license_subcat</id>
	<title>Module:Works by license subcat - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://battleint.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AWorks_by_license_subcat"/>
	<link rel="alternate" type="text/html" href="https://battleint.net/index.php?title=Module:Works_by_license_subcat&amp;action=history"/>
	<updated>2026-11-28T06:32:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://battleint.net/index.php?title=Module:Works_by_license_subcat&amp;diff=177107&amp;oldid=prev</id>
		<title>imported&gt;Deadfire: Creation (as this is needed)</title>
		<link rel="alternate" type="text/html" href="https://battleint.net/index.php?title=Module:Works_by_license_subcat&amp;diff=177107&amp;oldid=prev"/>
		<updated>2023-03-02T19:33:14Z</updated>

		<summary type="html">&lt;p&gt;Creation (as this is needed)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {} --p stands for package&lt;br /&gt;
&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local namespace = mw.title.getCurrentTitle().nsText&lt;br /&gt;
local rootpagename = mw.title.getCurrentTitle().rootText&lt;br /&gt;
local catname = string.gsub(rootpagename, &amp;quot;Author%-&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
function author_subcat(subcat)&lt;br /&gt;
	return yesno(subcat or string.find(rootpagename, &amp;quot;Author%-&amp;quot;) ~= nil)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function categories(subcat, extra, sort_as)&lt;br /&gt;
	if namespace == &amp;quot;Category&amp;quot; and subcat then&lt;br /&gt;
		return &amp;quot;[[Category:Authors by license|&amp;quot; .. (sort_as or catname) .. &amp;quot;]] [[Category:&amp;quot; .. catname .. &amp;quot;]]&amp;quot; .. (extra or &amp;quot;&amp;quot;)&lt;br /&gt;
	elseif namespace == &amp;quot;Category&amp;quot; then&lt;br /&gt;
		return &amp;quot;[[Category:Works by license|&amp;quot; .. (sort_as or catname) .. &amp;quot;]]&amp;quot; .. (extra or &amp;quot;&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.works_by_license_subcat(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	&lt;br /&gt;
	local template = args.template or catname&lt;br /&gt;
	local subcat = author_subcat(args.author_subcat)&lt;br /&gt;
	local use_template = yesno(args.use_template or true)&lt;br /&gt;
	local sort_as = args.sort_as or catname&lt;br /&gt;
	local nocat = yesno(args.nocat or false)&lt;br /&gt;
	&lt;br /&gt;
	local category&lt;br /&gt;
	if not nocat then&lt;br /&gt;
		category = categories(subcat, nil, sort_as)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local template_args = args&lt;br /&gt;
	template_args.template = nil&lt;br /&gt;
	template_args.author_subcat = nil&lt;br /&gt;
	template_args.use_template = nil&lt;br /&gt;
	template_args.sort_as = nil&lt;br /&gt;
	template_args.nocat = &amp;#039;true&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local text = table.concat(&lt;br /&gt;
		{&lt;br /&gt;
			&amp;quot;This category is populated by {{[[Template:&amp;quot; .. template .. &amp;quot;|&amp;quot; .. template .. &amp;quot;]]}}.&amp;quot;,&lt;br /&gt;
			args.text or &amp;quot;&amp;quot;,&lt;br /&gt;
			category&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot; &amp;quot;&lt;br /&gt;
	)&lt;br /&gt;
	&lt;br /&gt;
	local template_demo&lt;br /&gt;
	if use_template then&lt;br /&gt;
		template_demo = frame:expandTemplate {&lt;br /&gt;
			[&amp;#039;title&amp;#039;] = template,&lt;br /&gt;
			[&amp;#039;args&amp;#039;] = template_args&lt;br /&gt;
		}&lt;br /&gt;
	else&lt;br /&gt;
		template_demo = &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return text .. template_demo&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.pd_old_subcat(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	&lt;br /&gt;
	local ntable = mw.text.split(catname, &amp;quot;-&amp;quot;, true)&lt;br /&gt;
	local n = args[1] or tonumber(ntable[#ntable]) or &amp;quot;{{{1}}}&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	local subcat = author_subcat(args.author_subcat)&lt;br /&gt;
	&lt;br /&gt;
	local sort_as = args.sort_as or catname&lt;br /&gt;
	&lt;br /&gt;
	local text = &amp;quot;This category is a meta category, containing categories for &amp;quot;&lt;br /&gt;
	if subcat then&lt;br /&gt;
		text = text .. &amp;quot;authors whose works&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. &amp;quot;works which&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	text = text .. &amp;quot; are in the public domain in countries where copyright expires &amp;quot; .. n .. &amp;quot; years or fewer after the author&amp;#039;s death.&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	local extra&lt;br /&gt;
	if subcat then&lt;br /&gt;
		extra = &amp;quot;[[Category:Author-PD-old|&amp;quot; .. sort_as .. &amp;quot;]][[Category:Authors with works in the public domain outside the United States|&amp;quot; .. sort_as .. &amp;quot;]]&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		extra = &amp;quot;[[Category:PD-old|&amp;quot; .. sort_as .. &amp;quot;]][[Category:Public domain outside the United States|&amp;quot; .. sort_as .. &amp;quot;]]&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return text .. categories(subcat, extra)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Deadfire</name></author>
	</entry>
</feed>