Module:Format link: Difference between revisions
Content added Content deleted
(Presumably doesn't work yet, but … basic code copied from Module:Hatnote, which includes contributions from Mr. Stradivarius, SMcCandlish, Codename Lisa, Ahecht, Qed237, Nihiltres, JJMC89, Pppery, and Izno.) |
(Further copied getArgs from Module:Hatnote and organized into helper and main functions) |
||
Line 13: | Line 13: | ||
local yesno -- lazily initialise [[Module:Yesno]] |
local yesno -- lazily initialise [[Module:Yesno]] |
||
⚫ | |||
⚫ | |||
⚫ | |||
-------------------------------------------------------------------------------- |
|||
⚫ | |||
-- Helper functions |
|||
⚫ | |||
-------------------------------------------------------------------------------- |
|||
⚫ | |||
⚫ | |||
local function getArgs(frame) |
|||
⚫ | |||
-- Fetches the arguments from the parent frame. Whitespace is trimmed and |
|||
⚫ | |||
-- blanks are removed. |
|||
⚫ | |||
mArguments = require('Module:Arguments') |
|||
⚫ | |||
return mArguments.getArgs(frame, {parentOnly = true}) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
end |
end |
||
Line 84: | Line 77: | ||
section = section, |
section = section, |
||
display = display, |
display = display, |
||
⚫ | |||
end |
|||
-------------------------------------------------------------------------------- |
|||
-- Main functions |
|||
-------------------------------------------------------------------------------- |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
local link = args[1] |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
} |
||
end |
end |