Jump to content

Module:BP: Difference between revisions

No change in size ,  28 February 2022
m
→‎top: robot:, replaced: WP: → BP: (7)
(Created page with "require('Module:No globals'); local getArgs = require ('Module:Arguments').getArgs; local mRedirect = require ('Module:Redirect') local namespaces = { -- incl...")
 
m (→‎top: robot:, replaced: WP: → BP: (7))
 
Line 137: Line 137:
local function tooltip_make (title_param, nutshell, frag_flag)
local function tooltip_make (title_param, nutshell, frag_flag)
return table.concat ({
return table.concat ({
title_param, -- the tooltip prefix (usually WP: article name)
title_param, -- the tooltip prefix (usually BP: article name)
('' ~= nutshell and ' in a nutshell: ' or ''), -- when there is nutshell text
('' ~= nutshell and ' in a nutshell: ' or ''), -- when there is nutshell text
nutshell,
nutshell,
(frag_flag and ' (subsection link)' or ''), -- when WP: article name has a fragment
(frag_flag and ' (subsection link)' or ''), -- when BP: article name has a fragment
});
});
end
end
Line 150: Line 150:
so that this function has access to frame:preprocess()
so that this function has access to frame:preprocess()


shortcut is shortcut name with a namespace prefix (WP:BOLD, MOS:MED, H:CS1, etc)
shortcut is shortcut name with a namespace prefix (BP:BOLD, MOS:MED, H:CS1, etc)


]]
]]
Line 160: Line 160:
local c; -- general purpose var holds the tally of gsub() replacements made when needed
local c; -- general purpose var holds the tally of gsub() replacements made when needed
local title_param; -- {{nutshell}} |title= parameter contents and value used in tooltip rendering
local title_param; -- {{nutshell}} |title= parameter contents and value used in tooltip rendering
local frag_flag; -- boolean set true when normalized page name has a fragment (WP:<page title>#<anchor name>)
local frag_flag; -- boolean set true when normalized page name has a fragment (BP:<page title>#<anchor name>)


content, msg = get_content (shortcut, 'shortcut'); -- get content of shortcut redirect page
content, msg = get_content (shortcut, 'shortcut'); -- get content of shortcut redirect page
Line 240: Line 240:
template entry point
template entry point


{{#invoke:Nutshell|main|<shortcut>}} where <shortcut> is shortcut name with or without namespace prefix; BOLD or WP:BOLD
{{#invoke:Nutshell|main|<shortcut>}} where <shortcut> is shortcut name with or without namespace prefix; BOLD or BP:BOLD


]]
]]
Line 262: Line 262:
end
end
else
else
shortcut = 'WP:' .. shortcut; -- add WP: namespace
shortcut = 'BP:' .. shortcut; -- add BP: namespace
end
end


Bots, trusted
7,437

edits