Bots, trusted
7,437
edits
(Created page with "require('Module:No globals'); local getArgs = require ('Module:Arguments').getArgs; local mRedirect = require ('Module:Redirect') local namespaces = { -- incl...") |
WikiDwarfBOT (talk | contribs) 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 | 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 | (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 ( | 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 ( | 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 | {{#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 = ' | shortcut = 'BP:' .. shortcut; -- add BP: namespace | ||
end | end | ||