--------------------------------------------------------------------------------- Category class-- This module makes a Category class for use in [[Module:Article history]].-- It provides a unified interface for the creation of category links. With-- this class, categories can passed between objects without concerns about-- interoperability and still have their values and sort keys easily-- accessible.-------------------------------------------------------------------------------localcheckType=require('libraryUtil').checkTypelocalCATEGORY_NS_TEXT=mw.site.namespaces[14].namelocalCategory={}Category.__index=CategoryfunctionCategory.new(category,sortKey)checkType('Category.new',1,category,'string')checkType('Category.new',2,sortKey,'string',true)localobj=setmetatable({},Category)obj.category=categoryobj.sortKey=sortKeyreturnobjendfunctionCategory:__tostring()ifself.sortKeythenreturnstring.format('[[%s:%s|%s]]',CATEGORY_NS_TEXT,self.category,self.sortKey)elsereturnstring.format('[[%s:%s]]',CATEGORY_NS_TEXT,self.category)endendreturnCategory