Module:category tree/poscatboiler/data/modules

local labels = {} local raw_categories = {} local raw_handlers = {}

- --                                                                        -- --                                  LABELS                                 -- --                                                                        -- -

labels["modules"] = { description = " modules, which contain Lua code to create and manage entries.", umbrella = { parents = , breadcrumb = "by language", },	parents = , }

labels["data modules"] = { description = " modules containing data used by other modules.", umbrella = { parents = , breadcrumb = "by language", },	breadcrumb = "data", parents = {"modules"}, }

labels["dialect synonyms data modules"] = { description = " modules containing data used by dialect synonyms.", umbrella = { parents = , breadcrumb = "by language", },	breadcrumb = "dialect synonyms", parents = {"data modules"}, }

labels["inflection modules"] = { description = " inflection modules, which contain Lua code for generating conjugation and declension tables.", umbrella = { parents = , breadcrumb = "by language", },	breadcrumb = "inflection", parents = {"modules"}, }

labels["testcase modules"] = { description = " testcase modules, which contain Lua code for testing other modules.", umbrella = { parents = , breadcrumb = "by language", },	breadcrumb = "testcase", parents = {"modules"}, }

- --                                                                        -- --                              RAW CATEGORIES                             -- --                                                                        -- -

--[=[ Correctly defining a new module type here: 1. The breadcrumb generally does not need to be given because there is code at the bottom of this file to generate the breadcrumb in a smart fashion by chopping off a suffix derived from the parent or any of  its ancestors. 2. Module types can be nested under other module types, but also list them directly under 'Modules' as a  secondary parent. (This violates a principle of non-duplication of categories but makes it much easier to  locate a given module type.) ]=]

raw_categories["Modules"] = { description = "This is a general holder category for modules.", additional = "For more information on what modules are and how they work, see Scribunto. For a complete list of all modules, see here.", parents = {"Category:Wiktionary"}, }

raw_categories["Uncategorized modules"] = { description = "Uncategorized modules.", additional = "Modules are placed here by Module:documentation under certain circumstances. See the documentation of that module for more info.", parents = { {name = "Modules", sort = " "} }, }

raw_categories["Appendix modules"] = { preceding = "", description = "Modules with functions that generate content for or extract information from pages in the Appendix namespace.", parents = { "Modules" }, }

raw_categories["Bot support modules"] = { description = "Modules for supporting individual bot accounts.", parents = { "Modules" }, }

raw_categories["Category modules"] = { preceding = "", description = "Modules for adding categories to pages or generating the description and subcategories of category pages.", parents = { "Modules" }, }

raw_categories["Character info modules"] = { preceding = "", description = "Modules containing information on individual characters, or containing functions generating such information.", parents = { "Modules" }, }

raw_categories["Character insertion modules"] = { preceding = "", description = "Modules that implement templates that provide easier ways to type characters that are not found in most keyboard layouts.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Collections modules"] = { description = "Modules containing functions used to implement collections (arrays, maps, etc.).", parents = { "Utility modules", "Modules" }, }

raw_categories["Data modules"] = { description = "Modules that do not contain functions, but only export a table of data that is used by other modules.", additional = "Modules that are in this category should be imported using  rather than  .", parents = { "Modules" }, }

raw_categories["Character insertion data modules"] = { preceding = "", description = "Modules containing data for use by .", parents = { "Data modules", "Character insertion modules" }, }

raw_categories["Dialect synonyms data modules"] = { preceding = "", description = "Modules containing data for use by dialect synonyms.", parents = { "Data modules" }, }

raw_categories["Date modules"] = { description = "Modules that implement functionality to convert or otherwise manipulate dates in various calendar systems.", parents = { "Utility modules", "Modules" }, }

raw_categories["Debugging modules"] = { description = "Modules used for debugging.", additional = "Some should only be used in sandbox modules or when using the " .. "mw:Extension:TemplateSandbox button in the edit page of modules and templates.", parents = { "Modules" }, }

raw_categories["Definition modules"] = { preceding = "", description = "Modules that implement templates used in definition lines of entries.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Deprecated modules"] = { description = "Modules that should not be used, as their functions are performed by newer modules.", parents = { "Modules", "Category:Wiktionary maintenance" }, }

raw_categories["Discussion modules"] = { preceding = "", description = "Modules concerning discussion pages.", parents = { "Modules" }, }

