Module:ManualDescriptions

From August Wiki
Revision as of 06:16, 16 August 2025 by Steve (talk | contribs) (Created page with "-- Module:ItemDescriptions -- Create this as a MediaWiki page that contributors can edit directly local p = {} -- Editable data table - contributors modify this directly local descriptions = { ["Bronze sword"] = { description = "A basic bronze weapon perfect for new warriors starting their adventure.", contributor = "Steve", date_updated = "2025-01-15" }, ["Iron ore"] = { description = "Raw iron that can be smelted into useful...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:ManualDescriptions/doc

-- Module:ItemDescriptions
-- Create this as a MediaWiki page that contributors can edit directly
local p = {}

-- Editable data table - contributors modify this directly
local descriptions = {
    ["Bronze sword"] = {
        description = "A basic bronze weapon perfect for new warriors starting their adventure.",
        contributor = "Steve",
        date_updated = "2025-01-15"
    },
    ["Iron ore"] = {
        description = "Raw iron that can be smelted into useful bars for smithing.",
        contributor = "Steve", 
        date_updated = "2025-01-14"
    }
    -- Contributors add new items here by editing this page
}

function p.getDescription(frame)
    local itemName = frame.args[1] or ""
    local item = descriptions[itemName]
    
    if item then
        return string.format('%s <small>(Updated by [[User:%s|%s]] on %s)</small>', 
                           item.description, item.contributor, item.contributor, item.date_updated)
    end
    
    return string.format("''No description available for %s. Please edit [[Module:ItemDescriptions]] to add one.''", itemName)
end

return p