<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Modul:Sandbox/Nihiltres/Category manager/doc - Oʻzgarishlar tarixi</title>
		<link>https://ziyosfera.uz/index.php?title=Modul:Sandbox/Nihiltres/Category_manager/doc&amp;action=history</link>
		<description>Ziyosferadagi mazkur sahifaning oʻzgarishlar tarixi</description>
		<language>uz</language>
		<generator>MediaWiki 1.45.1</generator>
		<lastBuildDate>Thu, 19 Nov 2026 08:21:53 GMT</lastBuildDate>
		<item>
			<title>Programmer: Oʻzbekcha Vikipediyadan import qilindi.</title>
			<link>https://ziyosfera.uz/index.php?title=Modul:Sandbox/Nihiltres/Category_manager/doc&amp;diff=110369&amp;oldid=prev</link>
			<guid isPermaLink="false">https://ziyosfera.uz/index.php?title=Modul:Sandbox/Nihiltres/Category_manager/doc&amp;diff=110369&amp;oldid=prev</guid>
			<description>&lt;p&gt;Oʻzbekcha Vikipediyadan import qilindi.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Yangi sahifa&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Module rating|beta}}&lt;br /&gt;
&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This module implements a simple tool for managing category output in modules.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
The module cannot be used from wikitext. It can be imported to another module using code similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;local catMan = require(&amp;quot;Module:Category manager&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Category-list table format===&lt;br /&gt;
Each function in the module takes a table as its first parameter, and that table is used as the list of categories. These tables are assumed to only be manipulated by this module&amp;#039;s functions, but there is no protection against external manipulation; there&amp;#039;s just basic type/value validation. Each item in a category-list table has its category name (without prefix) as its key; duplicate categories are therefore impossible. Values for each key can either be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (no sort key) or a string containing that sort key. A &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; value or any other type of value will cause errors. There are three functions for manipulating a category list table, and their individual documentation follows.&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
&lt;br /&gt;
===addCategory===&lt;br /&gt;
Usage:&lt;br /&gt;
* &amp;lt;code&amp;gt;catMan.addCategory(catList, name)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;catMan.addCategory(catList, name, sortKey)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;addCategory&amp;lt;/code&amp;gt; function adds a category by setting the key from &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;catList&amp;lt;/code&amp;gt; table to either &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or the provided &amp;lt;code&amp;gt;sortKey&amp;lt;/code&amp;gt; value if present.&lt;br /&gt;
&lt;br /&gt;
If an existing category is added a second time, its value will be overwritten with the new value; for this reason the module does not include a separate function for setting sort keys.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;catList&amp;lt;/code&amp;gt; parameter must be a table, the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; parameter must be a non-empty, non-whitespace string, and &amp;lt;code&amp;gt;sortKey&amp;lt;/code&amp;gt; must be either a string or nil.&lt;br /&gt;
&lt;br /&gt;
===removeCategory===&lt;br /&gt;
Usage:&lt;br /&gt;
* &amp;lt;code&amp;gt;catMan.removeCategory(catList, name)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;removeCategory&amp;lt;/code&amp;gt; function removes a category by setting the key from &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; to nil in the &amp;lt;code&amp;gt;catList&amp;lt;/code&amp;gt; table.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;catList&amp;lt;/code&amp;gt; parameter must be a table, and the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; parameter must be a non-empty, non-whitespace string.&lt;br /&gt;
&lt;br /&gt;
===writeCategoryList===&lt;br /&gt;
Usage:&lt;br /&gt;
* &amp;lt;code&amp;gt;catMan.writeCategoryList(catList)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;catMan.writeCategoryList(catList, nullify)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writeCategoryList&amp;lt;/code&amp;gt; function produces a string containing all the categories in the table formatted as wikitext. Optionally, a boolean &amp;lt;code&amp;gt;nullify&amp;lt;/code&amp;gt; parameter may be provided, and if true, it will cause the function to output an empty string. This is useful as it makes it easy to disable category output through a parameter, probably in conjunction with [[Module:Yesno]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;catList&amp;lt;/code&amp;gt; parameter must be a table formatted according to the category-list table format, and the &amp;lt;code&amp;gt;nullify&amp;lt;/code&amp;gt; parameter must be either a boolean or nil.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox ||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Turkum:Lua metamodullari]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</description>
			<pubDate>Thu, 06 Aug 2026 12:11:59 GMT</pubDate>
			<dc:creator>Programmer</dc:creator>
			<comments>https://ziyosfera.uz/ziyo/Modul_munozarasi:Sandbox/Nihiltres/Category_manager/doc</comments>
		</item>
</channel></rss>