raw_categories["Display text-generating modules"] = { description = "Modules that are used to generate display text.", additional = "Display text determines what is shown to the reader. In some languages it must be normalized, " .. "due to common errors caused by confusable characters, or so as to ensure a consistent display format.", parents = { "Modules" }, }

raw_categories["Documentation modules"] = { preceding = "", description = "Modules for generating documentation pages.", parents = { "Modules" }, }

raw_categories["Encoding modules"] = { description = "Modules for converting between different textual encodings.", parents = { "Utility modules", "Modules" }, }

raw_categories["Entry-generating modules"] = { preceding = "", description = "Modules with functions that are used to generate new entries.", parents = { "Modules" }, }

raw_categories["Entry name-generating modules"] = { description = "Modules that generate entry names, which typically have certain diacritics stripped compared with the form in links and headwords.", parents = { "Modules" }, }

raw_categories["External link modules"] = { preceding = "", description = "Modules that are used in external link templates, i.e. which link to websites outside of the MediaWiki Foundation purview.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Etymology modules"] = { preceding = "", description = "Modules that implement templates that define the etymology of entries.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Form-of modules"] = { preceding = "", description = "Modules that generate the definition line of non-lemma forms, e.g. verb forms and noun forms.", parents = { "Definition modules", "Page generation modules", "Modules" }, }

raw_categories["Headword-line modules"] = { preceding = "", description = "Modules that support headword-line templates for a specific language.", additional = "See also Category:Headword-line templates.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Inflection modules"] = { description = "Modules used to support inflection templates for a specific language.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Internal link modules"] = { preceding = "", description = "Modules that are used in internal link templates, i.e. which link between Wiktionary entries.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Interwiki modules"] = { preceding = "", description = "Modules that are used in interwiki templates, i.e. which link to other MediaWiki projects.", parents = { "Page generation modules", "Modules" }, }

raw_categories["JSON-generating modules"] = { description = "Modules with functions that generate data in JSON format.", parents = { "Modules" }, }

raw_categories["Language and script modules"] = { description = "Modules that process language and script codes and return data on them.", parents = { "Modules" }, }

raw_categories["List modules"] = { preceding = "", description = "Modules that generate lists, tables or tree diagrams of entries or other structured data.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Maintenance modules"] = { preceding = "", description = "Modules that implement templates used for maintaining entries.", additional = "Examples are cleanup templates (e.g. attention), deletion templates (e.g. rfd) and " .. "verification templates (e.g. rfv).", parents = { "Modules" }, }

raw_categories["Number modules"] = { preceding = "", description = "Modules that handle conversion and/or formatting of numbers and numerals in various representations.", parents = { "Utility modules", "Modules" }, }

raw_categories["Page generation modules"] = { description = "Modules that generate parts of a mainspace page (e.g. headword line, definition, inflection, links, etc.).", parents = { "Modules" }, }

raw_categories["Parameter parsing modules"] = { description = "Modules containing functions used to parse template parameters.", parents = { "Utility modules", "Modules" }, }

raw_categories["Pronunciation modules"] = { preceding = "", description = "Modules that implement templates used to create the language-specific pronunciation of entries.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Pronunciation testcase modules"] = { description = "Modules used to test other pronunciation modules.", parents = { "Testcase modules", {name = "Pronunciation modules", sort = "Testcase"} }, }

raw_categories["Quotation and usage example modules"] = { description = "Modules that implement templates used to format quotations and usage examples.", parents = { "Definition modules", "Page generation modules", "Modules" }, }

raw_categories["Reference modules"] = { preceding = "", description = "Modules that are used for reference templates.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Sandbox modules"] = { description = "Test versions of modules intended for production use.", parents = { "Modules" }, }

raw_categories["Semantic relation modules"] = { preceding = "", description = "Modules that implement templates used to indicate other terms semantically related to a " .. "particular sense, e.g. synonyms or antonyms.", parents = { "Page generation modules", "Modules" }, }

raw_categories["Sortkey-generating modules"] = { description = "Modules that generate sortkeys, which determine the order of entry names in categories.", parents = { "Modules" }, }

raw_categories["String modules"] = { description = "Modules containing functions used to manipulate strings.", parents = { "Utility modules", "Modules" }, }

raw_categories["Swadesh modules"] = { description = "Modules containing Swadesh lists.", parents = { "Modules" }, }

raw_categories["Template interface modules"] = { description = "Modules whose purpose is to provide an interface between templates and the functions of a module.", additional = "They are usually named, and the functions present within them usually all " .. "have only a \"frame\" parameter.", parents = { "Modules" }, }

