<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://the-democratika.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASu</id>
	<title>Module:Su - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://the-democratika.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASu"/>
	<link rel="alternate" type="text/html" href="https://the-democratika.com/wiki/index.php?title=Module:Su&amp;action=history"/>
	<updated>2026-04-04T11:13:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://the-democratika.com/wiki/index.php?title=Module:Su&amp;diff=6205&amp;oldid=prev</id>
		<title>&gt;Pppery: Per request</title>
		<link rel="alternate" type="text/html" href="https://the-democratika.com/wiki/index.php?title=Module:Su&amp;diff=6205&amp;oldid=prev"/>
		<updated>2024-04-15T02:27:21Z</updated>

		<summary type="html">&lt;p&gt;Per request&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements {{su}}.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	-- Use arguments from the parent frame only, and remove any blank arguments.&lt;br /&gt;
	-- We don&amp;#039;t need to trim whitespace from any arguments, as this module only&lt;br /&gt;
	-- uses named arguments, and whitespace is trimmed from them automatically. &lt;br /&gt;
	local origArgs = frame:getParent().args&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(origArgs) do&lt;br /&gt;
		if v ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Define the variables to pass to luaMain.&lt;br /&gt;
	local sup = args.p&lt;br /&gt;
	local sub = args.b&lt;br /&gt;
	local options = {&lt;br /&gt;
		align = args.a,&lt;br /&gt;
		fontSize = args.w,&lt;br /&gt;
		lineHeight = args.lh,&lt;br /&gt;
		verticalAlign = args.va&lt;br /&gt;
	}&lt;br /&gt;
	return p._main(sup, sub, options)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.invoke_main(frame)&lt;br /&gt;
	-- entry point for invocation using frame arguments&lt;br /&gt;
	&lt;br /&gt;
	local origArgs = frame.args&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(origArgs) do&lt;br /&gt;
		if v ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Define the variables to pass to luaMain.&lt;br /&gt;
	local sup = args.p&lt;br /&gt;
	local sub = args.b&lt;br /&gt;
	local options = {&lt;br /&gt;
		align = args.a,&lt;br /&gt;
		fontSize = args.w,&lt;br /&gt;
		lineHeight = args.lh,&lt;br /&gt;
		verticalAlign = args.va&lt;br /&gt;
	}&lt;br /&gt;
	return p._main(sup, sub, options)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(sup, sub, options)&lt;br /&gt;
	options = options or {}&lt;br /&gt;
	local span = mw.html.create(&amp;#039;span&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	-- Set the styles.&lt;br /&gt;
	span:css{&lt;br /&gt;
		[&amp;#039;display&amp;#039;]        = &amp;#039;inline-block&amp;#039;,&lt;br /&gt;
		[&amp;#039;margin-bottom&amp;#039;]  = &amp;#039;-0.3em&amp;#039;,&lt;br /&gt;
		[&amp;#039;vertical-align&amp;#039;] = options.verticalAlign or sub and &amp;#039;-0.4em&amp;#039; or &amp;#039;0.8em&amp;#039;,&lt;br /&gt;
		[&amp;#039;line-height&amp;#039;]    = options.lineHeight or &amp;#039;1.2em&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	if options.fontSize == &amp;#039;f&amp;#039; or options.fontSize == &amp;#039;fixed&amp;#039; then&lt;br /&gt;
		span:css{&lt;br /&gt;
			[&amp;#039;font-family&amp;#039;] = &amp;#039;monospace&amp;#039;,&lt;br /&gt;
			[&amp;#039;font-size&amp;#039;]   = &amp;#039;80%&amp;#039;&lt;br /&gt;
		}&lt;br /&gt;
	else&lt;br /&gt;
		span:css(&amp;#039;font-size&amp;#039;, options.fontSize or &amp;#039;80%&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	if options.align == &amp;#039;r&amp;#039; or options.align == &amp;#039;right&amp;#039; then&lt;br /&gt;
		span:css(&amp;#039;text-align&amp;#039;, &amp;#039;right&amp;#039;)&lt;br /&gt;
	elseif options.align == &amp;#039;c&amp;#039; or options.align == &amp;#039;center&amp;#039; then&lt;br /&gt;
		span:css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		span:css(&amp;#039;text-align&amp;#039;, &amp;#039;left&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add the wikitext.&lt;br /&gt;
	span&lt;br /&gt;
		:tag(&amp;#039;sup&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;font-size&amp;#039;, &amp;#039;inherit&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;line-height&amp;#039;, &amp;#039;inherit&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;vertical-align&amp;#039;, &amp;#039;baseline&amp;#039;)&lt;br /&gt;
			:wikitext(sup)&lt;br /&gt;
			:done()&lt;br /&gt;
		:tag(&amp;#039;br&amp;#039;, {selfClosing = true}):done()&lt;br /&gt;
		:tag(&amp;#039;sub&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;font-size&amp;#039;, &amp;#039;inherit&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;line-height&amp;#039;, &amp;#039;inherit&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;vertical-align&amp;#039;, &amp;#039;baseline&amp;#039;)&lt;br /&gt;
			:wikitext(sub)&lt;br /&gt;
	&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;nowrap&amp;quot;&amp;gt;&amp;#039; .. tostring(span) .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>&gt;Pppery</name></author>
	</entry>
</feed>