![]() | This module is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure. |
Eventually I want the loose equivalent of a {{xsign}} for all the different special-link-templates I use (I tend to avoid the external link syntax). The end goal is to be able to say something like {{subst:xlink|URL here}}
, and depending on the pattern the URL matches it would emit wikitext (assuming substitution works out well—I wouldn't be surprised if it's impossible) for either {{diff2}}, {{diff4}}, {{oldid}}, and others as time goes on.
Small shorter-term TODO:
[DiffURL label]
, emit {{diff2|id|label}}
[DiffURL#section label]
, emit {{diff2|id|section|label}}
oldid=prev
.oldid
is present.
Longer-term TODO:
local p = {}
local prevDiffStart = "https://en%.wikipedia%.org/w/index%.php%?title=.-&diff=prev&"
function p.xlink(frame)
-- https://en.wikipedia.org/w/index.php?title=User_talk:Perryprog&diff=prev&oldid=999347924&diffmode=source
-- Should become {{diff2|999347924}}
local match = string.match(frame.args[1], prevDiffStart .. "oldid=(%d+)")
return frame:expandTemplate({title = "Diff2", args = {match}})
end
return p