raw_categories["Testcase modules"] = { description = "Modules used to test other modules.", parents = { "Modules" }, }

raw_categories["Failing testcase modules"] = { description = "Modules which contain failures in their unit tests.", additional = "This category is added automatically by Module:UnitTests when a test case fails.", parents = { "Testcase modules" }, }

raw_categories["Tracking modules"] = { description = "Modules that add tracking templates.", parents = { "Debugging modules", "Modules" }, }

raw_categories["Transliteration modules"] = { description = "Modules that automatically convert text in one script to another.", additional = "Most of them convert non-Latin scripts to Latin (romanisation/romanization), and are used by " .. "templates or modules to generate transliteration of text that is tagged with a particular language. Each " .. "language's transliteration module is specified in its data table (for which, see the category ).", parents = { "Modules" }, }

raw_categories["Transliteration testcase modules"] = { description = "Modules used to test other transliteration modules.", parents = { "Testcase modules", {name = "Transliteration modules", sort = "Testcase"} }, }

raw_categories["Unused modules"] = { description = "Unused modules.", parents = { "Modules" }, }

raw_categories["User sandbox modules"] = { description = "Modules that are for personal use and testing by individual editors.", additional = "These should all begin with  followed by the user's name. If several " .. "sandbox modules are needed by a single user, subpages can be created. These modules should not be used in real " .. "Wiktionary content pages, as all content on those pages should be editable by anyone and, if necessary, edit protected.", parents = { "Sandbox modules", "Modules" }, }

raw_categories["Utility modules"] = { description = "Modules that serve some sort of utility purpose in various entries.", additional = "Avoid categorizing directly into this category, but use one of the more specific (and semantically " ..	"well-defined) module categories. Note also that modules used by multiple languages should go directly in this " .. "category if necessary, while modules only used by one language should be in Category:Language-specific utility modules.", parents = { "Modules" }, }

raw_categories["Language-specific utility modules"] = { description = "Modules that deal with several utilities needed by a certain language.", additional = "Usually their names end with or  (preceded by the language code), " .. "although more specific utility modules that one language uses may reside here as well. If a utility is used by " .. "many languages, it should be in Category:Utility modules.", parents = , }

raw_categories["Vote modules"] = { description = "Modules used to manage Wiktionary votes.", parents = { "Modules" }, }

raw_categories["Wikitext parsing modules"] = { description = "Modules that contain functions that grab the wikitext of a page and get information from it by " .. "performing string operations on it.", parents = { "Modules" }, }

-- Don't modify `raw_categories` while processing it, or items may be skipped. local new_cats = {} for raw_cat, obj in pairs(raw_categories) do local by_script = raw_cat .. " by script" if raw_cat ~= "Modules" and raw_cat ~= "Data modules" and not raw_categories[by_script] then new_cats[by_script] = { description = raw_cat .. ", categorized by the script they operate on or with.", additional = raw_cat .. " are " .. mw.getContentLanguage:lcfirst(obj.description), breadcrumb = "by script", parents = , }	end end for new_cat, obj in pairs(new_cats) do	raw_categories[new_cat] = obj end

- --                                                                        -- --                                RAW HANDLERS                             -- --                                                                        -- -

for _, mod_type in ipairs { "Entry name-generating", "Sortkey-generating", "Transliteration" } do	table.insert(raw_handlers, function(data)		local count, languages = data.category:match(("^%s modules used by ([0-9]+) (languages?)$"):format(			-- need to escape the hyphen in 'Entry name-generating' and 'Sortkey-generating'			require("Module:string utilities").pattern_escape(mod_type)))		if count then			return {				description = data.category .. ".",				breadcrumb = "used by " .. count .. " " .. languages,				parents = {					{ name = mod_type .. " modules", sort = count },				},			}		end	end) end

-- Add breadcrumb by chopping off the parent (or the parent's parent, etc.) from the end of the label, if possible. for key, data in pairs(raw_categories) do	if not data.breadcrumb then local parent = data.parents[1] while true do			if type(parent) == "string" then local parent_re = " " .. require("Module:string utilities").pattern_escape(mw.getContentLanguage:lcfirst(parent)) .. "$"				if key:find(parent_re) then data.breadcrumb = key:gsub(parent_re, "") break end if raw_categories[parent] then parent = raw_categories[parent].parents[1] else break end else break end end end end

return {LABELS = labels, RAW_CATEGORIES = raw_categories, RAW_HANDLERS = raw_handlers}