<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bharatpedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ACite_Almanac_FS</id>
	<title>Module:Cite Almanac FS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.bharatpedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ACite_Almanac_FS"/>
	<link rel="alternate" type="text/html" href="https://en.bharatpedia.org/w/index.php?title=Module:Cite_Almanac_FS&amp;action=history"/>
	<updated>2026-10-18T22:51:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://en.bharatpedia.org/w/index.php?title=Module:Cite_Almanac_FS&amp;diff=556116&amp;oldid=prev</id>
		<title>WikiDwarf: Add missing module</title>
		<link rel="alternate" type="text/html" href="https://en.bharatpedia.org/w/index.php?title=Module:Cite_Almanac_FS&amp;diff=556116&amp;oldid=prev"/>
		<updated>2026-04-06T09:47:40Z</updated>

		<summary type="html">&lt;p&gt;Add missing module&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require (&amp;#039;strict&amp;#039;)&lt;br /&gt;
local get_args = require (&amp;#039;Module:Arguments&amp;#039;).getArgs;&lt;br /&gt;
&lt;br /&gt;
local data = mw.loadData (&amp;#039;Module:Cite Almanac FS/data&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S U B S T I T U T E &amp;gt;----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Substitutes $1, $2, etc in &amp;lt;message&amp;gt; with data from &amp;lt;data_t&amp;gt;. Returns plain-text substituted string when&lt;br /&gt;
&amp;lt;data_t&amp;gt; not nil; returns &amp;lt;message&amp;gt; else.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function substitute (message, data_t)&lt;br /&gt;
	return data_t and mw.message.newRawMessage (message, data_t):plain() or message;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E R R _ M E S S A G I N G &amp;gt;----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
create a formatted error message using Module:Citation/CS1/styles.css for styling&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function err_messaging (frame, message)&lt;br /&gt;
	return substitute (data.error_messages_t.msg_format, {&lt;br /&gt;
		frame:extensionTag (&amp;#039;templatestyles&amp;#039;, &amp;#039;&amp;#039;, {src=data.error_messages_t.templatestyles}),&lt;br /&gt;
		data.error_messages_t.template_name,&lt;br /&gt;
		message&lt;br /&gt;
		});&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; U N K N O W N _ P A R A M S _ C H E C K &amp;gt;--------------------------------------&lt;br /&gt;
&lt;br /&gt;
looks at all parameters in the template (parent) frame; returns first unrecognized parameter name; nil else&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function unknown_params_check (frame)&lt;br /&gt;
	local args_t = frame:getParent().args;										-- get parameters in the calling template frame&lt;br /&gt;
	for param, _ in pairs (args_t) do&lt;br /&gt;
		if not data.known_parameters_t[param] then								-- do we recognize &amp;lt;param&amp;gt;?&lt;br /&gt;
			return param;														-- no; return unknown &amp;lt;param&amp;gt; for use in an error message&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; A L I A S _ G E T &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
extracts the first alias listed in &amp;lt;aliases_t&amp;gt; from &amp;lt;args_t&amp;gt;; if present, returns the parameter alias and the&lt;br /&gt;
assigned value; nil else.  Only applies to the parameters that are unique to this template (the parameters listed&lt;br /&gt;
in &amp;lt;unique_parameters_t&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function alias_get (aliases_t, args_t)&lt;br /&gt;
	for _, param in ipairs (aliases_t) do										-- for each parameter in the &amp;lt;aliases_t&amp;gt; sequence&lt;br /&gt;
		if args_t[param] then													-- if this parameter is in the template call (&amp;lt;args_t&amp;gt;)&lt;br /&gt;
			return param, args_t[param];										-- return the parameter name and its value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; M A I N &amp;gt;----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
{{#invoke:Cite Almanac FS|main|section=women|subsection=c}}&lt;br /&gt;
&lt;br /&gt;
|section= accepts these keywords (case insensitive):&lt;br /&gt;
	men&lt;br /&gt;
	women&lt;br /&gt;
	coed				-- no subsections&lt;br /&gt;
	men-inactive		-- no subsections&lt;br /&gt;
	women-inactive		-- no subsections&lt;br /&gt;
	institutions&lt;br /&gt;
	closed-institutions	-- no subsections&lt;br /&gt;
	founding-chronological -- no subsections&lt;br /&gt;
	founding-of-fs-system --no subsections	&lt;br /&gt;
	none				-- suppress {{cite book}} section rendering (displays only {{cite book}} title)&lt;br /&gt;
	&lt;br /&gt;
|subsection=			-- required for §men, §women, §institutions; accepts a single letter (case insensitive)&lt;br /&gt;
|organization=			-- optional organization name; concatenated with |section= and |subsection= values;&lt;br /&gt;
							ignored when |section=none&lt;br /&gt;
&lt;br /&gt;
|last-first=			--optional; accepts one value; when set to yes uses:&lt;br /&gt;
							|editor-last=Lurding and |editor-first=Carroll and&lt;br /&gt;
							|editor2-last=Becque and |editor2-first=Fran;&lt;br /&gt;
							uses |editor=Carroll Lurding and |editor2=Fran Becque else&lt;br /&gt;
							&lt;br /&gt;
&lt;br /&gt;
|access-date=			-- supported cs1|2 parameters&lt;br /&gt;
|archive-url=&lt;br /&gt;
|archive-date=&lt;br /&gt;
|date=&lt;br /&gt;
|mode=&lt;br /&gt;
|page=&lt;br /&gt;
|pages=&lt;br /&gt;
|ref=&lt;br /&gt;
|url-status=&lt;br /&gt;
&lt;br /&gt;
any other parameters are rejected with an error message.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function main (frame)&lt;br /&gt;
	local error_msg = unknown_params_check (frame);								-- look at all parameters&lt;br /&gt;
	if error_msg then&lt;br /&gt;
		error_msg = substitute (data.error_messages_t.unknown_parameter, {error_msg});	-- at least one parameter is not recognized so&lt;br /&gt;
		return err_messaging (frame, error_msg);								-- emit an error message and abandon&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local args_t = get_args (frame);											-- get a proper table of parameters with assigned values&lt;br /&gt;
&lt;br /&gt;
	local Section_origin, Section = alias_get (data.unique_aliases_t.section_t, args_t);&lt;br /&gt;
	local Subsection_origin, Subsection = alias_get (data.unique_aliases_t.subsection_t, args_t);&lt;br /&gt;
	local Last_first_origin, Last_first = alias_get (data.unique_aliases_t.last_first_t, args_t);&lt;br /&gt;
	local Organization_origin, Organization = alias_get (data.unique_aliases_t.organization_t, args_t);&lt;br /&gt;
&lt;br /&gt;
	local section_index = Section and data.keywords_t[Section:lower()] or nil;	-- nil when |section= empty/omitted or unknown&lt;br /&gt;
	local subsection_index = Subsection and Subsection:upper() or nil;&lt;br /&gt;
&lt;br /&gt;
	if not section_index and not Section then&lt;br /&gt;
		return err_messaging (frame, data.error_messages_t.section_required);	-- emit an error message and abandon&lt;br /&gt;
&lt;br /&gt;
	elseif &amp;#039;none&amp;#039; ~= section_index then&lt;br /&gt;
		if not data.sections_t[section_index] then								-- error when section does not exist&lt;br /&gt;
			error_msg = substitute (data.error_messages_t.unknown_section, {Section});&lt;br /&gt;
			return err_messaging (frame, error_msg);							-- emit an error message and abandon&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (&amp;#039;none&amp;#039; ~= section_index) then											-- if section not suppressed&lt;br /&gt;
		if data.sections_t[section_index][&amp;#039;subsection url&amp;#039;] and not Subsection then	-- no subsection error when no subsection url&lt;br /&gt;
			return err_messaging (frame, data.error_messages_t.subsection_required);	-- emit an error message and abandon&lt;br /&gt;
&lt;br /&gt;
		elseif Subsection then&lt;br /&gt;
			if not data.sections_t[section_index][subsection_index] then		-- error when subsection does not exist&lt;br /&gt;
				error_msg = substitute (data.error_messages_t.unknown_subsection, {Subsection});&lt;br /&gt;
				return err_messaging (frame, error_msg);						-- emit an error message and abandon&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local last_first = data.affirmative_t[Last_first];							-- boolean for editor name-order TODO: add &amp;#039;yes&amp;#039; &amp;#039;aliasing mechanism&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	local cite_args_t = {};														-- initialize a {{cite book}} template&lt;br /&gt;
	for param, value in pairs (data.static_param_data_t) do&lt;br /&gt;
		cite_args_t[param] = value;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if last_first then&lt;br /&gt;
		cite_args_t[&amp;#039;editor-last&amp;#039;] = data.static_editor_data_t[&amp;#039;editor-last&amp;#039;];&lt;br /&gt;
		cite_args_t[&amp;#039;editor-first&amp;#039;] = data.static_editor_data_t[&amp;#039;editor-first&amp;#039;];&lt;br /&gt;
		cite_args_t[&amp;#039;editor2-last&amp;#039;] = data.static_editor_data_t[&amp;#039;editor2-last&amp;#039;];&lt;br /&gt;
		cite_args_t[&amp;#039;editor2-first&amp;#039;] = data.static_editor_data_t[&amp;#039;editor2-first&amp;#039;];&lt;br /&gt;
	else&lt;br /&gt;
		cite_args_t.editor = data.static_editor_data_t.editor;&lt;br /&gt;
		cite_args_t.editor2 = data.static_editor_data_t.editor2;&lt;br /&gt;
&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if &amp;#039;none&amp;#039; ~= section_index then&lt;br /&gt;
		if data.sections_t[section_index][&amp;#039;subsection url&amp;#039;] then				-- if we have a base subsection url&lt;br /&gt;
			if data.keywords_t.index == subsection_index then					-- are we rendering a link to the index page?&lt;br /&gt;
				cite_args_t[&amp;#039;section-url&amp;#039;] =  data.sections_t[section_index][&amp;#039;section url&amp;#039;];	-- create |section-url=&lt;br /&gt;
				cite_args_t.section = substitute (data.section_title_formating_t.index, {		-- create |section=&lt;br /&gt;
					data.sections_t[section_index][&amp;#039;section title&amp;#039;],&lt;br /&gt;
					data.section_title_formating_t.index_label&lt;br /&gt;
					});&lt;br /&gt;
			else&lt;br /&gt;
				cite_args_t[&amp;#039;section-url&amp;#039;] =  substitute (&amp;#039;$1$2&amp;#039;, {data.sections_t[section_index][&amp;#039;subsection url&amp;#039;], data.sections_t[section_index][subsection_index]});	-- create |section-url=&lt;br /&gt;
				if Organization then&lt;br /&gt;
					cite_args_t.section = substitute (data.section_title_formating_t.org, {		-- create |section= with organization name&lt;br /&gt;
						data.sections_t[section_index][&amp;#039;section title&amp;#039;],		-- the section title&lt;br /&gt;
						subsection_index,										-- the subsection index letter&lt;br /&gt;
						Organization											-- organization name&lt;br /&gt;
						});&lt;br /&gt;
				else															-- organization not named&lt;br /&gt;
					cite_args_t.section = substitute (data.section_title_formating_t.plain, {data.sections_t[section_index][&amp;#039;section title&amp;#039;], subsection_index});	-- append the subsection index letter&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		else																	-- here when no base subsection url&lt;br /&gt;
			cite_args_t[&amp;#039;section-url&amp;#039;] = data.sections_t[section_index][&amp;#039;section url&amp;#039;];	-- use the section url&lt;br /&gt;
			if Organization then&lt;br /&gt;
				cite_args_t.section = substitute (data.section_title_formating_t.org_no_subsection, {&lt;br /&gt;
					data.sections_t[section_index][&amp;#039;section title&amp;#039;],&lt;br /&gt;
					Organization												-- append organization name&lt;br /&gt;
					});&lt;br /&gt;
			else																-- organization not named&lt;br /&gt;
				cite_args_t.section = data.sections_t[section_index][&amp;#039;section title&amp;#039;];&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		cite_args_t[&amp;#039;section-format&amp;#039;] = &amp;#039;PDF&amp;#039;;									-- mark |section= as a pdf document&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for _, param in ipairs (data.cs1_parameters_t) do							-- add supported cs1|2 parameters to &amp;lt;cite_args_t&amp;gt;&lt;br /&gt;
		if args_t[param] then													-- if this &amp;lt;param&amp;gt; was present in the template call and has a value&lt;br /&gt;
			cite_args_t[param] = args_t[param];									-- add param / value pair to the {{cite book}} template&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return require (&amp;#039;Module:Citation/CS1&amp;#039;)._citation (nil, cite_args_t, {CitationClass=&amp;#039;book&amp;#039;});	-- render the {{cite book}} template&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T S &amp;gt;----------------------------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	main = main,&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>WikiDwarf</name></author>
	</entry>
</feed>