<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FN8wilson%2FFAQ_item</id>
	<title>Module:Sandbox/N8wilson/FAQ item - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FN8wilson%2FFAQ_item"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/N8wilson/FAQ_item&amp;action=history"/>
	<updated>2026-04-21T07:49:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/N8wilson/FAQ_item&amp;diff=145861&amp;oldid=prev</id>
		<title>imported&gt;Legoktm: Replace Module:No globals with require( &quot;strict&quot; )</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/N8wilson/FAQ_item&amp;diff=145861&amp;oldid=prev"/>
		<updated>2022-10-23T21:04:12Z</updated>

		<summary type="html">&lt;p&gt;Replace &lt;a href=&quot;/research/Module:No_globals&quot; title=&quot;Module:No globals&quot;&gt;Module:No globals&lt;/a&gt; with require( &amp;quot;strict&amp;quot; )&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;
&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local mHatnote = require(&amp;#039;Module:Hatnote&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local templatestyles = &amp;#039;TemplateStyles sandbox/N8wilson/SeeFAQstyles.css&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame)&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.ternary(cond, ctrue, cfalse)&lt;br /&gt;
	if cond then return ctrue end&lt;br /&gt;
	return cfalse&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.pinned = makeInvokeFunc(&amp;#039;_pinned&amp;#039;)&lt;br /&gt;
function p._pinned(args)&lt;br /&gt;
	-- Generate FAQ for inclusion as the first discussion at the top of the page.&lt;br /&gt;
    local builder = mw.html.create()&lt;br /&gt;
&lt;br /&gt;
    builder:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
        :addClass(&amp;#039;faq-item&amp;#039;)&lt;br /&gt;
        :tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
            :addClass(&amp;#039;faq-link-key&amp;#039;)&lt;br /&gt;
            :wikitext(p.ternary(args[&amp;#039;link-key&amp;#039;], &amp;#039;🔗&amp;#039; .. args[&amp;#039;link-key&amp;#039;], &amp;#039;&amp;#039;))&lt;br /&gt;
            :done()&lt;br /&gt;
        :tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
            :addClass(&amp;#039;faq-question&amp;#039;)&lt;br /&gt;
            :wikitext(&amp;#039;Q&amp;#039; .. (args.index or &amp;#039;&amp;#039;) .. &amp;#039;. &amp;#039; .. (args.q or &amp;#039;&amp;#039;))&lt;br /&gt;
            :done()&lt;br /&gt;
        :tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
            :addClass(&amp;#039;faq-answer&amp;#039;)&lt;br /&gt;
            :wikitext(args.a or &amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
    return builder&lt;br /&gt;
    -- Do not include &amp;lt;h2&amp;gt; tag. The L2 header needs to be interpreted as wikitext &lt;br /&gt;
    -- (i.e. &amp;quot;== header ==&amp;quot;) in order to be properly processed by minerva,&lt;br /&gt;
    -- the mobile skin. If the h2 is included directly, minerva shows it but makes&lt;br /&gt;
    -- the content underneath it inaccessible on mobile interfaces. &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.faqpage = makeInvokeFunc(&amp;#039;_faqpage&amp;#039;)&lt;br /&gt;
function p._faqpage(args)&lt;br /&gt;
	-- Generate FAQ as it should render on the FAQ content page with anchors to questions&lt;br /&gt;
    local builder = mw.html.create()&lt;br /&gt;
&lt;br /&gt;
    builder:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
        :addClass(&amp;#039;faq-item faq-page&amp;#039;)&lt;br /&gt;
        :tag(&amp;#039;h3&amp;#039;)&lt;br /&gt;
            :addClass(&amp;#039;faq-question&amp;#039;)&lt;br /&gt;
            :addClass(&amp;#039;anchor&amp;#039;)&lt;br /&gt;
            :attr(&amp;#039;id&amp;#039;, (&amp;#039;kFAQ-&amp;#039; .. (args[&amp;#039;link-key&amp;#039;] or &amp;#039;&amp;#039;)))&lt;br /&gt;
            :wikitext(args.q or nil)&lt;br /&gt;
            :done()&lt;br /&gt;
        :wikitext(mHatnote._hatnote(tostring(args[&amp;#039;link-key&amp;#039;] or &amp;#039;&amp;#039;), {extraclasses=&amp;#039;link-key&amp;#039;}))&lt;br /&gt;
        :tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
            :addClass(&amp;#039;faq-short-answer&amp;#039;)&lt;br /&gt;
            :wikitext(args[&amp;#039;short-a&amp;#039;] or &amp;#039;&amp;#039;)&lt;br /&gt;
            :done()&lt;br /&gt;
        :tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
            :addClass(&amp;#039;faq-answer&amp;#039;)&lt;br /&gt;
            :wikitext(args.a or &amp;#039;&amp;#039;)&lt;br /&gt;
            :done()&lt;br /&gt;
&lt;br /&gt;
    return builder&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.default = makeInvokeFunc(&amp;#039;_default&amp;#039;)&lt;br /&gt;
function p._default(args)&lt;br /&gt;
	-- Generate item as it should render outside of the FAQ page&lt;br /&gt;
    -- (assume ref to single question in discussion)&lt;br /&gt;
    local builder = mw.html.create()&lt;br /&gt;
&lt;br /&gt;
    builder:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
        :addClass(&amp;#039;faq-question&amp;#039;)&lt;br /&gt;
        :wikitext(args.q or &amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
    builder:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
        :addClass(&amp;#039;faq-answer&amp;#039;)&lt;br /&gt;
        :wikitext(args.a or &amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
    return builder&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
p.beginsection = makeInvokeFunc(&amp;#039;_beginsection&amp;#039;)&lt;br /&gt;
function p._beginsection(args)&lt;br /&gt;
    return mw.html.create(&amp;#039;section&amp;#039;, {selfClosing = true})&lt;br /&gt;
        :attr(&amp;#039;begin&amp;#039;, (args.key or &amp;#039;&amp;#039;))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
p.endsection = makeInvokeFunc(&amp;#039;_endsection&amp;#039;)&lt;br /&gt;
function p._endsection(args)&lt;br /&gt;
    return mw.html.create(&amp;#039;section&amp;#039;, {selfClosing = true})&lt;br /&gt;
        :attr(&amp;#039;end&amp;#039;, (args.key or &amp;#039;&amp;#039;))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
p.main = makeInvokeFunc(&amp;#039;_main&amp;#039;)&lt;br /&gt;
function p._main(args)&lt;br /&gt;
    -- make a decision about which format to use based on params&lt;br /&gt;
    if &amp;#039;FAQ&amp;#039; == mw.title.getCurrentTitle().subpageText then&lt;br /&gt;
        return p._faqpage(args)&lt;br /&gt;
    end&lt;br /&gt;
    if args.format == &amp;#039;pinned&amp;#039; then&lt;br /&gt;
        return p._pinned(args)&lt;br /&gt;
    end&lt;br /&gt;
    return p._default(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Legoktm</name></author>
	</entry>
</feed>