Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/trappist the monk/layurl
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
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; --[[--------------------------< M A I N >---------------------------------------------------------------------- For each article title in articles_using_layurl_t look for that article title in the selected wp:med articles list. If found add the article title to wp_med_articles_using_layurl_t sequence table. There are three wp:med article lists: all wp:med articles (Category:All WikiProject Medicine articles) all wp:med fa articles (Category:FA-Class medicine articles) all wp:med ga articles (Category:GA-Class medicine articles) {{#invoke:Sandbox/trappist_the_monk/layurl|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 <articles_using_layurl_t> if list_t[title] then -- is <title> 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 if 'yes' == 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 found end --[[--------------------------< E X P O R T >------------------------------------------------------------------ ]] return { main = main, }
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/trappist the monk/layurl/doc
(
edit
)