Module:Main: Difference between revisions
Content added Content deleted
(unpack the table used for formatPageTables) |
(update after changes to Module:Hatnote) |
||
Line 27: | Line 27: | ||
end |
end |
||
pages = mTableTools.compressSparseArray(pages) |
pages = mTableTools.compressSparseArray(pages) |
||
local options = { |
|||
⚫ | |||
selfref = args.selfref |
|||
} |
|||
⚫ | |||
end |
end |
||
function p._main(...) |
function p._main(options, ...) |
||
-- Get the list of pages. If no first page was specified we use the current |
-- Get the list of pages. If no first page was specified we use the current |
||
-- page name. |
-- page name. |
||
Line 46: | Line 49: | ||
-- Find the pagetype. |
-- Find the pagetype. |
||
local firstPageNs = mHatnote. |
local firstPageNs = mHatnote.findNamespaceId(firstPage) |
||
local pagetype = firstPageNs == 0 and 'article' or 'page' |
local pagetype = firstPageNs == 0 and 'article' or 'page' |
||
-- Make the formatted link text |
-- Make the formatted link text |
||
local links = mHatnote. |
local links = mHatnote.formatPageTables(unpack(pages)) |
||
links = mw.text.listToText(links) |
links = mw.text.listToText(links) |
||
Line 75: | Line 78: | ||
local text = string.format(stringToFormat, pagetype, links) |
local text = string.format(stringToFormat, pagetype, links) |
||
-- |
-- Process the options and pass the text to the _rellink function in |
||
-- [[Module:Hatnote]]. |
|||
⚫ | |||
options = options or {} |
|||
⚫ | |||
local hnOptions = { |
|||
⚫ | |||
selfref = options.selfref |
|||
} |
|||
⚫ | |||
end |
end |
||