<?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%2Ftrappist_the_monk%2Flayurl</id>
	<title>Module:Sandbox/trappist the monk/layurl - 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%2Ftrappist_the_monk%2Flayurl"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/trappist_the_monk/layurl&amp;action=history"/>
	<updated>2026-05-27T03:39:22Z</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/trappist_the_monk/layurl&amp;diff=146615&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/trappist_the_monk/layurl&amp;diff=146615&amp;oldid=prev"/>
		<updated>2022-10-23T21:02:25Z</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 data=mw.loadData (&amp;#039;Module:Sandbox/trappist the monk/layurl/data&amp;#039;);&lt;br /&gt;
local articles_using_layurl_t = data.articles_using_layurl;&lt;br /&gt;
local wp_med_articles_t = data.wp_med_articles;&lt;br /&gt;
local wp_med_articles_using_layurl_t = {};&lt;br /&gt;
local get_args = require (&amp;#039;Module:Arguments&amp;#039;).getArgs;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; M A I N &amp;gt;----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
For each article title in articles_using_layurl_t look for that article title in the selected wp:med articles list.&lt;br /&gt;
If found add the article title to wp_med_articles_using_layurl_t sequence table.&lt;br /&gt;
&lt;br /&gt;
There are three wp:med article lists:&lt;br /&gt;
	all wp:med articles (Category:All WikiProject Medicine articles)&lt;br /&gt;
	all wp:med fa articles (Category:FA-Class medicine articles)&lt;br /&gt;
	all wp:med ga articles (Category:GA-Class medicine articles)&lt;br /&gt;
	&lt;br /&gt;
{{#invoke:Sandbox/trappist_the_monk/layurl|main|list=|fa=|ga=}}&lt;br /&gt;
	|list=yes – return an unordered list of wikilinked articles from the selected wp:med list that use |lay-url=&lt;br /&gt;
	|fa=yes – target list is wp_med_fa_articles&lt;br /&gt;
	|ga=yes – target list is wp_med_ga_articles&lt;br /&gt;
	when neither |fa=yes not |ga=yes then target list is wp_med_articles&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function main (frame)&lt;br /&gt;
	local args_t = get_args (frame);&lt;br /&gt;
	local list_t;																-- holds the chosen wp:med article list&lt;br /&gt;
	&lt;br /&gt;
	if &amp;#039;yes&amp;#039; == args_t.fa then&lt;br /&gt;
		list_t = data.wp_med_fa_articles;										-- use the featured articles list&lt;br /&gt;
	elseif &amp;#039;yes&amp;#039; == args_t.ga then&lt;br /&gt;
		list_t = data.wp_med_ga_articles;										-- use the good articles list&lt;br /&gt;
	else&lt;br /&gt;
		list_t = data.wp_med_articles;											-- use the list of all wp:med articles&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for title, _ in pairs (articles_using_layurl_t) do							-- get next title from &amp;lt;articles_using_layurl_t&amp;gt;&lt;br /&gt;
		if list_t[title] then													-- is &amp;lt;title&amp;gt; in selected wp:med &amp;lt;list_t&amp;gt;?&lt;br /&gt;
			title = &amp;#039;*[[&amp;#039; .. title .. &amp;#039;]]&amp;#039;;										-- yes, make a wikilink with unordered=list markup&lt;br /&gt;
			table.insert (wp_med_articles_using_layurl_t, title);				-- add wikilinked &amp;lt;title&amp;gt; to &amp;lt;wp_med_articles_using_layurl_t&amp;gt;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if &amp;#039;yes&amp;#039; == args_t[&amp;#039;list&amp;#039;] then&lt;br /&gt;
		table.sort (wp_med_articles_using_layurl_t);							-- sort the results&lt;br /&gt;
		return table.concat (wp_med_articles_using_layurl_t, &amp;#039;\n&amp;#039;);				-- return an unordered list of article titles&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return #wp_med_articles_using_layurl_t;										-- return the total number of titles found&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T &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>imported&gt;Legoktm</name></author>
	</entry>
</feed>