Module:Sandbox/trappist the monk/layurl explained

require ('strict');

local data=mw.loadData ('Module:Sandbox/trappist the monk/layurl/data');local articles_using_layurl_t = data.articles_using_layurl;local wp_med_articles_t = data.wp_med_articles;local wp_med_articles_using_layurl_t = ;local get_args = require ('Module:Arguments').getArgs;

--main|list=|fa=|ga=}} |list=yes – return an unordered list of wikilinked articles from the selected wp:med list that use |lay-url= |fa=yes – target list is wp_med_fa_articles |ga=yes – target list is wp_med_ga_articles when neither |fa=yes not |ga=yes then target list is wp_med_articles

local function main (frame) local args_t = get_args (frame); local list_t; -- holds the chosen wp:med article list if 'yes'

args_t.fa then list_t = data.wp_med_fa_articles; -- use the featured articles list elseif 'yes'

args_t.ga then list_t = data.wp_med_ga_articles; -- use the good articles list else list_t = data.wp_med_articles; -- use the list of all wp:med articles end

for title, _ in pairs (articles_using_layurl_t) do -- get next title from if list_t[title] then -- is in selected wp:med <list_t>? title = '*' .. title .. ''; -- yes, make a wikilink with unordered=list markup table.insert (wp_med_articles_using_layurl_t, title); -- add wikilinked <title> to <wp_med_articles_using_layurl_t> end end</p> <p>if 'yes'</p> <h2>args_t['list'] then table.sort (wp_med_articles_using_layurl_t); -- sort the results return table.concat (wp_med_articles_using_layurl_t, '\n'); -- return an unordered list of article titles end return #wp_med_articles_using_layurl_t; -- return the total number of titles foundend</h2> <p>----------------------------< E X P O R T >------------------------------------------------------------------</p> <p>return</p><div class="Footer"> <div class="robots-noindex"><p>This article is licensed under the <a href="http://www.gnu.org/copyleft/fdl.html" rel="nofollow">GNU Free Documentation License</a>. It uses material from the Wikipedia article "<a href="http://en.wikipedia.org/wiki/Module%3aSandbox%2ftrappist_the_monk%2flayurl" rel="nofollow">Module:Sandbox/trappist the monk/layurl</a>".</p></div> <p>Except where otherwise indicated, Everything.Explained.Today is © Copyright 2009-2024, A B Cryer, All Rights Reserved. <a href="http://explained.today/cookie_policy.htm">Cookie policy</a>.</p> </div> </div> </body> </html>