<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.xen.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ganaram+inukshuk</id>
	<title>Xenharmonic Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.xen.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ganaram+inukshuk"/>
	<link rel="alternate" type="text/html" href="https://en.xen.wiki/w/Special:Contributions/Ganaram_inukshuk"/>
	<updated>2026-07-19T03:40:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk&amp;diff=223418</id>
		<title>User:Ganaram inukshuk</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk&amp;diff=223418"/>
		<updated>2026-02-06T11:14:36Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I generally go by &amp;quot;Ganaram&amp;quot; or some variant of that (ganaram_inukshuk, gdinuk). (Discord: ganaraminukshuk0; he/they; generally more active on the Xen Discord unless work bogs me down.)&lt;br /&gt;
&lt;br /&gt;
I&#039;ve heard about microtonality on and off over the years, but what drew me into the topic was two things: HEHEHE I AM A SUPAHSTAR SAGA&#039;s video series on 19edo and Patricia Taxxon&#039;s song Spiral Staircase.&lt;br /&gt;
&lt;br /&gt;
From a compositional perspective, my goal is to incorporate xenharmonic elements into an otherwise normal-sounding song, though my more ambitious goal is to not use the diatonic (LLLsLLs) scale structure at all.&lt;br /&gt;
&lt;br /&gt;
From a theory perspective, my goal is to better understand xenharmony from a temperament-agnostic perspective. This primarily means edos and MOSses, but extends to MV3 scales and higher.&lt;br /&gt;
&lt;br /&gt;
From a wikian perspective, my goal is to better the wiki itself, at least as it pertains to how mos-related info is displayed. The most immediate way to achieve this is to create and deploy templates for the most commonly displayed mos-related info, as well as wikifying any text present (so it looks like an actual wiki page!) and trying to verify the source or attribution to things taken for granted (because misattribution happens concerningly). I&#039;ve written a style guide to be applied to all mos pages (see subpages below), but I&#039;m also open to better ideas.&lt;br /&gt;
&lt;br /&gt;
== Main mindset ==&lt;br /&gt;
I summarize my main mindset using the following trinity: &#039;&#039;&#039;temperaments, mosses, and edos are not each other&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Temperaments produce mosses, but two different temperaments may produce the same mos. Edos support more than one family of mos, so it&#039;s fruitless to shoehorn the notation meant for one mos for a different mos within the same edo. Two temperaments may produce the same JI ratio, but have different qualities in different mosses.&lt;br /&gt;
&lt;br /&gt;
This level of decoupling makes it so I don&#039;t let any one temperament, mos, or edo influence how I look at either. Just because a nondiatonic mos has a perfect 5th doesn&#039;t mean I should think of it as such, especially if that isn&#039;t the generator to begin with.&lt;br /&gt;
&lt;br /&gt;
That said, I focus more on mosses and, secondarily, edos when it comes to this trinity. I prefer to look at scales based in a temperament-agnostic sense, as mosses that are supported by an edo, or different edos. Doing so relieves me of the expectation that a certain interval must necessarily fall within a few cents of a [[Just intonation|JI]] ratio and lets me be more explorative with musical scales. This is also less names to memorize, since there are a lot of temperament names, and looking at mosses directly means fewer names to remember.&lt;br /&gt;
&lt;br /&gt;
Other running assumptions and techniques may be found under the methodologies page below.&lt;br /&gt;
&lt;br /&gt;
== TO-DO list, major contributions, and wish list ==&lt;br /&gt;
=== Contributions ===&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;font-size: 105%; white-space: nowrap;&amp;quot; | Major work on modules and templates in (roughly) chronological order of inception or involvement&lt;br /&gt;
|-&lt;br /&gt;
! Modules and templates&lt;br /&gt;
! New?&lt;br /&gt;
! Description of template or contribution&lt;br /&gt;
! Status or todo&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:SB tree]]&lt;br /&gt;
[[Template:SB tree]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Creates a Stern-Brocot tree&#039;s entries and their depths.&lt;br /&gt;
| Fallen into disuse.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Scale tree|&amp;lt;s&amp;gt;Module:Scale tree&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:Scale tree|&amp;lt;s&amp;gt;Template:Scale tree&amp;lt;/s&amp;gt;]]&lt;br /&gt;
| No&lt;br /&gt;
| Automates the creation of a mos&#039;s scale tree and tuning spectrum.&lt;br /&gt;
Contributor with CompactStar. (I made it so comments can be entered using one param.)&lt;br /&gt;
| &#039;&#039;&#039;Deprecated, following changes that made it unmaintainable.&#039;&#039;&#039;&lt;br /&gt;
Superseded by Module:MOS tuning spectrum.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS modes]]&lt;br /&gt;
[[Template:MOS modes]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays the modes of a mos.&lt;br /&gt;
| Current means of row/col data is not ideal.&lt;br /&gt;
Further developments uncertain due to personal decision to halt further improvement.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS intro]]&lt;br /&gt;
[[Template:MOS intro]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Creates a consistent, common introductory paragraph for a mos page&#039;s lead section.&lt;br /&gt;
| &#039;&#039;&#039;Possibly rewrite to follow new coding conventions.&#039;&#039;&#039;&lt;br /&gt;
Rewording for nonoctave tunings.&lt;br /&gt;
&lt;br /&gt;
Deprecate name fields as they&#039;re redundant if used with Template:TAMNAMS name.&lt;br /&gt;
&lt;br /&gt;
Possible refactoring.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS gamut]]&lt;br /&gt;
[[Template:MOS gamut]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Given a notation scheme and assigned mode for a mos for an edo, display the note names.&lt;br /&gt;
| Fallen into disuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;[[Module:MOS degrees]]&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;s&amp;gt;[[Template:MOS degrees]]&amp;lt;/s&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays cent values for a mos for up to 5 step ratios.&lt;br /&gt;
| &#039;&#039;&#039;Deprecated, following decision to start over.&#039;&#039;&#039;&lt;br /&gt;
Superseded by Module:MOS tunings.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS notation]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Helper module for displaying mos notation.&lt;br /&gt;
| Fallen into disuse.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS intervals]]&lt;br /&gt;
[[Template:MOS intervals]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays the interval names of a mos and their cent ranges.&lt;br /&gt;
Rewritten to new coding conventions.&lt;br /&gt;
| Experiment with interval lookup.&lt;br /&gt;
&#039;&#039;&#039;REFACTOR.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS mode degrees]]&lt;br /&gt;
[[Template:MOS mode degrees]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays the qualities of each scale degree of every mode of a mos.&lt;br /&gt;
| &#039;&#039;&#039;Possibly rewrite to follow new coding conventions.&#039;&#039;&#039;&lt;br /&gt;
Split modmos info into its own template; see Template:MODMOS mode degrees.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REFACTOR.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS in EDO]]&lt;br /&gt;
[[Template:MOS in EDO]]&lt;br /&gt;
| Yes&lt;br /&gt;
|  rowspan=&amp;quot;4&amp;quot; | Displays and visualizes the mosses that an edo contains.&lt;br /&gt;
&lt;br /&gt;
* MOS in EDO: shows the mosses created using a particular generator and period.&lt;br /&gt;
* ...allgens: shows all mosses for all generators for a particular period.&lt;br /&gt;
* ...allperiods or MOSes in EDO: shows all mosses for all generators for all periods.&lt;br /&gt;
|  rowspan=&amp;quot;4&amp;quot; | &#039;&#039;&#039;To be rewritten as a subst-template.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS in EDO allgens]]&lt;br /&gt;
[[Template:MOS in EDO allgens]]&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS in EDO allperiods]]&lt;br /&gt;
[[Template:MOS in EDO allperiods]]&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOSes in EDO]] (shortcut template)&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Template input parse]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Helper module for various templates that have large amounts of info to be displayed.&lt;br /&gt;
| Possible reorganization?&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Step vis]]&lt;br /&gt;
[[Template:Step vis]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Step visualization template for MOS(es) in EDO for standalone use.&lt;br /&gt;
| Consider html-based visualization?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;[[Module:EDO intro]]&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;s&amp;gt;[[Template:EDO intro]]&amp;lt;/s&amp;gt;&lt;br /&gt;
| Yes (module only)&lt;br /&gt;
| Automation of the EDO intro.&lt;br /&gt;
| &#039;&#039;&#039;Deprecated.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Superseded by Module:ED intro.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;[[Module:JI ratio finder]]&amp;lt;/s&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| Helper module for JI ratios in ED. Superseded by Module:JI ratios.&lt;br /&gt;
| Fallen into disuse, but not officially deprecated.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:JI ratios in ED|&amp;lt;s&amp;gt;Module:JI ratios in ED&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:JI ratios in ED|&amp;lt;s&amp;gt;Template:JI ratios in ED&amp;lt;/s&amp;gt;]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Creates a table showing the JI ratios approximated by an ED.&lt;br /&gt;
| Fallen into disuse, as JI ratio finder was superseded.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Xenpaper]]&lt;br /&gt;
| Yes&lt;br /&gt;
| For making links to audio examples to be listened to.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:ED intro]]&lt;br /&gt;
[[Template:ED intro]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Automation of the EDO intro, generalized for other equaves.&lt;br /&gt;
| Possible code cleanup.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Idiosyncratic terms]]&lt;br /&gt;
| Yes&lt;br /&gt;
| An alternative to [[Template:Idiosyncratic]] when the original&#039;s use is infeasible.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Infobox MOS]]&lt;br /&gt;
[[Template:Infobox MOS]]&lt;br /&gt;
| No&lt;br /&gt;
| Code cleanup and additional info.&lt;br /&gt;
Moved 8-link infobox to infobox module.&lt;br /&gt;
| &#039;&#039;&#039;Possibly rewrite to follow new coding conventions.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Infobox]]&lt;br /&gt;
| No&lt;br /&gt;
| Support for infoboxes with 8 navlinks added.&lt;br /&gt;
| &#039;&#039;&#039;REFACTOR.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Keyboard vis]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Keyboard visualization template for Infobox MOS. No template currently exists.&lt;br /&gt;
| Possibly extend to ternary and quaternary scales.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Mbox]]&lt;br /&gt;
| No&lt;br /&gt;
| Added the option to show an icon.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Quickstart]]&lt;br /&gt;
[[Template:Has quickstart]]&lt;br /&gt;
| Yes&lt;br /&gt;
| For disambiguating pages meant for theory from pages meant for practice, and for linking between them.&lt;br /&gt;
| ROLLOUT.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS]]&lt;br /&gt;
| No&lt;br /&gt;
| Splitting TAMNAMS-related stuff to its own module.&lt;br /&gt;
Redefining the module into a library for all mos-related templates/modules.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:TAMNAMS]]&lt;br /&gt;
| Yes&lt;br /&gt;
| A module that contains the entire TAMNAMS specification as it pertains to mosses and step ratios.&lt;br /&gt;
Has lookup functions for names and related mosses.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:TAMNAMS use]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Shows that a scale page uses TAMNAMS.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS genchain]]&lt;br /&gt;
[[Template:MOS genchain]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Shows the generator chain of a mos.&lt;br /&gt;
| Dev on hold.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOS scale properties|&amp;lt;s&amp;gt;Template:MOS scale properties&amp;lt;/s&amp;gt;]] (former name)&lt;br /&gt;
|  rowspan=&amp;quot;2&amp;quot; | Yes&lt;br /&gt;
|  rowspan=&amp;quot;2&amp;quot; | Combo template of:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;s&amp;gt;Template:TAMNAMS use&amp;lt;/s&amp;gt;&lt;br /&gt;
* Template:MOS intervals&lt;br /&gt;
* Template:MOS genchain&lt;br /&gt;
* Template:MOS mode degrees&lt;br /&gt;
|  rowspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Deprecated, following changes that made it unmaintainable.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;No combo templates for mos pages.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS data|&amp;lt;s&amp;gt;Module:MOS data&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:MOS data|&amp;lt;s&amp;gt;Template:MOS data&amp;lt;/s&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:TAMNAMS lookup]]&lt;br /&gt;
[[Template:TAMNAMS lookup]]&lt;br /&gt;
| Yes&lt;br /&gt;
| TAMNAMS name lookup as a standalone template.&lt;br /&gt;
| Dev direction unclear.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:TAMNAMS name]]&lt;br /&gt;
| Yes&lt;br /&gt;
| For writing the paragraph that states a mos&#039;s TAMNAMS name and its etymology or reasoning.&lt;br /&gt;
| ROLLOUT.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS interval HE]]&lt;br /&gt;
[[Template:MOS interval HE]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Standalone template for harmonic entropy.&lt;br /&gt;
Formerly a part of MOS intervals; added by [[User:R-4981]] but separated due to concerns regarding HE.&lt;br /&gt;
| Further developments uncertain.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS tunings]]&lt;br /&gt;
[[Template:MOS tunings]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Replacement for Template:MOS degrees.&lt;br /&gt;
| &#039;&#039;&#039;Rewrite to follow new coding conventions.&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Nutshell]]&lt;br /&gt;
| Yes&lt;br /&gt;
| See equivalent template on Wikipedia.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:JI ratios]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Module for searching for JI ratios, as well as parsing them from template input.&lt;br /&gt;
Replacement for Module:JI ratio finder.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Mediants]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Standalone template for mediant calculations. To be used for the following modules:&lt;br /&gt;
&lt;br /&gt;
* Module:SB tree&lt;br /&gt;
* &amp;lt;s&amp;gt;Module:Scale tree&amp;lt;/s&amp;gt;&lt;br /&gt;
* Module:MOS tuning spectrum&lt;br /&gt;
* Module:JI ratios&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Deprecated parameters]]&lt;br /&gt;
| Yes&lt;br /&gt;
| A module for denoting one or more deprecated parameters in a template.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | New templates after this line follow new (personal) coding conventions, outlined in v1 of my style guide.&lt;br /&gt;
|-&lt;br /&gt;
! Modules and templates&lt;br /&gt;
! New?&lt;br /&gt;
! Description of template or contribution&lt;br /&gt;
! Status or todo&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Navbox]]&lt;br /&gt;
[[Module:Navbox]]&lt;br /&gt;
| Yes&lt;br /&gt;
| A template and module for producing a navbox. Module builds up navbox from input.&lt;br /&gt;
Navboxes can be made either as a template or using a lua module calling the navbox functions.&lt;br /&gt;
|Possibly add templatestyles integration&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Infobox]]&lt;br /&gt;
[[Template:Infobox]]&lt;br /&gt;
| Yes (template only)&lt;br /&gt;
| Rewrote entire infobox from scratch to support infobox template.&lt;br /&gt;
Same as navbox; infoboxes can be made either using a module calling the infobox functions or with a template.&lt;br /&gt;
|Possibly add templatestyles integration&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Numlinks]]&lt;br /&gt;
[[Template:Numlinks]]&lt;br /&gt;
|Yes&lt;br /&gt;
| A template for calculating and creating prev/next links for a numbered page. Pages are incremented (or decremented) by 1.&lt;br /&gt;
| Possibly let template auto-extract text.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOS tuning spectrum]]&lt;br /&gt;
[[Module:MOS tuning spectrum]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Made to address maintenance issues with Module:Scale tree.&lt;br /&gt;
Comment entries are reverted back to having one param per ratio, where params are generated on the fly, not hardocded.&lt;br /&gt;
| Add comments for step ratios not found by search.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOS scalesig]]&lt;br /&gt;
[[Module:MOS scalesig]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Made to address shortcomings with [[Template:Scale link]] and need to format mos scalesigs.&lt;br /&gt;
This template auto-formats a scale signature:&lt;br /&gt;
&lt;br /&gt;
* Spaces are replaced with nonbreaking spaces.&lt;br /&gt;
* For nonoctave scales, angle brackets are replaced with the appropriate ones.&lt;br /&gt;
* Can format the scalesig as a link, if needed.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;Template:MOS stub&amp;lt;/s&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| A proposed combination template consisting of:&lt;br /&gt;
&lt;br /&gt;
* Template:Infobox MOS&lt;br /&gt;
* Template:MOS intro&lt;br /&gt;
* Template:MOS intervals&lt;br /&gt;
* Template:MOS tuning spectrum&lt;br /&gt;
Such a template would be a subst-template.&lt;br /&gt;
| &#039;&#039;&#039;Cancelled. No combo templates for mos pages.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:JI ratios]]&lt;br /&gt;
|Yes&lt;br /&gt;
|Rewrite of existing JI ratios module into two modules: one for searching for ratios, and one for filtering ratios&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Disavowed]]&lt;br /&gt;
|Yes&lt;br /&gt;
|Denotes terms whose usage is no longer advised, generally due to the name being unsuitable (EG, offensive, inappropriate, etc) or due to the person who coined the term retracting it.&lt;br /&gt;
|Use-cases to be determined.&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Navbox Lumatone]]&lt;br /&gt;
[[Template:Navbox fractional-octave]]&lt;br /&gt;
[[Module:Navbar]]&lt;br /&gt;
|No&lt;br /&gt;
|Decoupling navbar so it doesn&#039;t generate navboxes&#039; or their prev/next links; that work is delegated to Template:Numlinks and Template:Navbox.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Sidebar]]&lt;br /&gt;
[[Module:Sidebar]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A template that&#039;s a basic implementation of Wikipedia&#039;s sidebar. Some infobox-like templates use this over the actual infobox, so it&#039;s made into an actual template.&lt;br /&gt;
|Possibly add templatestyles integration&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Template input utils]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A library for preprocessing template args.&lt;br /&gt;
May possibly be a new location for Module:Template input parse (TIP).&lt;br /&gt;
&lt;br /&gt;
Proposed functions:&lt;br /&gt;
&lt;br /&gt;
* numbered_args_to_table(args, key_fmt, max_num)&lt;br /&gt;
* header_data_pairs_to_table(args, header_fmt, data_fmt)&lt;br /&gt;
* Functions to parse key-value, ratios, and sequences of ratios (from TIP)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Numlinks 2-num]]&lt;br /&gt;
[[Module:Numlinks 2-num]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A variant of numlinks that supports two varying numbers. Intended for pages such as mosses, EG 5L 2s.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Template rating]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A template that implements Wikipedia&#039;s template/module rating template. Advises editors that the template is one of several things:&lt;br /&gt;
&lt;br /&gt;
* Draft; a mockup of a new template/module that is undergoing testing. Not ready for use anywhere except test pages. (encompasses pre-alpha/alpha/beta/mockup)&lt;br /&gt;
* Ready; template/module is ready for use&lt;br /&gt;
* Broken; self-explanatory. Definitely do not use until it&#039;s either fixed or deemed unfixable.&lt;br /&gt;
* Replaced; template is deprecated and has a replacement; template is kept for archival purposes or can be deleted.&lt;br /&gt;
* Deprecated; do not use anywhere; template is kept for archival purposes or can be deleted.&lt;br /&gt;
|In development&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Category handler]]&lt;br /&gt;
[[Module:Category handler]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A proposed template-module pair that is a basic implementation of Wikipedia&#039;s module of the same name: https://en.wikipedia.org/wiki/Module:Category_handler&lt;br /&gt;
Features:&lt;br /&gt;
&lt;br /&gt;
* Allows templates to categorize pages, given a list of categories&lt;br /&gt;
&lt;br /&gt;
* Suppresses categories based on a list of suppressed namespaces (configurable) and a list of suppressed suffixes (subpages; configurable)&lt;br /&gt;
* Module is standalone; it requires no other modules as dependencies, apart from possibly utility modules.&lt;br /&gt;
|Attempted in the past by someone else but was deleted.&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Todo]]&lt;br /&gt;
|No&lt;br /&gt;
|Integrate category handler so templates/modules with todos don&#039;t get categorized twice (once for the template/module and once more for its /doc page)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; |New templates after this line follow new (personal) coding conventions, outlined in v2 of my style guide. Features:&lt;br /&gt;
Use of snake_case for ALL param names; previous templates go through template name normalization to maintain backwards-compatibility (automated for lua-based templates)&lt;br /&gt;
&lt;br /&gt;
For lua-based templates, no params will ever be defined at the template level, instead defined at the module level&lt;br /&gt;
|-&lt;br /&gt;
!Modules and templates&lt;br /&gt;
!New?&lt;br /&gt;
!Description of template or contribution&lt;br /&gt;
!Status or todo&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Module introspection]]&lt;br /&gt;
[[Template:Module introspection]]&lt;br /&gt;
|Yes&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |A set of modules that inspects mediawiki templates and lua code for:&lt;br /&gt;
&lt;br /&gt;
* (FOR TEMPLATES): detecting whether a template invokes a module&#039;s function&lt;br /&gt;
* (FOR MODULES): detecting a module&#039;s dependencies and the functions used.&lt;br /&gt;
&lt;br /&gt;
Common functionality is stored in Module:Introspection utils. Module introspection serves to implement this functionality for modules; template introspection is handled as part of Module:Dochead.&lt;br /&gt;
&lt;br /&gt;
These templates/changes replace [[Template:Lua]] as used on module docpaegs.&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |Detect data being used from a module, not just functions.&lt;br /&gt;
Arrange functions in a list rather than in a table.&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Template introspection|&amp;lt;s&amp;gt;Module:Template introspection&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:Template introspection|&amp;lt;s&amp;gt;Template:Template introspection&amp;lt;/s&amp;gt;]]&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Introspection utils]]&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Dochead]]&lt;br /&gt;
[[Template:Dochead]]&lt;br /&gt;
|Yes (module only)&lt;br /&gt;
|Module is a rewrite of Template:Dochead that makes the template able to:&lt;br /&gt;
&lt;br /&gt;
* Autodetect modules with corresponding templates, with options for overrides&lt;br /&gt;
* Autodetect templates with corresponding modules, with options for overrides&lt;br /&gt;
* Display which functions are invoked and from which modules.&lt;br /&gt;
These templates/changes replace [[Template:Lua]] as used on template docpages.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|All deprecation templates except [[Template:Deprecated parameters]]&lt;br /&gt;
|No&lt;br /&gt;
|Minor changes to inform editors if they&#039;re used in the wrong namespaces.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|All categorizing infoboxes:&lt;br /&gt;
&lt;br /&gt;
* [[Template:Infobox MOS]]&lt;br /&gt;
* [[Template:Infobox AFDO]]&lt;br /&gt;
* [[Template:Infobox chord]]&lt;br /&gt;
* [[Template:Infobox ET]]&lt;br /&gt;
* [[Template:Infobox interval]]&lt;br /&gt;
|No&lt;br /&gt;
|Proposal to add [[Module:Category handler]] so these templates automatically categorize themselves when in the correct namespaces&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Template:Template quick copy (shortcut name: tqc)&lt;br /&gt;
|&lt;br /&gt;
|A proposed module-template pair used to automatically format a template&#039;s code for easy copy-pasting. Subst-template.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Template:Keyboard vis&lt;br /&gt;
|&lt;br /&gt;
|See Module:Keyboard vis.&lt;br /&gt;
Module does not have a corresponding template. For module, add scaling options now that visualization is image-based instead of using box-drawing characters (low-priority).&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:ED ratios&lt;br /&gt;
Template:ED ratios&lt;br /&gt;
|&lt;br /&gt;
| A proposed template that is an upgraded version of Module:JI ratios in ED&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:Interval regions&lt;br /&gt;
|&lt;br /&gt;
| A proposed module for roughly classifying diatonic intervals (1st, 2nd etc; major, minor) plus some intermediate or in-between categories ( neutral and interseptimal intervals)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:MODMOS mode degrees&lt;br /&gt;
Template:MODMOS mode degrees&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:MOS superset degrees&lt;br /&gt;
Template:MOS superset degrees&lt;br /&gt;
|&lt;br /&gt;
| Like MOS mode degrees, except the scale degrees are in relation to an ancestor mos.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Wikiprojects and style guides ===&lt;br /&gt;
* [[Xenharmonic Wiki:WikiProject Mospage|Project Mospage]] and [[Xenharmonic Wiki:MOS page style guide|mospage style guide]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Docpage style guide|Docpage style guide]] (not worthy of a wikiproject since most docpages have been written alraedy; this would be a guide on how to format and arrange what goes on a docpage)&lt;br /&gt;
&lt;br /&gt;
=== Project mbox-icon ===&lt;br /&gt;
Various wikis have custom/themed icons. Apart from exceptions where a more common icon is preferred, why not have custom mbox icons for xenwiki?&lt;br /&gt;
&lt;br /&gt;
=== Other contributions ===&lt;br /&gt;
* Mos page standardization (work-in-progress)&lt;br /&gt;
* [[Recursive structure of MOS scales|MOS recursion and MOS recursion algorithms]]; tried my best to make the descriptions for MOS recursion apply to all cases (Work-in-progress)&lt;br /&gt;
* Some rewording of the [[TAMNAMS]] page for readability and flow. I have a few TAMNAMS-related proposals of my own that aren&#039;t quite ready to be called official. See todo list or TAMNAMS subpage.&lt;br /&gt;
* [[Horogram|A page for horograms]], since it was totally absent (Work-in-progress).&lt;br /&gt;
* [[MOS Scale Family Tree|Mos family tree page]] for a tree I independently discovered before realizing Erv Wilson had already described it. Also has to do with mos recursion.&lt;br /&gt;
&lt;br /&gt;
===To-do list ===&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;s&amp;gt;Rewrite page(s)&amp;lt;/s&amp;gt; Under jurisdiction of Project Mospage.&#039;&#039;&#039;&lt;br /&gt;
** [[Operations on MOSes|&amp;lt;s&amp;gt;Operations on MOSes&amp;lt;/s&amp;gt;]]&lt;br /&gt;
** [[MOS scale|&amp;lt;s&amp;gt;MOS scale&amp;lt;/s&amp;gt;]]&lt;br /&gt;
** &amp;lt;s&amp;gt;[[TAMNAMS/Appendix]] (primarily for names reasoning and adding general principles)&amp;lt;/s&amp;gt;&lt;br /&gt;
** &amp;lt;s&amp;gt;[[TAMNAMS Extension]] (since such names should follow the same naming principles as the &amp;quot;named range&amp;quot; names, but no such principles currently exist)&amp;lt;/s&amp;gt;&lt;br /&gt;
* &amp;lt;s&amp;gt;&#039;&#039;&#039;Rewrite all octave-equivalent mos pages.&#039;&#039;&#039; This is primarily replacing every scale tree for the corresponding template and rewriting the lead sections to make sense and does not present redundant information already given by one of the templates. To a lesser extent, this also involves trying to confirm temperaments said to be attributed to these mosses, but this step will require additional help.&amp;lt;/s&amp;gt; &#039;&#039;&#039;Under jurisdiction of Project Mospage.&#039;&#039;&#039;&lt;br /&gt;
** &amp;lt;s&amp;gt;This is done concurrently with writing a style guide for these pages; see [[User:Ganaram inukshuk/MOS page standardization guide]] for a proposed guide.&amp;lt;/s&amp;gt;&lt;br /&gt;
** &amp;lt;s&amp;gt;Mosses whose pages have been rewritten to meet the style guide to satisfactory levels (that doesn&#039;t mean the pages can&#039;t be polished further!):&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;5L 1s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;5L 2s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;4L 3s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;3L 4s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;2L 5s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;1L 5s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;7L 1s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;3L 7s&amp;lt;/s&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Update templates I&#039;ve made to current coding style/structure&#039;&#039;&#039;:&lt;br /&gt;
** The template calls a wrapper function, meant to be used with template params as input. Its name should be suggestive of the module&#039;s primary use, and is usually the same name as the template.&lt;br /&gt;
** The wrapper function calls the &amp;quot;main function&amp;quot;, which has the code that produces the output. Its name is the same as name as with the wrapper function, except it&#039;s prefixed by an underscore.&lt;br /&gt;
* Clean up mos recursion page (because I feel bad leaving the algorithms untouched and untested for so long).&lt;br /&gt;
** Replace pseudocode for is-this-scale-a-mos? program with python code; clarify with more examples.&lt;br /&gt;
** Relate mos recursion with the mos family tree.&lt;br /&gt;
** All the recursive algorithms described on that page have time complexities of O(n log n), but the algorithm that generates a Christoffel word (combinatorics-on-words term for the brightest mode of a mos) has a time complexity of O(n). Resolve...?&lt;br /&gt;
* Standardize mosinedo pages. Examples include:&lt;br /&gt;
** [[List of MOS scales in 12edo]]&lt;br /&gt;
** [[List of MOS scales in 17edo]]&lt;br /&gt;
** [[List of MOS scales in 29edo]]&lt;br /&gt;
** [[List of MOS scales in 31edo]]&lt;br /&gt;
&lt;br /&gt;
=== Wish list ===&lt;br /&gt;
* Composing music with these abstract ideas.&lt;br /&gt;
&lt;br /&gt;
== Subpages ==&lt;br /&gt;
These pages contain content that currently don&#039;t have an exact place elsewhere on the Wiki, or contains personal notes that otherwise don&#039;t have an exact place on the Wiki. I do my best to explain these things as though I magically forgot everything I know about xenharmony, so I consider it a bonus if someone else found this easy to understand.&lt;br /&gt;
* [[User:Ganaram inukshuk/Diagrams]] – For xen-related diagrams&lt;br /&gt;
* [[User:Ganaram inukshuk/Notes]] – For xen-related notes&lt;br /&gt;
** [[User:Ganaram inukshuk/Notes/TAMNAMS]] – Since I have so many notes related to TAMNAMS, I made a dedicated page for it&lt;br /&gt;
* [[User:Ganaram inukshuk/Tables]] – For xen-related tables&lt;br /&gt;
* [[User:Ganaram inukshuk/Code]] – For xen-related code&lt;br /&gt;
* [[User:Ganaram inukshuk/Models]] – For xen-related models (needs reorganizing)&lt;br /&gt;
* [[User:Ganaram inukshuk/TAMNAMS Extension]] – Since there were others making their own TAMNAMS extension pages, I decided to make my own.&lt;br /&gt;
** [[User:Ganaram inukshuk/TAMEX]] – Rewrite of the above page for describing any mos descendant, short for &amp;quot;temperament-agnostic moment-of-symmetry scale extension description system&amp;quot;&lt;br /&gt;
** [[User:Ganaram inukshuk/Additional temperament-agnostic mos names]] – Rewrite of the above page for names for proposed names.&lt;br /&gt;
&lt;br /&gt;
These pages are descriptions on how I approach various things, such as compositional techniques and how I approach a scale I&#039;ve never used before.&lt;br /&gt;
* [[User:Ganaram inukshuk/Methodologies]]&lt;br /&gt;
&lt;br /&gt;
Sandbox pages (for testing things)&lt;br /&gt;
* [[User:Ganaram inukshuk/Sandbox]]&lt;br /&gt;
** [[User:Ganaram inukshuk/Sandbox/JI ratios]]&lt;br /&gt;
**[[User:Ganaram inukshuk/Sandbox/Navboxes]]&lt;br /&gt;
**[[User:Ganaram inukshuk/Sandbox/Modmosses]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template sandbox]]&lt;br /&gt;
&lt;br /&gt;
Test pages (for proposed rewrites or new templates):&lt;br /&gt;
* [[User:Ganaram inukshuk/Catalog of MOS Scales]]&lt;br /&gt;
* [[User:Ganaram inukshuk/4L 3s]] (Template test page and test page for style guide)&lt;br /&gt;
* [[User:Ganaram inukshuk/5L 2s]] (Template test page and test page for style guide)&lt;br /&gt;
** [[User:Ganaram inukshuk/MODMOS scales of 5L 2s]]&lt;br /&gt;
* [[User:Ganaram inukshuk/7L 3s]] (Rewrite page)&lt;br /&gt;
* [[User:Ganaram inukshuk/TAMNAMS]] (Rewrite page)&lt;br /&gt;
** [[User:Ganaram inukshuk/TAMNAMS/Appendix]]&lt;br /&gt;
* [[User:Ganaram inukshuk/MOS scale]] (rewrite page)&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Rewrite draft]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Template rating]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Todo]]&lt;br /&gt;
&lt;br /&gt;
Experimental pages (for content considered idiosyncratic, ad-hoc, or otherwise weird):&lt;br /&gt;
* [[User:Ganaram inukshuk/LCP 5L 3s]]&lt;br /&gt;
&lt;br /&gt;
Test templates:&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Mbox]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:TAMNAMS name]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Tcode]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Tester]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Transcript]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Joke page|User:Ganaram inukshuk/Joke page]]&lt;br /&gt;
* [[User:Ganaram inukshuk/JI ratios]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Navbox fractional-octave]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Navbox Lumatone]]&lt;br /&gt;
&lt;br /&gt;
Other:&lt;br /&gt;
* [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
&lt;br /&gt;
[[Category:User on Discord]]&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Template_rating/doc&amp;diff=223416</id>
		<title>Template:Template rating/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Template_rating/doc&amp;diff=223416"/>
		<updated>2026-02-06T10:59:42Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead|mod=aaa}}{{substitute|no}}{{clear}}{{wikipedia}}&lt;br /&gt;
&#039;&#039;&#039;{{ARTICLEROOTPAGENAME}}&#039;&#039;&#039; is used to denote the rating of a template or module, namely denoting whether or not it can be used. This template is placed within the documentation page of a template, not its &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;noinclude&amp;gt;&amp;lt;/noinclude&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
Despite the name, this template can also be used on Lua modules&#039; documentation pages.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;rating&amp;lt;/code&amp;gt; (required; default &amp;lt;code&amp;gt;draft&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The rating of template or module.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; (automatically detected using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ARTICLESPACE}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The namespace of the page. For normal use, this is automatically detected and does not need to be entered manually.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;pagename&amp;lt;/code&amp;gt; (automatically detected using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PAGENAME}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The name of the page. For normal use, this is automatically detected and does not need to be entered manually.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;details&amp;lt;/code&amp;gt; (optional)&lt;br /&gt;
: Any details about the template or module in question.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt; (required if &amp;lt;code&amp;gt;rating=replaced&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The name of the replacement template or module, if the current template or module is being replaced by a new one.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;delete&amp;lt;/code&amp;gt; (required if &amp;lt;code&amp;gt;rating=replaced&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;rating=deprecated&amp;lt;/code&amp;gt;; default &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;)&lt;br /&gt;
: Whether to delete the template or module, if the current template or module is being either replaced or deprecated. Deprecated templates and modules are generally kept for archival and historical purposes, but those that have seen little use (such as those made for testing or with experimental features) may be deleted instead.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt; (optional; default &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;)&lt;br /&gt;
: Whether to disable categories for [[Template:Category handler]]. For normal use, this should be left unchanged.&lt;br /&gt;
&lt;br /&gt;
=== Quick copy (essential params only) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Template rating&lt;br /&gt;
| rating      =&lt;br /&gt;
| details     =&lt;br /&gt;
| replacement =&lt;br /&gt;
| delete      =&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
The following examples assumes use for a template. Usage within the module namespace is automatically detected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Draft template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ready&#039;&#039;&#039; denotes a template that is work-in-progress, or templates that are being rewritten or refactored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=draft|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=draft|namespace=Template|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ready template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ready&#039;&#039;&#039; denotes a template that is ready for use on the wiki. The use of this template is not necessary for most templates, as a template without any other indicators is assumed to be a ready template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=ready|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=ready|namespace=Template|details=Other details go here.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Broken template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Broken&#039;&#039;&#039; denotes a template that is not functioning properly and is currently being fixed. For templates that work but are undergoing refactoring, use the &#039;&#039;&#039;draft&#039;&#039;&#039; rating.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=broken|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=broken|namespace=Template|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Replaced template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Replaced&#039;&#039;&#039; denotes a template that should no longer be used and have been superseded by a new template. By default, deprecated templates are &#039;&#039;not&#039;&#039; nominated for deletion, as deleting a deprecated template makes viewing past revisions of transcluding pages much more difficult.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=replaced|replacement=Somenewtemplate|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=replaced|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
If a template has not been extensively used, it may be nominated for deletion by adding &amp;lt;code&amp;gt;delete=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=replaced|replacement=Somenewtemplate|details=Other details go here.|delete=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=replaced|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1|delete=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Deprecated template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Deprecated&#039;&#039;&#039; denotes a template that should no longer be used and has no replacement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=deprecated|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
As with replaced templates, deprecated templates are &#039;&#039;not&#039;&#039; nominated for deletion by default. To nominate it for deletion, add &amp;lt;code&amp;gt;delete=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=deprecated|details=Other details go here.|delete=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1|delete=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Incorrect options and categories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This template uses [[Template:Category handler]], which categories templates and modules using this template in the appropriate categories, except those with a rating of &#039;&#039;ready&#039;&#039;. Categories are not enabled on /doc or /sandbox pages.&lt;br /&gt;
&lt;br /&gt;
In addition to this, this template detects whether it&#039;s in the incorrect namespace, such as when used on User namespace pages, and can detect whether it has an unrecognized rating.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=aaa}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=aaa|namespace=User}}&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template:Deprecated template]], a template added to a deprecated template&#039;s code, to be used in conjunction with this template&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Template_rating/doc&amp;diff=223340</id>
		<title>Template:Template rating/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Template_rating/doc&amp;diff=223340"/>
		<updated>2026-02-05T21:31:51Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: clarify when some params are used; module namespace detection is automatic, so there&amp;#039;s no need to enter the namespace manually; added a quick copy to see how it looks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead|mod=aaa}}{{substitute|no}}{{clear}}{{wikipedia}}&lt;br /&gt;
&#039;&#039;&#039;{{ARTICLEROOTPAGENAME}}&#039;&#039;&#039; is used to denote the rating of a template or module, namely denoting whether or not it can be used. This template is placed within the documentation page of a template, not its &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;noinclude&amp;gt;&amp;lt;/noinclude&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
Despite the name, this template can also be used on Lua modules&#039; documentation pages.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;rating&amp;lt;/code&amp;gt; (required; default &amp;lt;code&amp;gt;draft&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The rating of template or module.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; (required; default is based on &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ARTICLESPACE}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The namespace of the page. For normal use, this is automatically detected and does not need to be entered manually.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;pagename&amp;lt;/code&amp;gt; (required; default is based on &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PAGENAME}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The name of the page. For normal use, this is automatically detected and does not need to be entered manually.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;details&amp;lt;/code&amp;gt; (optional)&lt;br /&gt;
: Any details about the template or module in question.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt; (required if &amp;lt;code&amp;gt;rating=replaced&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The name of the replacement template or module, if the current template or module is being replaced by a new one.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;delete&amp;lt;/code&amp;gt; (required if &amp;lt;code&amp;gt;rating=replaced&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;rating=deprecated&amp;lt;/code&amp;gt;; default &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;)&lt;br /&gt;
: Whether to delete the template or module, if the current template or module is being either replaced or deprecated. Deprecated templates and modules are generally kept for archival and historical purposes, but those that have seen little use (such as those made for testing or with experimental features) may be deleted instead.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt; (optional; default &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;)&lt;br /&gt;
: Whether to disable categories for [[Template:Category handler]]. For normal use, this should be left unchanged.&lt;br /&gt;
&lt;br /&gt;
=== Quick copy (essential params only) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Template rating&lt;br /&gt;
| rating      =&lt;br /&gt;
| details     =&lt;br /&gt;
| replacement =&lt;br /&gt;
| delete      =&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
The following examples assumes use for a template. Usage within the module namespace is automatically detected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Draft template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ready&#039;&#039;&#039; denotes a template that is work-in-progress, or templates that are being rewritten or refactored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=draft|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=draft|namespace=Template|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ready template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ready&#039;&#039;&#039; denotes a template that is ready for use on the wiki. The use of this template is not necessary for most templates, as a template without any other indicators is assumed to be a ready template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=ready|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=ready|namespace=Template|details=Other details go here.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Broken template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Broken&#039;&#039;&#039; denotes a template that is not functioning properly and is currently being fixed. For templates that work but are undergoing refactoring, use the &#039;&#039;&#039;draft&#039;&#039;&#039; rating.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=broken|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=broken|namespace=Template|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Replaced template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Replaced&#039;&#039;&#039; denotes a template that should no longer be used and have been superseded by a new template. By default, deprecated templates are &#039;&#039;not&#039;&#039; nominated for deletion, as deleting a deprecated template makes viewing past revisions of transcluding pages much more difficult.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=replaced|replacement=Somenewtemplate|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=replaced|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
If a template has not been extensively used, it may be nominated for deletion by adding &amp;lt;code&amp;gt;delete=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=replaced|replacement=Somenewtemplate|details=Other details go here.|delete=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=replaced|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1|delete=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Deprecated template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Deprecated&#039;&#039;&#039; denotes a template that should no longer be used and has no replacement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=deprecated|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
As with replaced templates, deprecated templates are &#039;&#039;not&#039;&#039; nominated for deletion by default. To nominate it for deletion, add &amp;lt;code&amp;gt;delete=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=deprecated|details=Other details go here.|delete=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1|delete=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Incorrect options and categories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This template uses [[Template:Category handler]], which categories templates and modules using this template in the appropriate categories, except those with a rating of &#039;&#039;ready&#039;&#039;. Categories are not enabled on /doc or /sandbox pages.&lt;br /&gt;
&lt;br /&gt;
In addition to this, this template detects whether it&#039;s in the incorrect namespace, such as when used on User namespace pages, and can detect whether it has an unrecognized rating.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=aaa}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=aaa|namespace=User}}&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template:Deprecated template]], a template added to a deprecated template&#039;s code, to be used in conjunction with this template&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Template_rating/doc&amp;diff=223265</id>
		<title>Template:Template rating/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Template_rating/doc&amp;diff=223265"/>
		<updated>2026-02-05T02:39:30Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead|mod=aaa}}{{substitute|no}}{{clear}}{{wikipedia}}&lt;br /&gt;
&#039;&#039;&#039;{{ARTICLEROOTPAGENAME}}&#039;&#039;&#039; is used to denote the rating of a template or module, namely denoting whether or not it can be used. This template is placed within the documentation page of a template, not its &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;noinclude&amp;gt;&amp;lt;/noinclude&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; block.&lt;br /&gt;
&lt;br /&gt;
Despite the name, this template can also be used on Lua modules&#039; documentation pages.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;rating&amp;lt;/code&amp;gt; (required; default &amp;lt;code&amp;gt;draft&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The rating of template or module.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; (required; default is based on &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ARTICLESPACE}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The namespace of the page. For normal use, this is automatically detected and does not need to be entered manually.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;pagename&amp;lt;/code&amp;gt; (required; default is based on &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PAGENAME}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The name of the page. For normal use, this is automatically detected and does not need to be entered manually.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;details&amp;lt;/code&amp;gt; (optional)&lt;br /&gt;
: Any details about the template or module in question.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt; (required if &amp;lt;code&amp;gt;rating=replaced&amp;lt;/code&amp;gt;)&lt;br /&gt;
: The name of the replacement template or module.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;delete&amp;lt;/code&amp;gt; (optional; default &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;)&lt;br /&gt;
: Whether to delete the template or module.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt; (optional; default &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;)&lt;br /&gt;
: Whether to disable categories for [[Template:Category handler]].&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
The following examples assumes use for a template. For use with module documentation, add &amp;lt;code&amp;gt;namespace = Module&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Draft template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ready&#039;&#039;&#039; denotes a template that is work-in-progress, or templates that are being rewritten or refactored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=draft|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=draft|namespace=Template|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ready template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ready&#039;&#039;&#039; denotes a template that is ready for use on the wiki. The use of this template is not necessary for most templates, as a template without any other indicators is assumed to be a ready template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=ready|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=ready|namespace=Template|details=Other details go here.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Broken template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Broken&#039;&#039;&#039; denotes a template that is not functioning properly and is currently being fixed. For templates that work but are undergoing refactoring, use the &#039;&#039;&#039;draft&#039;&#039;&#039; rating.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=broken|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=broken|namespace=Template|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Replaced template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Replaced&#039;&#039;&#039; denotes a template that should no longer be used and have been superseded by a new template. By default, deprecated templates are &#039;&#039;not&#039;&#039; nominated for deletion, as deleting a deprecated template makes viewing past revisions of transcluding pages much more difficult.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=replaced|replacement=Somenewtemplate|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=replaced|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
If a template has not been extensively used, it may be nominated for deletion by adding &amp;lt;code&amp;gt;delete=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=replaced|replacement=Somenewtemplate|details=Other details go here.|delete=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=replaced|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1|delete=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Deprecated template&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Deprecated&#039;&#039;&#039; denotes a template that should no longer be used and has no replacement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=deprecated|details=Other details go here.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1}}&lt;br /&gt;
&lt;br /&gt;
As with replaced templates, deprecated templates are &#039;&#039;not&#039;&#039; nominated for deletion by default. To nominate it for deletion, add &amp;lt;code&amp;gt;delete=1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=deprecated|details=Other details go here.|delete=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1|delete=1}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Incorrect options and categories&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This template uses [[Template:Category handler]], which categories templates and modules using this template in the appropriate categories, except those with a rating of &#039;&#039;ready&#039;&#039;. Categories are not enabled on /doc or /sandbox pages.&lt;br /&gt;
&lt;br /&gt;
In addition to this, this template detects whether it&#039;s in the incorrect namespace, such as when used on User namespace pages, and can detect whether it has an unrecognized rating.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Template rating|Sometemplate|rating=aaa}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
{{Template rating|Sometemplate|rating=aaa|namespace=User}}&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template:Deprecated template]], a template added to a deprecated template&#039;s code, to be used in conjunction with this template&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Alert/doc&amp;diff=223256</id>
		<title>Template:Alert/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Alert/doc&amp;diff=223256"/>
		<updated>2026-02-04T23:41:59Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: rewrite; emphasize (hopefully) usage as a metatemplate&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dochead|header=metatemplate}}{{Template rating|{{PAGENAME}}|rating=ready}}{{clear}}{{templatestyles}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Alert&#039;&#039;&#039; template is a metatemplate which is used to create alerts, also known as callouts or admonitions, to call attention to critical information. It is intended to be used in other templates for messages which are expected to be used on multiple pages. &lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
The template accepts the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt;: Defines the color of the left border; the type should be chosen according to context, not for aesthetic reasons. Types are described in the next section.&lt;br /&gt;
* &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;: Message to be displayed in the box.&lt;br /&gt;
* &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt;: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box. Unlike mbox, alert uses an {{w|emoji}} rather than an image, which should be passed in using its {{w|HTML entity}} representation (e.g. use &amp;lt;code&amp;gt;&amp;amp;amp;#x1F642;&amp;lt;/code&amp;gt; for &amp;amp;#x1F642;&amp;lt;/code&amp;gt;).&lt;br /&gt;
* &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;: A custom label, if provided.&lt;br /&gt;
&lt;br /&gt;
Templates that use this metatemplate (namely &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{note}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{tip}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{warning}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;) should have pre-assigned values for &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;, leaving only &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; available to be modified.&lt;br /&gt;
&lt;br /&gt;
=== Types and examples ===&lt;br /&gt;
{{Alert|text=Alert of &#039;&#039;&#039;note&#039;&#039;&#039; type, used by [[Template: Note]]. |type=note}}&lt;br /&gt;
{{Alert|text=Alert of &#039;&#039;&#039;tip&#039;&#039;&#039; type, used by [[Template: Tip]]. |type=tip}}&lt;br /&gt;
{{Alert|text=Alert of &#039;&#039;&#039;warning&#039;&#039;&#039; type, used by [[Template: Warning]]. |type=warning}}&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template: Mbox]]&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Template_input_utils&amp;diff=223200</id>
		<title>Module:Template input utils</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Template_input_utils&amp;diff=223200"/>
		<updated>2026-02-04T10:22:30Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: move tip functions here? See [[Module:Template input parse]]&lt;br /&gt;
&lt;br /&gt;
-- TODO:&lt;br /&gt;
-- Add param name normalization: params close enough to snake_case are normal-&lt;br /&gt;
-- ized to snake_case&lt;br /&gt;
&lt;br /&gt;
-- Library module for common operations with handling template input.&lt;br /&gt;
-- - Numbered &amp;lt;anything&amp;gt; to table extract args and places them into a table.&lt;br /&gt;
&lt;br /&gt;
-- Normalize params to snake case (may change to a different form later);&lt;br /&gt;
-- anything close enough to snake case is converted to snake case:&lt;br /&gt;
-- TRAIN_CASE, KEBEB-CASE, no dashes (OK!)&lt;br /&gt;
-- PascalCase, camelCase (will not convert properly)&lt;br /&gt;
-- Function work-in-progress&lt;br /&gt;
function p.normalize_params(args)&lt;br /&gt;
	&lt;br /&gt;
	-- Local function for normalizing strings&lt;br /&gt;
	-- Spaces and dashes turn into underscores&lt;br /&gt;
	-- and all capital letters become lowercase&lt;br /&gt;
	local function normalize(input_string)&lt;br /&gt;
		local cleaned_string = string.gsub(string.lower(input_string), &amp;quot;[%-%s]&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Extracts numbered args (from frame.args) and stores them into one table.&lt;br /&gt;
-- Removes original numbered args from args table. Sequence of numbered args&lt;br /&gt;
-- may have gaps.&lt;br /&gt;
-- Table of entries is returned without being inserted into the original args&lt;br /&gt;
-- table, as it may require further processing (EG, parsing to number, ratio, &lt;br /&gt;
-- kv-pairs, etc).&lt;br /&gt;
function p.numbered_args_to_table(args, max_num, key_fmt, keep_originals)&lt;br /&gt;
	local max_num = max_num or 100	&lt;br /&gt;
	local key_fmt = key_fmt or &amp;quot;Entry %d&amp;quot;&lt;br /&gt;
	local keep_originals = keep_originals or false		-- Denotes whether to keep originals in table or remove them; default false&lt;br /&gt;
	&lt;br /&gt;
	local entries = {}&lt;br /&gt;
	for i = 1, max_num do&lt;br /&gt;
		local key = string.format(key_fmt, i)		-- Make key&lt;br /&gt;
		local entry = args[key]						-- Extract&lt;br /&gt;
		table.insert(entries, entry)				-- Insert&lt;br /&gt;
		if not keep_originals then&lt;br /&gt;
			args[key] = nil								-- Remove original&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return entries&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Extracts numbered args that correspond to header-data pairs of a two-col&lt;br /&gt;
-- table, commonly seen in navboxes and infoboxes. Removes original numbered&lt;br /&gt;
-- args from args table. Sequence of numbered args may have gaps, and a pair may&lt;br /&gt;
-- have one element be missing/nil (headerless data and dataless header).&lt;br /&gt;
-- Table of entries is returned without being inserted into the original args&lt;br /&gt;
-- table, as it may require further processing (EG, parsing to number, ratio, &lt;br /&gt;
-- kv-pairs, etc).&lt;br /&gt;
function p.numbered_header_data_args_to_table(args, max_num, keep_originals, is_strict_pair, header_fmt, data_fmt)&lt;br /&gt;
	local max_num    = max_num or 100&lt;br /&gt;
	local header_fmt = header_fmt or &amp;quot;Header %d&amp;quot;	&lt;br /&gt;
	local data_fmt   = data_fmt or &amp;quot;Data %d&amp;quot;&lt;br /&gt;
	local is_strict_pair = is_strict_pair or false		-- Denotes whether a pair must have both header and data&lt;br /&gt;
	local keep_originals = keep_originals or false		-- Denotes whether to keep originals in table or remove them; default false&lt;br /&gt;
	&lt;br /&gt;
	local entries = {}&lt;br /&gt;
	for i = 1, max_num do&lt;br /&gt;
		-- Make keys&lt;br /&gt;
		local header_key = string.format(header_fmt, i)&lt;br /&gt;
		local data_key   = string.format(data_fmt, i)&lt;br /&gt;
		&lt;br /&gt;
		-- Extract header and data&lt;br /&gt;
		local header = args[header_key]&lt;br /&gt;
		local data = args[data_key]&lt;br /&gt;
		local entry = { [&amp;quot;Header&amp;quot;] = args[header_key], [&amp;quot;Data&amp;quot;] = args[data_key] }&lt;br /&gt;
		&lt;br /&gt;
		-- Insert&lt;br /&gt;
		if is_strict_pair then&lt;br /&gt;
			if (header and data) then table.insert(entries, entry) end&lt;br /&gt;
		else&lt;br /&gt;
			if (header or  data) then table.insert(entries, entry) end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Remove originals&lt;br /&gt;
		if not keep_originals then&lt;br /&gt;
			args[header_key] = nil&lt;br /&gt;
			args[data_key] = nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return entries&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Some older infoboxes use a jagged array instead of an assoc-array, so convert&lt;br /&gt;
-- two-element tables into a header-data pair, and one-element tables into&lt;br /&gt;
-- either a headerless data row, or a dataless header row.&lt;br /&gt;
-- Default is to interpret size-1 arrays as data rows, which corresponds to how&lt;br /&gt;
-- the infobox worked before it became template-ified. This old input method may&lt;br /&gt;
-- be easier to work with.&lt;br /&gt;
function p.jagged_array_to_header_data_pairs(rows, is_header_row)&lt;br /&gt;
	local is_header_row = is_header_row or false&lt;br /&gt;
	local new_rows = {}&lt;br /&gt;
	for i = 1, #rows do&lt;br /&gt;
		local row = rows[i]&lt;br /&gt;
		if #row == 2 then&lt;br /&gt;
			table.insert(new_rows, { [&amp;quot;Header&amp;quot;] = row[1], [&amp;quot;Data&amp;quot;] = row[2] })&lt;br /&gt;
		elseif #row == 1 and not is_header_row then&lt;br /&gt;
			table.insert(new_rows, { [&amp;quot;Data&amp;quot;  ] = row[1] })&lt;br /&gt;
		elseif #row == 1 and is_header_row then&lt;br /&gt;
			table.insert(new_rows, { [&amp;quot;Header&amp;quot;] = row[1] })&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return new_rows&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tester()&lt;br /&gt;
	local test_args = {&lt;br /&gt;
		[&amp;quot;Entry 1&amp;quot;] = &amp;quot;aaa&amp;quot;,&lt;br /&gt;
		[&amp;quot;Entry 2&amp;quot;] = &amp;quot;bbb&amp;quot;,&lt;br /&gt;
		[&amp;quot;Entry 3&amp;quot;] = &amp;quot;ccc&amp;quot;,&lt;br /&gt;
		[&amp;quot;Header 2&amp;quot;] = &amp;quot;BBB&amp;quot;,&lt;br /&gt;
		[&amp;quot;Entry 5&amp;quot;] = &amp;quot;ddd&amp;quot;,&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	--test_args[&amp;quot;Entries&amp;quot;] = p.numbered_args_to_table(test_args, &amp;quot;Entry %d&amp;quot;, 10)&lt;br /&gt;
	test_args[&amp;quot;Entries&amp;quot;] = p.numbered_header_data_args_to_table(test_args, 10, &amp;quot;Header %d&amp;quot;, &amp;quot;Entry %d&amp;quot;)&lt;br /&gt;
	return test_args&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Mbox/doc&amp;diff=223167</id>
		<title>Template:Mbox/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Mbox/doc&amp;diff=223167"/>
		<updated>2026-02-04T02:24:34Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: /* Usage */ removed unused params&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dochead|header=metatemplate}}{{Wikipedia}}{{templatestyles}}&lt;br /&gt;
The &#039;&#039;&#039;Mbox&#039;&#039;&#039; template is a metatemplate which is used to create message boxes which are placed at the top of a page. It is intended to be used in other templates for messages which are expected to be used on multiple pages.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
The template accepts the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt;: Defines the color of the left border; the type should be chosen according to context, not for aesthetic reasons. Types are described in the next section.&lt;br /&gt;
* &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;: Message to be displayed in the box.&lt;br /&gt;
* &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt;: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box.&lt;br /&gt;
* &amp;lt;code&amp;gt;icon size&amp;lt;/code&amp;gt;: Size of the icon displayed. Default is 60px.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Types and examples ===&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;delete&#039;&#039;&#039; type. Typically used for pages whose content is deprecated or to be deleted.|type=delete}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;content&#039;&#039;&#039; type. Typically used for pages whose content requires verification or rewriting.|type=content}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;style&#039;&#039;&#039; type. Typically used for pages whose writing deviates from the wiki&#039;s standards.|type=style}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;ready&#039;&#039;&#039; type. Used to denote wiki features (such as templates) that are ready for use.|type=ready}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;notice&#039;&#039;&#039; type. Used to denote general notices. Most messageboxes are of this type.|type=notice}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;move&#039;&#039;&#039; type. Denotes pages that are to be moved.|type=move}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;protection&#039;&#039;&#039; type. Denotes pages that are protected from editing.|type=protection}}&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template: Alert]]&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Template_input_utils&amp;diff=223166</id>
		<title>Module:Template input utils</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Template_input_utils&amp;diff=223166"/>
		<updated>2026-02-04T02:20:27Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: move tip functions here? See [[Module:Template input parse]]&lt;br /&gt;
&lt;br /&gt;
-- TODO:&lt;br /&gt;
-- Add param name normalization: params close enough to snake_case are normal-&lt;br /&gt;
-- ized to snake_case&lt;br /&gt;
&lt;br /&gt;
-- Library module for common operations with handling template input.&lt;br /&gt;
-- - Numbered &amp;lt;anything&amp;gt; to table extract args and places them into a table.&lt;br /&gt;
&lt;br /&gt;
-- Normalize params to snake case; anything close enough to snake case is&lt;br /&gt;
-- converted to snake case:&lt;br /&gt;
-- TRAIN_CASE, KEBEB-CASE, no dashes (OK!)&lt;br /&gt;
-- PascalCase, camelCase (will not convert properly)&lt;br /&gt;
-- Function work-in-progress&lt;br /&gt;
function p.normalize_params(args)&lt;br /&gt;
	&lt;br /&gt;
	-- Local function for normalizing strings&lt;br /&gt;
	-- Spaces and dashes turn into underscores&lt;br /&gt;
	-- and all capital letters become lowercase&lt;br /&gt;
	local function normalize(input_string)&lt;br /&gt;
		local cleaned_string = string.gsub(string.lower(input_string), &amp;quot;[%-%s]&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Extracts numbered args (from frame.args) and stores them into one table.&lt;br /&gt;
-- Removes original numbered args from args table. Sequence of numbered args&lt;br /&gt;
-- may have gaps.&lt;br /&gt;
-- Table of entries is returned without being inserted into the original args&lt;br /&gt;
-- table, as it may require further processing (EG, parsing to number, ratio, &lt;br /&gt;
-- kv-pairs, etc).&lt;br /&gt;
function p.numbered_args_to_table(args, max_num, key_fmt, keep_originals)&lt;br /&gt;
	local max_num = max_num or 100	&lt;br /&gt;
	local key_fmt = key_fmt or &amp;quot;Entry %d&amp;quot;&lt;br /&gt;
	local keep_originals = keep_originals or false		-- Denotes whether to keep originals in table or remove them; default false&lt;br /&gt;
	&lt;br /&gt;
	local entries = {}&lt;br /&gt;
	for i = 1, max_num do&lt;br /&gt;
		local key = string.format(key_fmt, i)		-- Make key&lt;br /&gt;
		local entry = args[key]						-- Extract&lt;br /&gt;
		table.insert(entries, entry)				-- Insert&lt;br /&gt;
		if not keep_originals then&lt;br /&gt;
			args[key] = nil								-- Remove original&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return entries&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Extracts numbered args that correspond to header-data pairs of a two-col&lt;br /&gt;
-- table, commonly seen in navboxes and infoboxes. Removes original numbered&lt;br /&gt;
-- args from args table. Sequence of numbered args may have gaps, and a pair may&lt;br /&gt;
-- have one element be missing/nil (headerless data and dataless header).&lt;br /&gt;
-- Table of entries is returned without being inserted into the original args&lt;br /&gt;
-- table, as it may require further processing (EG, parsing to number, ratio, &lt;br /&gt;
-- kv-pairs, etc).&lt;br /&gt;
function p.numbered_header_data_args_to_table(args, max_num, keep_originals, is_strict_pair, header_fmt, data_fmt)&lt;br /&gt;
	local max_num    = max_num or 100&lt;br /&gt;
	local header_fmt = header_fmt or &amp;quot;Header %d&amp;quot;	&lt;br /&gt;
	local data_fmt   = data_fmt or &amp;quot;Data %d&amp;quot;&lt;br /&gt;
	local is_strict_pair = is_strict_pair or false		-- Denotes whether a pair must have both header and data&lt;br /&gt;
	local keep_originals = keep_originals or false		-- Denotes whether to keep originals in table or remove them; default false&lt;br /&gt;
	&lt;br /&gt;
	local entries = {}&lt;br /&gt;
	for i = 1, max_num do&lt;br /&gt;
		-- Make keys&lt;br /&gt;
		local header_key = string.format(header_fmt, i)&lt;br /&gt;
		local data_key   = string.format(data_fmt, i)&lt;br /&gt;
		&lt;br /&gt;
		-- Extract header and data&lt;br /&gt;
		local header = args[header_key]&lt;br /&gt;
		local data = args[data_key]&lt;br /&gt;
		local entry = { [&amp;quot;Header&amp;quot;] = args[header_key], [&amp;quot;Data&amp;quot;] = args[data_key] }&lt;br /&gt;
		&lt;br /&gt;
		-- Insert&lt;br /&gt;
		if is_strict_pair then&lt;br /&gt;
			if (header and data) then table.insert(entries, entry) end&lt;br /&gt;
		else&lt;br /&gt;
			if (header or  data) then table.insert(entries, entry) end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Remove originals&lt;br /&gt;
		if not keep_originals then&lt;br /&gt;
			args[header_key] = nil&lt;br /&gt;
			args[data_key] = nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return entries&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Some older infoboxes use a jagged array instead of an assoc-array, so convert&lt;br /&gt;
-- two-element tables into a header-data pair, and one-element tables into&lt;br /&gt;
-- either a headerless data row, or a dataless header row.&lt;br /&gt;
-- Default is to interpret size-1 arrays as data rows, which corresponds to how&lt;br /&gt;
-- the infobox worked before it became template-ified. This old input method may&lt;br /&gt;
-- be easier to work with.&lt;br /&gt;
function p.jagged_array_to_header_data_pairs(rows, is_header_row)&lt;br /&gt;
	local is_header_row = is_header_row or false&lt;br /&gt;
	local new_rows = {}&lt;br /&gt;
	for i = 1, #rows do&lt;br /&gt;
		local row = rows[i]&lt;br /&gt;
		if #row == 2 then&lt;br /&gt;
			table.insert(new_rows, { [&amp;quot;Header&amp;quot;] = row[1], [&amp;quot;Data&amp;quot;] = row[2] })&lt;br /&gt;
		elseif #row == 1 and not is_header_row then&lt;br /&gt;
			table.insert(new_rows, { [&amp;quot;Data&amp;quot;  ] = row[1] })&lt;br /&gt;
		elseif #row == 1 and is_header_row then&lt;br /&gt;
			table.insert(new_rows, { [&amp;quot;Header&amp;quot;] = row[1] })&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return new_rows&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tester()&lt;br /&gt;
	local test_args = {&lt;br /&gt;
		[&amp;quot;Entry 1&amp;quot;] = &amp;quot;aaa&amp;quot;,&lt;br /&gt;
		[&amp;quot;Entry 2&amp;quot;] = &amp;quot;bbb&amp;quot;,&lt;br /&gt;
		[&amp;quot;Entry 3&amp;quot;] = &amp;quot;ccc&amp;quot;,&lt;br /&gt;
		[&amp;quot;Header 2&amp;quot;] = &amp;quot;BBB&amp;quot;,&lt;br /&gt;
		[&amp;quot;Entry 5&amp;quot;] = &amp;quot;ddd&amp;quot;,&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	--test_args[&amp;quot;Entries&amp;quot;] = p.numbered_args_to_table(test_args, &amp;quot;Entry %d&amp;quot;, 10)&lt;br /&gt;
	test_args[&amp;quot;Entries&amp;quot;] = p.numbered_header_data_args_to_table(test_args, 10, &amp;quot;Header %d&amp;quot;, &amp;quot;Entry %d&amp;quot;)&lt;br /&gt;
	return test_args&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Template_input_utils&amp;diff=223163</id>
		<title>Module:Template input utils</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Template_input_utils&amp;diff=223163"/>
		<updated>2026-02-04T00:19:55Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: add empty function for param normalizing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: move tip functions here? See [[Module:Template input parse]]&lt;br /&gt;
&lt;br /&gt;
-- TODO:&lt;br /&gt;
-- Add param name normalization: params close enough to snake_case are normal-&lt;br /&gt;
-- ized to snake_case&lt;br /&gt;
&lt;br /&gt;
-- Library module for common operations with handling template input.&lt;br /&gt;
-- - Numbered &amp;lt;anything&amp;gt; to table extract args and places them into a table.&lt;br /&gt;
&lt;br /&gt;
-- Normalize params to snake case; anything close enough to snake case is&lt;br /&gt;
-- converted to snake case:&lt;br /&gt;
-- - PascalCase -&amp;gt; pascal_case&lt;br /&gt;
-- - camelCase -&amp;gt; camel_case&lt;br /&gt;
-- - ALL_CAPS -&amp;gt; all_caps&lt;br /&gt;
-- - TRAIN-CASE -&amp;gt; train_case&lt;br /&gt;
-- - kebab-case -&amp;gt; kebab_case&lt;br /&gt;
-- - Whatever-This-Case-Is -&amp;gt; whatever_this_case_is&lt;br /&gt;
-- - lowercase, UPPERCASE -&amp;gt; cannot be converted properly (lowercase, uppercase)&lt;br /&gt;
function p.normalize_params(args)&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Extracts numbered args (from frame.args) and stores them into one table.&lt;br /&gt;
-- Removes original numbered args from args table. Sequence of numbered args&lt;br /&gt;
-- may have gaps.&lt;br /&gt;
-- Table of entries is returned without being inserted into the original args&lt;br /&gt;
-- table, as it may require further processing (EG, parsing to number, ratio, &lt;br /&gt;
-- kv-pairs, etc).&lt;br /&gt;
function p.numbered_args_to_table(args, max_num, key_fmt, keep_originals)&lt;br /&gt;
	local max_num = max_num or 100	&lt;br /&gt;
	local key_fmt = key_fmt or &amp;quot;Entry %d&amp;quot;&lt;br /&gt;
	local keep_originals = keep_originals or false		-- Denotes whether to keep originals in table or remove them; default false&lt;br /&gt;
	&lt;br /&gt;
	local entries = {}&lt;br /&gt;
	for i = 1, max_num do&lt;br /&gt;
		local key = string.format(key_fmt, i)		-- Make key&lt;br /&gt;
		local entry = args[key]						-- Extract&lt;br /&gt;
		table.insert(entries, entry)				-- Insert&lt;br /&gt;
		if not keep_originals then&lt;br /&gt;
			args[key] = nil								-- Remove original&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return entries&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Extracts numbered args that correspond to header-data pairs of a two-col&lt;br /&gt;
-- table, commonly seen in navboxes and infoboxes. Removes original numbered&lt;br /&gt;
-- args from args table. Sequence of numbered args may have gaps, and a pair may&lt;br /&gt;
-- have one element be missing/nil (headerless data and dataless header).&lt;br /&gt;
-- Table of entries is returned without being inserted into the original args&lt;br /&gt;
-- table, as it may require further processing (EG, parsing to number, ratio, &lt;br /&gt;
-- kv-pairs, etc).&lt;br /&gt;
function p.numbered_header_data_args_to_table(args, max_num, keep_originals, is_strict_pair, header_fmt, data_fmt)&lt;br /&gt;
	local max_num    = max_num or 100&lt;br /&gt;
	local header_fmt = header_fmt or &amp;quot;Header %d&amp;quot;	&lt;br /&gt;
	local data_fmt   = data_fmt or &amp;quot;Data %d&amp;quot;&lt;br /&gt;
	local is_strict_pair = is_strict_pair or false		-- Denotes whether a pair must have both header and data&lt;br /&gt;
	local keep_originals = keep_originals or false		-- Denotes whether to keep originals in table or remove them; default false&lt;br /&gt;
	&lt;br /&gt;
	local entries = {}&lt;br /&gt;
	for i = 1, max_num do&lt;br /&gt;
		-- Make keys&lt;br /&gt;
		local header_key = string.format(header_fmt, i)&lt;br /&gt;
		local data_key   = string.format(data_fmt, i)&lt;br /&gt;
		&lt;br /&gt;
		-- Extract header and data&lt;br /&gt;
		local header = args[header_key]&lt;br /&gt;
		local data = args[data_key]&lt;br /&gt;
		local entry = { [&amp;quot;Header&amp;quot;] = args[header_key], [&amp;quot;Data&amp;quot;] = args[data_key] }&lt;br /&gt;
		&lt;br /&gt;
		-- Insert&lt;br /&gt;
		if is_strict_pair then&lt;br /&gt;
			if (header and data) then table.insert(entries, entry) end&lt;br /&gt;
		else&lt;br /&gt;
			if (header or  data) then table.insert(entries, entry) end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Remove originals&lt;br /&gt;
		if not keep_originals then&lt;br /&gt;
			args[header_key] = nil&lt;br /&gt;
			args[data_key] = nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return entries&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Some older infoboxes use a jagged array instead of an assoc-array, so convert&lt;br /&gt;
-- two-element tables into a header-data pair, and one-element tables into&lt;br /&gt;
-- either a headerless data row, or a dataless header row.&lt;br /&gt;
-- Default is to interpret size-1 arrays as data rows, which corresponds to how&lt;br /&gt;
-- the infobox worked before it became template-ified. This old input method may&lt;br /&gt;
-- be easier to work with.&lt;br /&gt;
function p.jagged_array_to_header_data_pairs(rows, is_header_row)&lt;br /&gt;
	local is_header_row = is_header_row or false&lt;br /&gt;
	local new_rows = {}&lt;br /&gt;
	for i = 1, #rows do&lt;br /&gt;
		local row = rows[i]&lt;br /&gt;
		if #row == 2 then&lt;br /&gt;
			table.insert(new_rows, { [&amp;quot;Header&amp;quot;] = row[1], [&amp;quot;Data&amp;quot;] = row[2] })&lt;br /&gt;
		elseif #row == 1 and not is_header_row then&lt;br /&gt;
			table.insert(new_rows, { [&amp;quot;Data&amp;quot;  ] = row[1] })&lt;br /&gt;
		elseif #row == 1 and is_header_row then&lt;br /&gt;
			table.insert(new_rows, { [&amp;quot;Header&amp;quot;] = row[1] })&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return new_rows&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tester()&lt;br /&gt;
	local test_args = {&lt;br /&gt;
		[&amp;quot;Entry 1&amp;quot;] = &amp;quot;aaa&amp;quot;,&lt;br /&gt;
		[&amp;quot;Entry 2&amp;quot;] = &amp;quot;bbb&amp;quot;,&lt;br /&gt;
		[&amp;quot;Entry 3&amp;quot;] = &amp;quot;ccc&amp;quot;,&lt;br /&gt;
		[&amp;quot;Header 2&amp;quot;] = &amp;quot;BBB&amp;quot;,&lt;br /&gt;
		[&amp;quot;Entry 5&amp;quot;] = &amp;quot;ddd&amp;quot;,&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	--test_args[&amp;quot;Entries&amp;quot;] = p.numbered_args_to_table(test_args, &amp;quot;Entry %d&amp;quot;, 10)&lt;br /&gt;
	test_args[&amp;quot;Entries&amp;quot;] = p.numbered_header_data_args_to_table(test_args, 10, &amp;quot;Header %d&amp;quot;, &amp;quot;Entry %d&amp;quot;)&lt;br /&gt;
	return test_args&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Mbox/doc&amp;diff=223054</id>
		<title>Template:Mbox/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Mbox/doc&amp;diff=223054"/>
		<updated>2026-02-02T02:08:31Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: /* Usage */ it&amp;#039;s more than 3 params now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dochead|header=metatemplate}}{{Wikipedia}}{{templatestyles}}&lt;br /&gt;
The &#039;&#039;&#039;Mbox&#039;&#039;&#039; template is a metatemplate which is used to create message boxes which are placed at the top of a page. It is intended to be used in other templates for messages which are expected to be used on multiple pages.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
The template accepts the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;: Defines the &amp;quot;class&amp;quot; of the message box (&amp;quot;mbox&amp;quot; for a standard message box, &amp;quot;alert&amp;quot; for alerts, etc.)&lt;br /&gt;
* &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt;: Defines the color of the left border; the type should be chosen according to context, not for aesthetic reasons. Types are described in the next section.&lt;br /&gt;
* &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;: Message to be displayed in the box.&lt;br /&gt;
* &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt;: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box.&lt;br /&gt;
* &amp;lt;code&amp;gt;icon size&amp;lt;/code&amp;gt;: Size of the icon displayed. Default is 60px.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Types and examples ===&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;delete&#039;&#039;&#039; type. Typically used for pages whose content is deprecated or to be deleted.|type=delete}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;content&#039;&#039;&#039; type. Typically used for pages whose content requires verification or rewriting.|type=content}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;style&#039;&#039;&#039; type. Typically used for pages whose writing deviates from the wiki&#039;s standards.|type=style}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;ready&#039;&#039;&#039; type. Used to denote wiki features (such as templates) that are ready for use.|type=ready}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;notice&#039;&#039;&#039; type. Used to denote general notices. Most messageboxes are of this type.|type=notice}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;move&#039;&#039;&#039; type. Denotes pages that are to be moved.|type=move}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;protection&#039;&#039;&#039; type. Denotes pages that are protected from editing.|type=protection}}&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template: Alert]]&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk&amp;diff=223053</id>
		<title>User:Ganaram inukshuk</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk&amp;diff=223053"/>
		<updated>2026-02-02T01:34:55Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: /* Contributions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I generally go by &amp;quot;Ganaram&amp;quot; or some variant of that (ganaram_inukshuk, gdinuk). (Discord: ganaraminukshuk0; he/they; generally more active on the Xen Discord unless work bogs me down.)&lt;br /&gt;
&lt;br /&gt;
I&#039;ve heard about microtonality on and off over the years, but what drew me into the topic was two things: HEHEHE I AM A SUPAHSTAR SAGA&#039;s video series on 19edo and Patricia Taxxon&#039;s song Spiral Staircase.&lt;br /&gt;
&lt;br /&gt;
From a compositional perspective, my goal is to incorporate xenharmonic elements into an otherwise normal-sounding song, though my more ambitious goal is to not use the diatonic (LLLsLLs) scale structure at all.&lt;br /&gt;
&lt;br /&gt;
From a theory perspective, my goal is to better understand xenharmony from a temperament-agnostic perspective. This primarily means edos and MOSses, but extends to MV3 scales and higher.&lt;br /&gt;
&lt;br /&gt;
From a wikian perspective, my goal is to better the wiki itself, at least as it pertains to how mos-related info is displayed. The most immediate way to achieve this is to create and deploy templates for the most commonly displayed mos-related info, as well as wikifying any text present (so it looks like an actual wiki page!) and trying to verify the source or attribution to things taken for granted (because misattribution happens concerningly). I&#039;ve written a style guide to be applied to all mos pages (see subpages below), but I&#039;m also open to better ideas.&lt;br /&gt;
&lt;br /&gt;
== Main mindset ==&lt;br /&gt;
I summarize my main mindset using the following trinity: &#039;&#039;&#039;temperaments, mosses, and edos are not each other&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Temperaments produce mosses, but two different temperaments may produce the same mos. Edos support more than one family of mos, so it&#039;s fruitless to shoehorn the notation meant for one mos for a different mos within the same edo. Two temperaments may produce the same JI ratio, but have different qualities in different mosses.&lt;br /&gt;
&lt;br /&gt;
This level of decoupling makes it so I don&#039;t let any one temperament, mos, or edo influence how I look at either. Just because a nondiatonic mos has a perfect 5th doesn&#039;t mean I should think of it as such, especially if that isn&#039;t the generator to begin with.&lt;br /&gt;
&lt;br /&gt;
That said, I focus more on mosses and, secondarily, edos when it comes to this trinity. I prefer to look at scales based in a temperament-agnostic sense, as mosses that are supported by an edo, or different edos. Doing so relieves me of the expectation that a certain interval must necessarily fall within a few cents of a [[Just intonation|JI]] ratio and lets me be more explorative with musical scales. This is also less names to memorize, since there are a lot of temperament names, and looking at mosses directly means fewer names to remember.&lt;br /&gt;
&lt;br /&gt;
Other running assumptions and techniques may be found under the methodologies page below.&lt;br /&gt;
&lt;br /&gt;
== TO-DO list, major contributions, and wish list ==&lt;br /&gt;
=== Contributions ===&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;font-size: 105%; white-space: nowrap;&amp;quot; | Major work on modules and templates in (roughly) chronological order of inception or involvement&lt;br /&gt;
|-&lt;br /&gt;
! Modules and templates&lt;br /&gt;
! New?&lt;br /&gt;
! Description of template or contribution&lt;br /&gt;
! Status or todo&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:SB tree]]&lt;br /&gt;
[[Template:SB tree]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Creates a Stern-Brocot tree&#039;s entries and their depths.&lt;br /&gt;
| Fallen into disuse.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Scale tree|&amp;lt;s&amp;gt;Module:Scale tree&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:Scale tree|&amp;lt;s&amp;gt;Template:Scale tree&amp;lt;/s&amp;gt;]]&lt;br /&gt;
| No&lt;br /&gt;
| Automates the creation of a mos&#039;s scale tree and tuning spectrum.&lt;br /&gt;
Contributor with CompactStar. (I made it so comments can be entered using one param.)&lt;br /&gt;
| &#039;&#039;&#039;Deprecated, following changes that made it unmaintainable.&#039;&#039;&#039;&lt;br /&gt;
Superseded by Module:MOS tuning spectrum.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS modes]]&lt;br /&gt;
[[Template:MOS modes]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays the modes of a mos.&lt;br /&gt;
| Current means of row/col data is not ideal.&lt;br /&gt;
Further developments uncertain due to personal decision to halt further improvement.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS intro]]&lt;br /&gt;
[[Template:MOS intro]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Creates a consistent, common introductory paragraph for a mos page&#039;s lead section.&lt;br /&gt;
| &#039;&#039;&#039;Possibly rewrite to follow new coding conventions.&#039;&#039;&#039;&lt;br /&gt;
Rewording for nonoctave tunings.&lt;br /&gt;
&lt;br /&gt;
Deprecate name fields as they&#039;re redundant if used with Template:TAMNAMS name.&lt;br /&gt;
&lt;br /&gt;
Possible refactoring.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS gamut]]&lt;br /&gt;
[[Template:MOS gamut]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Given a notation scheme and assigned mode for a mos for an edo, display the note names.&lt;br /&gt;
| Fallen into disuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;[[Module:MOS degrees]]&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;s&amp;gt;[[Template:MOS degrees]]&amp;lt;/s&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays cent values for a mos for up to 5 step ratios.&lt;br /&gt;
| &#039;&#039;&#039;Deprecated, following decision to start over.&#039;&#039;&#039;&lt;br /&gt;
Superseded by Module:MOS tunings.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS notation]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Helper module for displaying mos notation.&lt;br /&gt;
| Fallen into disuse.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS intervals]]&lt;br /&gt;
[[Template:MOS intervals]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays the interval names of a mos and their cent ranges.&lt;br /&gt;
Rewritten to new coding conventions.&lt;br /&gt;
| Experiment with interval lookup.&lt;br /&gt;
&#039;&#039;&#039;REFACTOR.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS mode degrees]]&lt;br /&gt;
[[Template:MOS mode degrees]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays the qualities of each scale degree of every mode of a mos.&lt;br /&gt;
| &#039;&#039;&#039;Possibly rewrite to follow new coding conventions.&#039;&#039;&#039;&lt;br /&gt;
Split modmos info into its own template; see Template:MODMOS mode degrees.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REFACTOR.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS in EDO]]&lt;br /&gt;
[[Template:MOS in EDO]]&lt;br /&gt;
| Yes&lt;br /&gt;
|  rowspan=&amp;quot;4&amp;quot; | Displays and visualizes the mosses that an edo contains.&lt;br /&gt;
&lt;br /&gt;
* MOS in EDO: shows the mosses created using a particular generator and period.&lt;br /&gt;
* ...allgens: shows all mosses for all generators for a particular period.&lt;br /&gt;
* ...allperiods or MOSes in EDO: shows all mosses for all generators for all periods.&lt;br /&gt;
|  rowspan=&amp;quot;4&amp;quot; | &#039;&#039;&#039;To be rewritten as a subst-template.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS in EDO allgens]]&lt;br /&gt;
[[Template:MOS in EDO allgens]]&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS in EDO allperiods]]&lt;br /&gt;
[[Template:MOS in EDO allperiods]]&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOSes in EDO]] (shortcut template)&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Template input parse]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Helper module for various templates that have large amounts of info to be displayed.&lt;br /&gt;
| Possible reorganization?&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Step vis]]&lt;br /&gt;
[[Template:Step vis]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Step visualization template for MOS(es) in EDO for standalone use.&lt;br /&gt;
| Consider html-based visualization?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;[[Module:EDO intro]]&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;s&amp;gt;[[Template:EDO intro]]&amp;lt;/s&amp;gt;&lt;br /&gt;
| Yes (module only)&lt;br /&gt;
| Automation of the EDO intro.&lt;br /&gt;
| &#039;&#039;&#039;Deprecated.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Superseded by Module:ED intro.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;[[Module:JI ratio finder]]&amp;lt;/s&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| Helper module for JI ratios in ED. Superseded by Module:JI ratios.&lt;br /&gt;
| Fallen into disuse, but not officially deprecated.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:JI ratios in ED|&amp;lt;s&amp;gt;Module:JI ratios in ED&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:JI ratios in ED|&amp;lt;s&amp;gt;Template:JI ratios in ED&amp;lt;/s&amp;gt;]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Creates a table showing the JI ratios approximated by an ED.&lt;br /&gt;
| Fallen into disuse, as JI ratio finder was superseded.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Xenpaper]]&lt;br /&gt;
| Yes&lt;br /&gt;
| For making links to audio examples to be listened to.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:ED intro]]&lt;br /&gt;
[[Template:ED intro]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Automation of the EDO intro, generalized for other equaves.&lt;br /&gt;
| Possible code cleanup.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Idiosyncratic terms]]&lt;br /&gt;
| Yes&lt;br /&gt;
| An alternative to [[Template:Idiosyncratic]] when the original&#039;s use is infeasible.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Infobox MOS]]&lt;br /&gt;
[[Template:Infobox MOS]]&lt;br /&gt;
| No&lt;br /&gt;
| Code cleanup and additional info.&lt;br /&gt;
Moved 8-link infobox to infobox module.&lt;br /&gt;
| &#039;&#039;&#039;Possibly rewrite to follow new coding conventions.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Infobox]]&lt;br /&gt;
| No&lt;br /&gt;
| Support for infoboxes with 8 navlinks added.&lt;br /&gt;
| &#039;&#039;&#039;REFACTOR.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Keyboard vis]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Keyboard visualization template for Infobox MOS. No template currently exists.&lt;br /&gt;
| Possibly extend to ternary and quaternary scales.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Mbox]]&lt;br /&gt;
| No&lt;br /&gt;
| Added the option to show an icon.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Quickstart]]&lt;br /&gt;
[[Template:Has quickstart]]&lt;br /&gt;
| Yes&lt;br /&gt;
| For disambiguating pages meant for theory from pages meant for practice, and for linking between them.&lt;br /&gt;
| ROLLOUT.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS]]&lt;br /&gt;
| No&lt;br /&gt;
| Splitting TAMNAMS-related stuff to its own module.&lt;br /&gt;
Redefining the module into a library for all mos-related templates/modules.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:TAMNAMS]]&lt;br /&gt;
| Yes&lt;br /&gt;
| A module that contains the entire TAMNAMS specification as it pertains to mosses and step ratios.&lt;br /&gt;
Has lookup functions for names and related mosses.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:TAMNAMS use]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Shows that a scale page uses TAMNAMS.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS genchain]]&lt;br /&gt;
[[Template:MOS genchain]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Shows the generator chain of a mos.&lt;br /&gt;
| Dev on hold.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOS scale properties|&amp;lt;s&amp;gt;Template:MOS scale properties&amp;lt;/s&amp;gt;]] (former name)&lt;br /&gt;
|  rowspan=&amp;quot;2&amp;quot; | Yes&lt;br /&gt;
|  rowspan=&amp;quot;2&amp;quot; | Combo template of:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;s&amp;gt;Template:TAMNAMS use&amp;lt;/s&amp;gt;&lt;br /&gt;
* Template:MOS intervals&lt;br /&gt;
* Template:MOS genchain&lt;br /&gt;
* Template:MOS mode degrees&lt;br /&gt;
|  rowspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Deprecated, following changes that made it unmaintainable.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;No combo templates for mos pages.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS data|&amp;lt;s&amp;gt;Module:MOS data&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:MOS data|&amp;lt;s&amp;gt;Template:MOS data&amp;lt;/s&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:TAMNAMS lookup]]&lt;br /&gt;
[[Template:TAMNAMS lookup]]&lt;br /&gt;
| Yes&lt;br /&gt;
| TAMNAMS name lookup as a standalone template.&lt;br /&gt;
| Dev direction unclear.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:TAMNAMS name]]&lt;br /&gt;
| Yes&lt;br /&gt;
| For writing the paragraph that states a mos&#039;s TAMNAMS name and its etymology or reasoning.&lt;br /&gt;
| ROLLOUT.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS interval HE]]&lt;br /&gt;
[[Template:MOS interval HE]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Standalone template for harmonic entropy.&lt;br /&gt;
Formerly a part of MOS intervals; added by [[User:R-4981]] but separated due to concerns regarding HE.&lt;br /&gt;
| Further developments uncertain.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS tunings]]&lt;br /&gt;
[[Template:MOS tunings]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Replacement for Template:MOS degrees.&lt;br /&gt;
| &#039;&#039;&#039;Rewrite to follow new coding conventions.&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Nutshell]]&lt;br /&gt;
| Yes&lt;br /&gt;
| See equivalent template on Wikipedia.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:JI ratios]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Module for searching for JI ratios, as well as parsing them from template input.&lt;br /&gt;
Replacement for Module:JI ratio finder.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Mediants]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Standalone template for mediant calculations. To be used for the following modules:&lt;br /&gt;
&lt;br /&gt;
* Module:SB tree&lt;br /&gt;
* &amp;lt;s&amp;gt;Module:Scale tree&amp;lt;/s&amp;gt;&lt;br /&gt;
* Module:MOS tuning spectrum&lt;br /&gt;
* Module:JI ratios&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Deprecated parameters]]&lt;br /&gt;
| Yes&lt;br /&gt;
| A module for denoting one or more deprecated parameters in a template.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | New templates after this line follow new (personal) coding conventions, outlined in v1 of my style guide.&lt;br /&gt;
|-&lt;br /&gt;
! Modules and templates&lt;br /&gt;
! New?&lt;br /&gt;
! Description of template or contribution&lt;br /&gt;
! Status or todo&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Navbox]]&lt;br /&gt;
[[Module:Navbox]]&lt;br /&gt;
| Yes&lt;br /&gt;
| A template and module for producing a navbox. Module builds up navbox from input.&lt;br /&gt;
Navboxes can be made either as a template or using a lua module calling the navbox functions.&lt;br /&gt;
|Possibly add templatestyles integration&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Infobox]]&lt;br /&gt;
[[Template:Infobox]]&lt;br /&gt;
| Yes (template only)&lt;br /&gt;
| Rewrote entire infobox from scratch to support infobox template.&lt;br /&gt;
Same as navbox; infoboxes can be made either using a module calling the infobox functions or with a template.&lt;br /&gt;
|Possibly add templatestyles integration&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Numlinks]]&lt;br /&gt;
[[Template:Numlinks]]&lt;br /&gt;
|Yes&lt;br /&gt;
| A template for calculating and creating prev/next links for a numbered page. Pages are incremented (or decremented) by 1.&lt;br /&gt;
| Possibly let template auto-extract text.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOS tuning spectrum]]&lt;br /&gt;
[[Module:MOS tuning spectrum]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Made to address maintenance issues with Module:Scale tree.&lt;br /&gt;
Comment entries are reverted back to having one param per ratio, where params are generated on the fly, not hardocded.&lt;br /&gt;
| Add comments for step ratios not found by search.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOS scalesig]]&lt;br /&gt;
[[Module:MOS scalesig]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Made to address shortcomings with [[Template:Scale link]] and need to format mos scalesigs.&lt;br /&gt;
This template auto-formats a scale signature:&lt;br /&gt;
&lt;br /&gt;
* Spaces are replaced with nonbreaking spaces.&lt;br /&gt;
* For nonoctave scales, angle brackets are replaced with the appropriate ones.&lt;br /&gt;
* Can format the scalesig as a link, if needed.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;Template:MOS stub&amp;lt;/s&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| A proposed combination template consisting of:&lt;br /&gt;
&lt;br /&gt;
* Template:Infobox MOS&lt;br /&gt;
* Template:MOS intro&lt;br /&gt;
* Template:MOS intervals&lt;br /&gt;
* Template:MOS tuning spectrum&lt;br /&gt;
Such a template would be a subst-template.&lt;br /&gt;
| &#039;&#039;&#039;Cancelled. No combo templates for mos pages.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:JI ratios]]&lt;br /&gt;
|Yes&lt;br /&gt;
|Rewrite of existing JI ratios module into two modules: one for searching for ratios, and one for filtering ratios&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Disavowed]]&lt;br /&gt;
|Yes&lt;br /&gt;
|Denotes terms whose usage is no longer advised, generally due to the name being unsuitable (EG, offensive, inappropriate, etc) or due to the person who coined the term retracting it.&lt;br /&gt;
|Use-cases to be determined.&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Navbox Lumatone]]&lt;br /&gt;
[[Template:Navbox fractional-octave]]&lt;br /&gt;
[[Module:Navbar]]&lt;br /&gt;
|No&lt;br /&gt;
|Decoupling navbar so it doesn&#039;t generate navboxes&#039; or their prev/next links; that work is delegated to Template:Numlinks and Template:Navbox.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Sidebar]]&lt;br /&gt;
[[Module:Sidebar]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A template that&#039;s a basic implementation of Wikipedia&#039;s sidebar. Some infobox-like templates use this over the actual infobox, so it&#039;s made into an actual template.&lt;br /&gt;
|Possibly add templatestyles integration&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Template input utils]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A library for preprocessing template args.&lt;br /&gt;
May possibly be a new location for Module:Template input parse (TIP).&lt;br /&gt;
&lt;br /&gt;
Proposed functions:&lt;br /&gt;
&lt;br /&gt;
* numbered_args_to_table(args, key_fmt, max_num)&lt;br /&gt;
* header_data_pairs_to_table(args, header_fmt, data_fmt)&lt;br /&gt;
* Functions to parse key-value, ratios, and sequences of ratios (from TIP)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Numlinks 2-num]]&lt;br /&gt;
[[Module:Numlinks 2-num]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A variant of numlinks that supports two varying numbers. Intended for pages such as mosses, EG 5L 2s.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Template rating]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A template that implements Wikipedia&#039;s template/module rating template. Advises editors that the template is one of several things:&lt;br /&gt;
&lt;br /&gt;
* Draft; a mockup of a new template/module that is undergoing testing. Not ready for use anywhere except test pages. (encompasses pre-alpha/alpha/beta/mockup)&lt;br /&gt;
* Ready; template/module is ready for use&lt;br /&gt;
* Broken; self-explanatory. Definitely do not use until it&#039;s either fixed or deemed unfixable.&lt;br /&gt;
* Replaced; template is deprecated and has a replacement; template is kept for archival purposes or can be deleted.&lt;br /&gt;
* Deprecated; do not use anywhere; template is kept for archival purposes or can be deleted.&lt;br /&gt;
|In development&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Category handler]]&lt;br /&gt;
[[Module:Category handler]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A proposed template-module pair that is a basic implementation of Wikipedia&#039;s module of the same name: https://en.wikipedia.org/wiki/Module:Category_handler&lt;br /&gt;
Features:&lt;br /&gt;
&lt;br /&gt;
* Allows templates to categorize pages, given a list of categories&lt;br /&gt;
&lt;br /&gt;
* Suppresses categories based on a list of suppressed namespaces (configurable) and a list of suppressed suffixes (subpages; configurable)&lt;br /&gt;
* Module is standalone; it requires no other modules as dependencies, apart from possibly utility modules.&lt;br /&gt;
|Attempted in the past by someone else but was deleted.&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Todo]]&lt;br /&gt;
|No&lt;br /&gt;
|Integrate category handler so templates/modules with todos don&#039;t get categorized twice (once for the template/module and once more for its /doc page)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; |New templates after this line follow new (personal) coding conventions, outlined in v2 of my style guide. Features:&lt;br /&gt;
Use of snake_case for ALL param names; previous templates go through template name normalization to maintain backwards-compatibility (automated for lua-based templates)&lt;br /&gt;
&lt;br /&gt;
For lua-based templates, no params will ever be defined at the template level, instead defined at the module level&lt;br /&gt;
|-&lt;br /&gt;
!Modules and templates&lt;br /&gt;
!New?&lt;br /&gt;
!Description of template or contribution&lt;br /&gt;
!Status or todo&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Module introspection]]&lt;br /&gt;
[[Template:Module introspection]]&lt;br /&gt;
|Yes&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |A set of modules that inspects mediawiki templates and lua code for:&lt;br /&gt;
&lt;br /&gt;
* (FOR TEMPLATES): detecting whether a template invokes a module&#039;s function&lt;br /&gt;
* (FOR MODULES): detecting a module&#039;s dependencies and the functions used.&lt;br /&gt;
&lt;br /&gt;
Common functionality is stored in Module:Introspection utils. Module introspection serves to implement this functionality for modules; template introspection is handled as part of Module:Dochead.&lt;br /&gt;
&lt;br /&gt;
These templates/changes replace [[Template:Lua]] as used on module docpaegs.&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Template introspection|&amp;lt;s&amp;gt;Module:Template introspection&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:Template introspection|&amp;lt;s&amp;gt;Template:Template introspection&amp;lt;/s&amp;gt;]]&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Introspection utils]]&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Dochead]]&lt;br /&gt;
[[Template:Dochead]]&lt;br /&gt;
|Yes (module only)&lt;br /&gt;
|Proposed module is a rewrite of Template:Dochead that makes the template able to:&lt;br /&gt;
&lt;br /&gt;
* Autodetect modules with corresponding templates, with options for overrides&lt;br /&gt;
* Autodetect templates with corresponding modules, with options for overrides&lt;br /&gt;
* Display which functions are invoked and from which modules.&lt;br /&gt;
These templates/changes replace [[Template:Lua]] as used on template docpages.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|All deprecation templates except [[Template:Deprecated parameters]]&lt;br /&gt;
|No&lt;br /&gt;
|Minor changes to inform editors if they&#039;re used in the wrong namespaces.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|All categorizing infoboxes:&lt;br /&gt;
&lt;br /&gt;
* [[Template:Infobox MOS]]&lt;br /&gt;
* [[Template:Infobox AFDO]]&lt;br /&gt;
* [[Template:Infobox chord]]&lt;br /&gt;
* [[Template:Infobox ET]]&lt;br /&gt;
* [[Template:Infobox interval]]&lt;br /&gt;
|No&lt;br /&gt;
|Proposal to add [[Module:Category handler]] so these templates automatically categorize themselves when in the correct namespaces&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Template:Keyboard vis&lt;br /&gt;
|&lt;br /&gt;
|See Module:Keyboard vis.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:ED ratios&lt;br /&gt;
Template:ED ratios&lt;br /&gt;
|&lt;br /&gt;
| A proposed template that is an upgraded version of Module:JI ratios in ED&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:Interval regions&lt;br /&gt;
|&lt;br /&gt;
| A proposed module for roughly classifying diatonic intervals (1st, 2nd etc; major, minor) plus some intermediate or in-between categories ( neutral and interseptimal intervals)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:MODMOS mode degrees&lt;br /&gt;
Template:MODMOS mode degrees&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:MOS superset degrees&lt;br /&gt;
Template:MOS superset degrees&lt;br /&gt;
|&lt;br /&gt;
| Like MOS mode degrees, except the scale degrees are in relation to an ancestor mos.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Wikiprojects and style guides ===&lt;br /&gt;
* [[Xenharmonic Wiki:WikiProject Mospage|Project Mospage]] and [[Xenharmonic Wiki:MOS page style guide|mospage style guide]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Docpage style guide|Docpage style guide]] (not worthy of a wikiproject since most docpages have been written alraedy)&lt;br /&gt;
&lt;br /&gt;
=== Project mbox-icon ===&lt;br /&gt;
Various wikis have custom/themed icons. Apart from exceptions where a more common icon is preferred, why not have custom mbox icons for xenwiki?&lt;br /&gt;
&lt;br /&gt;
=== Other contributions ===&lt;br /&gt;
* Mos page standardization (work-in-progress)&lt;br /&gt;
* [[Recursive structure of MOS scales|MOS recursion and MOS recursion algorithms]]; tried my best to make the descriptions for MOS recursion apply to all cases (Work-in-progress)&lt;br /&gt;
* Some rewording of the [[TAMNAMS]] page for readability and flow. I have a few TAMNAMS-related proposals of my own that aren&#039;t quite ready to be called official. See todo list or TAMNAMS subpage.&lt;br /&gt;
* [[Horogram|A page for horograms]], since it was totally absent (Work-in-progress).&lt;br /&gt;
* [[MOS Scale Family Tree|Mos family tree page]] for a tree I independently discovered before realizing Erv Wilson had already described it. Also has to do with mos recursion.&lt;br /&gt;
&lt;br /&gt;
===To-do list ===&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;s&amp;gt;Rewrite page(s)&amp;lt;/s&amp;gt; Under jurisdiction of Project Mospage.&#039;&#039;&#039;&lt;br /&gt;
** [[Operations on MOSes|&amp;lt;s&amp;gt;Operations on MOSes&amp;lt;/s&amp;gt;]]&lt;br /&gt;
** [[MOS scale|&amp;lt;s&amp;gt;MOS scale&amp;lt;/s&amp;gt;]]&lt;br /&gt;
** &amp;lt;s&amp;gt;[[TAMNAMS/Appendix]] (primarily for names reasoning and adding general principles)&amp;lt;/s&amp;gt;&lt;br /&gt;
** &amp;lt;s&amp;gt;[[TAMNAMS Extension]] (since such names should follow the same naming principles as the &amp;quot;named range&amp;quot; names, but no such principles currently exist)&amp;lt;/s&amp;gt;&lt;br /&gt;
* &amp;lt;s&amp;gt;&#039;&#039;&#039;Rewrite all octave-equivalent mos pages.&#039;&#039;&#039; This is primarily replacing every scale tree for the corresponding template and rewriting the lead sections to make sense and does not present redundant information already given by one of the templates. To a lesser extent, this also involves trying to confirm temperaments said to be attributed to these mosses, but this step will require additional help.&amp;lt;/s&amp;gt; &#039;&#039;&#039;Under jurisdiction of Project Mospage.&#039;&#039;&#039;&lt;br /&gt;
** &amp;lt;s&amp;gt;This is done concurrently with writing a style guide for these pages; see [[User:Ganaram inukshuk/MOS page standardization guide]] for a proposed guide.&amp;lt;/s&amp;gt;&lt;br /&gt;
** &amp;lt;s&amp;gt;Mosses whose pages have been rewritten to meet the style guide to satisfactory levels (that doesn&#039;t mean the pages can&#039;t be polished further!):&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;5L 1s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;5L 2s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;4L 3s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;3L 4s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;2L 5s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;1L 5s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;7L 1s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;3L 7s&amp;lt;/s&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Update templates I&#039;ve made to current coding style/structure&#039;&#039;&#039;:&lt;br /&gt;
** The template calls a wrapper function, meant to be used with template params as input. Its name should be suggestive of the module&#039;s primary use, and is usually the same name as the template.&lt;br /&gt;
** The wrapper function calls the &amp;quot;main function&amp;quot;, which has the code that produces the output. Its name is the same as name as with the wrapper function, except it&#039;s prefixed by an underscore.&lt;br /&gt;
* Clean up mos recursion page (because I feel bad leaving the algorithms untouched and untested for so long).&lt;br /&gt;
** Replace pseudocode for is-this-scale-a-mos? program with python code; clarify with more examples.&lt;br /&gt;
** Relate mos recursion with the mos family tree.&lt;br /&gt;
** All the recursive algorithms described on that page have time complexities of O(n log n), but the algorithm that generates a Christoffel word (combinatorics-on-words term for the brightest mode of a mos) has a time complexity of O(n). Resolve...?&lt;br /&gt;
* Standardize mosinedo pages. Examples include:&lt;br /&gt;
** [[List of MOS scales in 12edo]]&lt;br /&gt;
** [[List of MOS scales in 17edo]]&lt;br /&gt;
** [[List of MOS scales in 29edo]]&lt;br /&gt;
** [[List of MOS scales in 31edo]]&lt;br /&gt;
&lt;br /&gt;
=== Wish list ===&lt;br /&gt;
* Composing music with these abstract ideas.&lt;br /&gt;
&lt;br /&gt;
== Subpages ==&lt;br /&gt;
These pages contain content that currently don&#039;t have an exact place elsewhere on the Wiki, or contains personal notes that otherwise don&#039;t have an exact place on the Wiki. I do my best to explain these things as though I magically forgot everything I know about xenharmony, so I consider it a bonus if someone else found this easy to understand.&lt;br /&gt;
* [[User:Ganaram inukshuk/Diagrams]] – For xen-related diagrams&lt;br /&gt;
* [[User:Ganaram inukshuk/Notes]] – For xen-related notes&lt;br /&gt;
** [[User:Ganaram inukshuk/Notes/TAMNAMS]] – Since I have so many notes related to TAMNAMS, I made a dedicated page for it&lt;br /&gt;
* [[User:Ganaram inukshuk/Tables]] – For xen-related tables&lt;br /&gt;
* [[User:Ganaram inukshuk/Code]] – For xen-related code&lt;br /&gt;
* [[User:Ganaram inukshuk/Models]] – For xen-related models (needs reorganizing)&lt;br /&gt;
* [[User:Ganaram inukshuk/TAMNAMS Extension]] – Since there were others making their own TAMNAMS extension pages, I decided to make my own.&lt;br /&gt;
** [[User:Ganaram inukshuk/TAMEX]] – Rewrite of the above page for describing any mos descendant, short for &amp;quot;temperament-agnostic moment-of-symmetry scale extension description system&amp;quot;&lt;br /&gt;
** [[User:Ganaram inukshuk/Additional temperament-agnostic mos names]] – Rewrite of the above page for names for proposed names.&lt;br /&gt;
&lt;br /&gt;
These pages are descriptions on how I approach various things, such as compositional techniques and how I approach a scale I&#039;ve never used before.&lt;br /&gt;
* [[User:Ganaram inukshuk/Methodologies]]&lt;br /&gt;
&lt;br /&gt;
Sandbox pages (for testing things)&lt;br /&gt;
* [[User:Ganaram inukshuk/Sandbox]]&lt;br /&gt;
** [[User:Ganaram inukshuk/Sandbox/JI ratios]]&lt;br /&gt;
**[[User:Ganaram inukshuk/Sandbox/Navboxes]]&lt;br /&gt;
**[[User:Ganaram inukshuk/Sandbox/Modmosses]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template sandbox]]&lt;br /&gt;
&lt;br /&gt;
Test pages (for proposed rewrites or new templates):&lt;br /&gt;
* [[User:Ganaram inukshuk/Catalog of MOS Scales]]&lt;br /&gt;
* [[User:Ganaram inukshuk/4L 3s]] (Template test page and test page for style guide)&lt;br /&gt;
* [[User:Ganaram inukshuk/5L 2s]] (Template test page and test page for style guide)&lt;br /&gt;
** [[User:Ganaram inukshuk/MODMOS scales of 5L 2s]]&lt;br /&gt;
* [[User:Ganaram inukshuk/7L 3s]] (Rewrite page)&lt;br /&gt;
* [[User:Ganaram inukshuk/TAMNAMS]] (Rewrite page)&lt;br /&gt;
** [[User:Ganaram inukshuk/TAMNAMS/Appendix]]&lt;br /&gt;
* [[User:Ganaram inukshuk/MOS scale]] (rewrite page)&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Rewrite draft]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Template rating]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Todo]]&lt;br /&gt;
&lt;br /&gt;
Experimental pages (for content considered idiosyncratic, ad-hoc, or otherwise weird):&lt;br /&gt;
* [[User:Ganaram inukshuk/LCP 5L 3s]]&lt;br /&gt;
&lt;br /&gt;
Test templates:&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Mbox]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:TAMNAMS name]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Tcode]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Tester]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Transcript]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Joke page|User:Ganaram inukshuk/Joke page]]&lt;br /&gt;
* [[User:Ganaram inukshuk/JI ratios]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Navbox fractional-octave]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Navbox Lumatone]]&lt;br /&gt;
&lt;br /&gt;
Other:&lt;br /&gt;
* [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
&lt;br /&gt;
[[Category:User on Discord]]&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Alert&amp;diff=223021</id>
		<title>Template:Alert</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Alert&amp;diff=223021"/>
		<updated>2026-02-01T08:15:40Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: a div&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;&amp;lt;templatestyles src=&amp;quot;alert/styles.css&amp;quot; /&amp;gt;{{mbox&lt;br /&gt;
| class=alert&lt;br /&gt;
| type={{{type|note}}}&lt;br /&gt;
| text={{{text|}}}&lt;br /&gt;
| icon={{{icon|}}}&lt;br /&gt;
| icon size={{{icon size|20px}}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Alert templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=223005</id>
		<title>Module:Dochead</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=223005"/>
		<updated>2026-01-31T23:01:59Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: autocategorize metatemplates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local getArgs = require(&amp;quot;Module:Arguments&amp;quot;).getArgs&lt;br /&gt;
local iutils  = require(&amp;quot;Module:Introspection utils&amp;quot;)&lt;br /&gt;
local yesno   = require(&amp;quot;Module:Yesno&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: (Low-ish priority): rewrite to eliminate redundant code&lt;br /&gt;
&lt;br /&gt;
-- Produces a hatnote that is placed on the top of a documentation page (either&lt;br /&gt;
-- template or module documentation) and can autodetect and categorize:&lt;br /&gt;
-- - FOR MODULES:&lt;br /&gt;
--   - whether a module has an accompanying template (overridable/toggleable)&lt;br /&gt;
--   - whether a module is meant as a library for other modules&lt;br /&gt;
-- - FOR TEMPLATES:&lt;br /&gt;
--   - whether a template has an accompanying module (overridable/toggleable)&lt;br /&gt;
--   - what functions from which modules are invoked&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize modules&lt;br /&gt;
local function categorize_module(pagename)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Module documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Lua modules]]&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle modules&lt;br /&gt;
function p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding template exists&lt;br /&gt;
	-- Then check whether that template invokes the module&lt;br /&gt;
	local has_template = iutils.page_exists(&amp;quot;Template:&amp;quot; .. corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse, metatemplate, or noinvoke, this option&lt;br /&gt;
	-- is ignored. For any other option, it&#039;s not.&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; and header ~= &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		has_template = has_template and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- If the module has a template, check for whether it invokes it.&lt;br /&gt;
	if has_template then&lt;br /&gt;
		local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
		has_template = has_template and iutils.invocation_exists(invokes, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on module&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke indicates a lua-based template, but the module&#039;s code is so&lt;br /&gt;
	--   specialized that its code should not be used by other modules or&lt;br /&gt;
	--   invoked by other templates.&lt;br /&gt;
	-- - metamodule and library indicate a module whose code is used mainly for&lt;br /&gt;
	--   other modules. Such modules generally don&#039;t have a corresponding&lt;br /&gt;
	--   template.&lt;br /&gt;
	-- - data/datamodule indicates a module whose purpose is to provide data&lt;br /&gt;
	--   values to other modules. Like library modules, these don&#039;t have a&lt;br /&gt;
	--   corresponding template.&lt;br /&gt;
	-- Does the module have a template?&lt;br /&gt;
	-- - dualuse, metatemplate, and noinvoke: YES (REQUIRED!!)&lt;br /&gt;
	-- - metamodule/library and data: GENERALLY NO&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module has a corresponding template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a metatemplate, and may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This module is used to create other Lua-based templates and has no corresponding template.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module should not be invoked directly; use its corresponding template instead: [[Template:%s]].&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This module primarily serves as a library for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	elseif header == &amp;quot;data&amp;quot; or pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;):match(&amp;quot;/data$&amp;quot;) then&lt;br /&gt;
		result = &amp;quot;This module primarily serves to provide data values for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	elseif header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		result = &amp;quot;&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	else&lt;br /&gt;
		if has_template and header ~= &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;%s This module implements [[Template:%s]].&amp;quot;, header, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		elseif has_template and header == &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;This module implements [[Template:%s]].&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Produce categories&lt;br /&gt;
	local cats = categorize_module(pagename)&lt;br /&gt;
	&lt;br /&gt;
	-- Return&lt;br /&gt;
	if result == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot; .. cats&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;: &#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize template&lt;br /&gt;
local function categorize_template(pagename, has_invoke, is_metatemplate)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Template documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Templates]]&amp;quot;&lt;br /&gt;
		if has_invoke then&lt;br /&gt;
			cats = cats .. &amp;quot; [[Category:Lua-based templates]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		if is_metatemplate then&lt;br /&gt;
			cats = cats .. &amp;quot; [[Category:Metatemplates]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function&lt;br /&gt;
-- Creates an additional hatnote denoting which functions are invoked from which&lt;br /&gt;
-- modules, if a has more than one invoke.&lt;br /&gt;
local function make_invocation_hatnote(invokes)&lt;br /&gt;
	local hatnote = &amp;quot;&amp;quot;&lt;br /&gt;
	if #invokes == 0 then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		hatnote = &amp;quot;This template invokes the following functions:&amp;quot;&lt;br /&gt;
		local calls = {}&lt;br /&gt;
		for _, call in ipairs(invokes) do&lt;br /&gt;
			local module_link = iutils.make_module_link(call.module)&lt;br /&gt;
			table.insert(calls, string.format(&amp;quot;&#039;&#039;&#039;%s&#039;&#039;&#039; from %s&amp;quot;, call.func, module_link))&lt;br /&gt;
		end&lt;br /&gt;
		return string.format(&amp;quot;%s %s.&amp;quot;, hatnote, table.concat(calls, &amp;quot;, &amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle templates&lt;br /&gt;
function p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding module exists&lt;br /&gt;
	-- Then check whether this template invokes the module&lt;br /&gt;
	local has_module = iutils.page_exists(&amp;quot;Module:&amp;quot; .. corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse or metatemplate, this option is ignored.&lt;br /&gt;
	-- For any other option, it&#039;s not (although it also has no effect on&lt;br /&gt;
	-- noinvoke or library/metamodule).&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		has_module = has_module and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Check for whether the template invokes that module, regardless of whether&lt;br /&gt;
	-- it uses the corresponding module.&lt;br /&gt;
	local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
	local is_module_invoked = iutils.invocation_exists(invokes, corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on templates&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke and metamodule/library don&#039;t have use for templates.&lt;br /&gt;
	-- Does the template have a module?&lt;br /&gt;
	-- - dualuse and metatemplate: YES (REQUIRED!!)&lt;br /&gt;
	-- - noinvoke, metamodule/library, and data/datamodule: option&#039;s don&#039;t apply&lt;br /&gt;
	--   to templates.&lt;br /&gt;
	-- RATIONALE FOR NOINVOKE NOT APPLYING: a template may invoke functions from&lt;br /&gt;
	-- more than one module, but one of them must be the &amp;quot;main&amp;quot; module. Since&lt;br /&gt;
	-- there&#039;s no way to autodetect that, that info must be manually entered.&lt;br /&gt;
	-- If that doesn&#039;t happen&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]]. See its module page for Lua-based template implementation.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by a module that is currently missing. [[Special:EditPage/Module:%s]]&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This metatemplate has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; or header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; or header == &amp;quot;data&amp;quot; or header == &amp;quot;datamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This template has a header option in the wrong namespace. It should be used within the Module namespace.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		if has_module and header ~= &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header ~= &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find all invocations for the template and add it as an addl hatnote.&lt;br /&gt;
	local invocation_hatnote = make_invocation_hatnote(invokes)&lt;br /&gt;
	&lt;br /&gt;
	-- Categorize&lt;br /&gt;
	local cats = categorize_template(pagename, #invokes &amp;gt; 0, header == &amp;quot;metatemplate&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	if header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		return cats&lt;br /&gt;
	elseif result == &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	elseif result == &amp;quot;&amp;quot; and invocation_hatnote ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;: &#039;&#039;%s&#039;&#039;%s\n&amp;quot;, invocation_hatnote, cats)&lt;br /&gt;
	elseif result ~= &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;: &#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;: &#039;&#039;%s&#039;&#039;\n: &#039;&#039;%s&#039;&#039; %s\n&amp;quot;, result, invocation_hatnote, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Main function&lt;br /&gt;
function p._dochead(args)&lt;br /&gt;
	local namespace = args[&amp;quot;namespace&amp;quot;]&lt;br /&gt;
	local pagename  = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	local header    = args[&amp;quot;header&amp;quot;] or &amp;quot;none&amp;quot;&lt;br /&gt;
	local corr_template = args[&amp;quot;temp&amp;quot;] or pagename&lt;br /&gt;
	local corr_module   = args[&amp;quot;mod&amp;quot;]  or pagename&lt;br /&gt;
	local detect_corr_page = args[&amp;quot;detect_corr_page&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
	-- If header is none, skip everything&lt;br /&gt;
	if header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		--return categorize(namespace, pagename)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Call appropriate hatnote-making function&lt;br /&gt;
	-- Remove /doc suffix if this is on a /doc page to ensure links are made&lt;br /&gt;
	-- properly. :gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if namespace == &amp;quot;Module&amp;quot; then&lt;br /&gt;
		result = p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	elseif namespace == &amp;quot;Template&amp;quot; then&lt;br /&gt;
		result = p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	else&lt;br /&gt;
		result = &amp;quot;: &#039;&#039;This documentation template is in the wrong namespace. It should be within the Template or Module namespaces.&#039;&#039;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper to be invoked&lt;br /&gt;
function p.dochead(frame)&lt;br /&gt;
	local args = getArgs(frame, { removeBlanks = true }) or {}&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Extract or parse args&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = args[&amp;quot;namespace&amp;quot;] or title.nsText&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = args[&amp;quot;pagename&amp;quot; ] or title.text&lt;br /&gt;
&lt;br /&gt;
	-- Extract header or set it to defaults&lt;br /&gt;
	if args[&amp;quot;header&amp;quot;] == nil or args[&amp;quot;header&amp;quot;] == &amp;quot;&amp;quot; then&lt;br /&gt;
		if args[&amp;quot;namespace&amp;quot;] == &amp;quot;Module&amp;quot; then&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;noinvoke&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Extract template/module names, or autogenerate them&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;temp&amp;quot;] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;mod&amp;quot; ] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	-- Option to detect corresponding page (default true)&lt;br /&gt;
	args[&amp;quot;detect_corr_page&amp;quot;] = args[&amp;quot;detect_corr_page&amp;quot;] == nil and true or yesno(args[&amp;quot;detect_corr_page&amp;quot;])&lt;br /&gt;
	&lt;br /&gt;
	local result = p._dochead(args)&lt;br /&gt;
	&lt;br /&gt;
    -- Debugger option to show generated WikiText&lt;br /&gt;
    local wtext = yesno(frame.args[&amp;quot;wtext&amp;quot;] or args[&amp;quot;wtext&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
	if wtext == true then&lt;br /&gt;
		result = &amp;quot;&amp;lt;syntaxhighlight lang=\&amp;quot;wikitext\&amp;quot;&amp;gt;&amp;quot; .. result .. &amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return frame:preprocess(result)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tester()&lt;br /&gt;
	local args = {}&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = &amp;quot;Template&amp;quot;&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = &amp;quot;Module introspection&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217660</id>
		<title>Module:Utils/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217660"/>
		<updated>2025-11-25T04:28:35Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation|{{dochead|header=library}}&lt;br /&gt;
This module provides several mathematical functions which are likely to be used frequently on the Xenharmonic Wiki.&lt;br /&gt;
&lt;br /&gt;
Namely, the functions in this module can be called from other modules by using &amp;lt;code&amp;gt;require(&amp;quot;Module:Utils&amp;quot;)&amp;lt;/code&amp;gt; and calling the desired functions.&lt;br /&gt;
&lt;br /&gt;
For pairs of functions with names that differ by a single leading underscore (for example, &amp;lt;code&amp;gt;gcd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;_gcd&amp;lt;/code&amp;gt;), the function &#039;&#039;with&#039;&#039; an underscore is meant to be called by other modules, and the function &#039;&#039;without&#039;&#039; an underscore can be used with &amp;lt;code&amp;gt;#invoke&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Module introspection&lt;br /&gt;
| desc_trim = Removes leading and trailing whitespaces (but not interior ones) from a string.&lt;br /&gt;
| desc__yesno = Wrapper function for [[Module:Yesno]], for use with templates. (Module:Yesno does not have a corresponding template.)&lt;br /&gt;
| desc__clamp = Returns &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; such that it is between &amp;lt;code&amp;gt;min_val&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;max_val&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_table_contains = Checks whether table &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; contains &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; and returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (if found) or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if not found. Passing &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional. By default, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a numeric value or a string; to check for other values, such as ratios defined by [[Module:Rational]], a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; must be passed in.&lt;br /&gt;
| desc_index_of = Returns the first index with the given &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; (or nil if not found). Passing &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional. By default, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a numeric value or a string; to check for other values, such as ratios defined by [[Module:Rational]], a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; must be passed in.&lt;br /&gt;
| desc_value_provided = Checks whether &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; is a non-empty string.&lt;br /&gt;
| desc_eval_num_arg = Evaluates &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; as a number, fraction notation supported but not other expressions; uses &amp;lt;code&amp;gt;def_value&amp;lt;/code&amp;gt; on error.&lt;br /&gt;
| desc_log = Returns the logarithm base &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. Parameter &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; defaults to base 2 (octave) if it is omitted.&lt;br /&gt;
| desc_gcd = Returns the greatest common divisor of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_round_dec = Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; decimal places. Parameter &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; defaults to 0 if it is omitted.&lt;br /&gt;
| desc_round = Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; significant figures. Parameter &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; defaults to 6 if it is omitted.&lt;br /&gt;
| desc_is_prime = Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is a prime number.&lt;br /&gt;
| desc_prime_factorization = Returns the prime factorization of the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; using the exponential form (in wikitext).&lt;br /&gt;
| desc_prime_factorization_raw = Returns a table encoding the prime factorization of &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_signum = Returns 1 for positive numbers, −1 for negative ones, and 0 for zero and non-integer inputs.&lt;br /&gt;
| desc_next_young_diagram = Returns the next Young diagram of the same size; the first one is &amp;lt;code&amp;gt;[N]&amp;lt;/code&amp;gt;, the last one is &amp;lt;code&amp;gt;[1, 1, …, 1]&amp;lt;/code&amp;gt;. After the last one, &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; is returned. The input table is modified.&lt;br /&gt;
| desc_log2 = Returns the base-2 logarithm of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__log = Lua-only implementation of &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__gcd = Lua-only implementation of &amp;lt;code&amp;gt;gcd&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__round_dec = Lua-only implementation of &amp;lt;code&amp;gt;round_dec&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__round = Lua-only implementation of &amp;lt;code&amp;gt;round&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__prime_factorization = Lua-only implementation of &amp;lt;code&amp;gt;prime_factorization&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217659</id>
		<title>Module:Utils/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217659"/>
		<updated>2025-11-25T04:27:59Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation|{{dochead|header=library}}&lt;br /&gt;
This module provides several mathematical functions which are likely to be used frequently on the Xenharmonic Wiki.&lt;br /&gt;
&lt;br /&gt;
Namely, the functions in this module can be called from other modules by using &amp;lt;code&amp;gt;require(&amp;quot;Module:Utils&amp;quot;)&amp;lt;/code&amp;gt; and calling the desired functions.&lt;br /&gt;
&lt;br /&gt;
For pairs of functions with names that differ by a single leading underscore (for example, &amp;lt;code&amp;gt;gcd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;_gcd&amp;lt;/code&amp;gt;), the function &#039;&#039;with&#039;&#039; an underscore is meant to be called by other modules, and the function &#039;&#039;without&#039;&#039; an underscore can be used with &amp;lt;code&amp;gt;#invoke&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Module introspection&lt;br /&gt;
| desc_trim = Removes leading and trailing whitespaces (but not interior ones) from a string.&lt;br /&gt;
| desc__yesno = Wrapper function for [[Module:Yesno]], for use with templates. (Module:Yesno does not have a corresponding template.)&lt;br /&gt;
| desc__clamp = Returns &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; such that it is between &amp;lt;code&amp;gt;min_val&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;max_val&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_table_contains = Checks whether table &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; contains &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; and returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (if found) or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if not found. Passing &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional. By default, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a numeric value or a string; to check for other values, such as ratios defined by [[Module:Rational]], a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; must be passed in.&lt;br /&gt;
| desc_index_of = Returns the first index with the given &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; (or nil if not found). Passing &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional. By default, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a numeric value or a string; to check for other values, such as ratios defined by [[Module:Rational]], a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; must be passed in.&lt;br /&gt;
| desc_value_provided = Checks whether &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; is a non-empty string.&lt;br /&gt;
| desc_eval_num_arg = Evaluates &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; as a number, fraction notation supported but not other expressions; uses &amp;lt;code&amp;gt;def_value&amp;lt;/code&amp;gt; on error.&lt;br /&gt;
| desc_log = Returns the logarithm base &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. Parameter &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; defaults to base 2 (octave) if it is omitted.&lt;br /&gt;
| desc_gcd = Returns the greatest common divisor of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_round_dec = Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; decimal places. Parameter &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; defaults to 0 if it is omitted.&lt;br /&gt;
| desc_round = Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; significant figures. Parameter &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; defaults to 6 if it is omitted.&lt;br /&gt;
| desc_is_prime = Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is a prime number.&lt;br /&gt;
| desc_prime_factorization = Returns the prime factorization of the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; using the exponential form (in wikitext).&lt;br /&gt;
| desc_prime_factorization_raw = Returns a table encoding the prime factorization of &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_signum = Returns 1 for positive numbers, −1 for negative ones, and 0 for zero and non-integer inputs.&lt;br /&gt;
| desc_next_young_diagram = Returns the next Young diagram of the same size; the first one is &amp;lt;code&amp;gt;[N]&amp;lt;/code&amp;gt;, the last one is &amp;lt;code&amp;gt;[1, 1, …, 1]&amp;lt;/code&amp;gt;. After the last one, &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; is returned. The input table is modified.&lt;br /&gt;
| desc_log2 = Returns the base-2 logarithm of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__log = Lua-only implementation of &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__gcd = Lua-only implementation of &amp;lt;code&amp;gt;gcd&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__round_dec = Lua-only implementation of &amp;lt;code&amp;gt;round_dec&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__round = Lua-only implementation of &amp;lt;code&amp;gt;round&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__prime_factorization = Lua-only implementation of &amp;lt;code&amp;gt;prime_factorization&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217658</id>
		<title>Module:Utils/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217658"/>
		<updated>2025-11-25T04:26:10Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: add descriptions for other functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation|{{dochead|header=library}}&lt;br /&gt;
This module provides several mathematical functions which are likely to be used frequently on the Xenharmonic Wiki.&lt;br /&gt;
&lt;br /&gt;
Namely, the functions in this module can be called from other modules by using &amp;lt;code&amp;gt;require(&amp;quot;Module:Utils&amp;quot;)&amp;lt;/code&amp;gt; and calling the desired functions.&lt;br /&gt;
&lt;br /&gt;
For pairs of functions with names that differ by a single leading underscore (for example, &amp;lt;code&amp;gt;gcd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;_gcd&amp;lt;/code&amp;gt;), the function &#039;&#039;with&#039;&#039; an underscore is meant to be called by other modules, and the function &#039;&#039;without&#039;&#039; an underscore can be used with &amp;lt;code&amp;gt;#invoke&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Module introspection&lt;br /&gt;
| desc_trim = Removes leading and trailing whitespaces (but not interior ones) from a string.&lt;br /&gt;
| desc__yesno = Wrapper function for [[Module:Yesno]], for use with templates. (Module:Yesno does not have a corresponding template.)&lt;br /&gt;
| desc__clamp = Returns &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; such that it is between &amp;lt;code&amp;gt;min_val&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;max_val&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_table_contains = Checks whether table &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; contains &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; and returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (if found) or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if not found. Passing &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional. By default, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a numeric value or a string; to check for other values, such as ratios defined by [[Module:Rational]], a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; must be passed in.&lt;br /&gt;
| desc_index_of = Returns the first index with the given &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; (or nil if not found). Passing &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional. By default, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a numeric value or a string; to check for other values, such as ratios defined by [[Module:Rational]], a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; must be passed in.&lt;br /&gt;
| desc_value_provided = Checks whether &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; is a non-empty string.&lt;br /&gt;
| desc_eval_num_arg = Evaluates &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; as a number, fraction notation supported but not other expressions; uses &amp;lt;code&amp;gt;def_value&amp;lt;/code&amp;gt; on error.&lt;br /&gt;
| desc_log = Returns the logarithm base &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. Parameter &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; defaults to base 2 (octave) if it is omitted.&lt;br /&gt;
| desc_gcd = Returns the greatest common divisor of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_round_dec = Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; decimal places. Parameter &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; defaults to 0 if it is omitted.&lt;br /&gt;
| desc_round = Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; significant figures. Parameter &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; defaults to 6 if it is omitted.&lt;br /&gt;
| desc_is_prime = Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is a prime number.&lt;br /&gt;
| desc_prime_factorization = Returns the prime factorization of the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; using the exponential form (in wikitext).&lt;br /&gt;
| desc_prime_factorization_raw = Returns a table encoding the prime factorization of &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_signum = Returns 1 for positive numbers, −1 for negative ones, and 0 for zero and non-integer inputs.&lt;br /&gt;
| desc_next_young_diagram = Returns the next Young diagram of the same size; the first one is &amp;lt;code&amp;gt;[N]&amp;lt;/code&amp;gt;, the last one is &amp;lt;code&amp;gt;[1, 1, …, 1]&amp;lt;/code&amp;gt;. After the last one, &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; is returned. The input table is modified.}}&lt;br /&gt;
| desc_log2 = Returns the base-2 logarithm of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__log = Lua-only implementation of &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__gcd = Lua-only implementation of &amp;lt;code&amp;gt;gcd&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__round_dec = Lua-only implementation of &amp;lt;code&amp;gt;round_dec&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__round = Lua-only implementation of &amp;lt;code&amp;gt;round&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc__prime_factorization = Lua-only implementation of &amp;lt;code&amp;gt;prime_factorization&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217657</id>
		<title>Module:Utils/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217657"/>
		<updated>2025-11-25T04:19:48Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: clarify; transfer all function descriptions to module introspection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation|{{dochead|header=library}}&lt;br /&gt;
This module provides several mathematical functions which are likely to be used frequently on the Xenharmonic Wiki.&lt;br /&gt;
&lt;br /&gt;
Namely, the functions in this module can be called from other modules by using &amp;lt;code&amp;gt;require(&amp;quot;Module:Utils&amp;quot;)&amp;lt;/code&amp;gt; and calling the desired functions.&lt;br /&gt;
&lt;br /&gt;
For pairs of functions with names that differ by a single leading underscore (for example, &amp;lt;code&amp;gt;gcd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;_gcd&amp;lt;/code&amp;gt;), the function &#039;&#039;with&#039;&#039; an underscore is meant to be called by other modules, and the function &#039;&#039;without&#039;&#039; an underscore can be used with &amp;lt;code&amp;gt;#invoke&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Module introspection&lt;br /&gt;
| desc_trim = Removes leading and trailing whitespaces (but not interior ones) from a string.&lt;br /&gt;
| desc__yesno = Wrapper function for [[Module:Yesno]], for use with templates. (Module:Yesno does not have a corresponding template.)&lt;br /&gt;
| desc_table_contains = Checks whether table &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; contains &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; and returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (if found) or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if not found. Passing &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional. By default, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a numeric value or a string; to check for other values, such as ratios defined by [[Module:Rational]], a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; must be passed in.&lt;br /&gt;
| desc_index_of = Returns the first index with the given &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; (or nil if not found). Passing &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional. By default, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a numeric value or a string; to check for other values, such as ratios defined by [[Module:Rational]], a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; must be passed in.&lt;br /&gt;
| desc_value_provided = Checks whether &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; is a non-empty string.&lt;br /&gt;
| desc_eval_num_arg = Evaluates &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; as a number, fraction notation supported but not other expressions; uses &amp;lt;code&amp;gt;def_value&amp;lt;/code&amp;gt; on error.&lt;br /&gt;
| desc_log = Returns the logarithm base &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. Parameter &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; defaults to base 2 (octave) if it is omitted.&lt;br /&gt;
| desc_gcd = Returns the greatest common divisor of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;. &lt;br /&gt;
| desc_round_dec = Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; decimal places. Parameter &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; defaults to 0 if it is omitted.&lt;br /&gt;
| desc_round = Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; significant figures. Parameter &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; defaults to 6 if it is omitted.&lt;br /&gt;
| desc_is_prime = Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is a prime number.&lt;br /&gt;
| desc_prime_factorization = Returns the prime factorization of the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; using the exponential form (in wikitext).&lt;br /&gt;
| desc_prime_factorization_raw = Returns a table encoding the prime factorization of &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
| desc_signum = Returns 1 for positive numbers, −1 for negative ones, and 0 for zero and non-integer inputs.&lt;br /&gt;
| desc_next_young_diagram = Returns the next Young diagram of the same size; the first one is &amp;lt;code&amp;gt;[N]&amp;lt;/code&amp;gt;, the last one is &amp;lt;code&amp;gt;[1, 1, …, 1]&amp;lt;/code&amp;gt;. After the last one, &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; is returned. The input table is modified.}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217656</id>
		<title>Module:Utils/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217656"/>
		<updated>2025-11-25T04:10:15Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation|{{dochead|header=library}}&lt;br /&gt;
This module provides several mathematical functions which are likely to be used frequently on the Xenharmonic Wiki.&lt;br /&gt;
&lt;br /&gt;
Namely, the functions in this module can be called from other modules by using &amp;lt;code&amp;gt;require(&amp;quot;Module:Utils&amp;quot;)&amp;lt;/code&amp;gt; and calling the desired functions.&lt;br /&gt;
&lt;br /&gt;
For pairs of functions with names that differ by a single leading underscore (for example, &amp;lt;code&amp;gt;gcd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;_gcd&amp;lt;/code&amp;gt;), the function &#039;&#039;with&#039;&#039; an underscore is meant to be called by other modules, and the function &#039;&#039;without&#039;&#039; an underscore can be used with &amp;lt;code&amp;gt;#invoke&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Module introspection&lt;br /&gt;
| desc_trim = Removes leading and trailing whitespaces (but not interior ones) from a string.&lt;br /&gt;
| desc__yesno = Wrapper function for [[Module:Yesno]], for use with templates. }}&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;_clamp(val, min_val, max_val)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; such that it&#039;s between &amp;lt;code&amp;gt;min_val&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;max_val&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;table_contains(tbl, value, compare_func)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Checks whether table &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; contains &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. Passing in &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a table and &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; a table of tables, pass in a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt;, which returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; and an element in &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; have the same value.{{clarify}}&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;index_of(array, value, compare_func)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Returns the first index with the given &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; (or nil if not found). Passing in &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a table and &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; a table of tables, pass in a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt;, which returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; and an element in &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; have the same value.{{clarify}}&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;value_provided(s)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Checks if &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; is a non-empty string.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;eval_num_arg(input, def_value)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Evaluates &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; as a number, fraction notation supported but not other expressions; uses &amp;lt;code&amp;gt;def_value&amp;lt;/code&amp;gt; on error.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;log(x, b)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns the logarithm base &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. Parameter &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; defaults to base 2 (octave) if it is omitted.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;gcd(a, b)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns the greatest common divisor of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;round_dec(x, places)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; decimal places. Parameter &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; defaults to 0 if it is omitted.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;round(x, prec)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; significant figures. Parameter &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; defaults to 6 if it is omitted.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;is_prime(n)&amp;lt;/code&amp;gt;*&lt;br /&gt;
: Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is a prime number.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;prime_factorization(n)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns the prime factorization of the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; using the exponential form (in wikitext).&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;prime_factorization_raw(n)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Returns a table encoding the prime factorization of &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;signum(x)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Returns 1 for positive numbers, −1 for negative ones, and 0 for zero and non-integer inputs.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;next_young_diagram(d)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns the next Young diagram of the same size; the first one is &amp;lt;code&amp;gt;[N]&amp;lt;/code&amp;gt;, the last one is &amp;lt;code&amp;gt;[1, 1, …, 1]&amp;lt;/code&amp;gt;. After the last one, &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; is returned. The input table is modified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; These functions are designed to be used by other modules only; they cannot be called with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke: }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217655</id>
		<title>Module:Utils/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Utils/doc&amp;diff=217655"/>
		<updated>2025-11-25T04:09:35Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: Partially transfer function descriptions to module introspection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation|{{dochead|header=library}}&lt;br /&gt;
This module provides several mathematical functions which are likely to be used frequently on the Xenharmonic Wiki.&lt;br /&gt;
&lt;br /&gt;
Namely, the functions in this module can be called from other modules by using &amp;lt;code&amp;gt;require(&amp;quot;Module:Utils&amp;quot;)&amp;lt;/code&amp;gt; and calling the desired functions.&lt;br /&gt;
&lt;br /&gt;
For pairs of functions with names that differ by a single leading underscore (for example, &amp;lt;code&amp;gt;gcd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;_gcd&amp;lt;/code&amp;gt;), the function &#039;&#039;with&#039;&#039; an underscore is meant to be called by other modules, and the function &#039;&#039;without&#039;&#039; an underscore can be used with &amp;lt;code&amp;gt;#invoke&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Module introspection&lt;br /&gt;
| desc_trim = Removes leading and trailing whitespaces (but not interior ones) from a string.&lt;br /&gt;
| desc_yesno = Wrapper function for [[Module:Yesno]], for use with templates. }}&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;_clamp(val, min_val, max_val)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; such that it&#039;s between &amp;lt;code&amp;gt;min_val&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;max_val&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;table_contains(tbl, value, compare_func)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Checks whether table &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; contains &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. Passing in &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a table and &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; a table of tables, pass in a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt;, which returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; and an element in &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; have the same value.{{clarify}}&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;index_of(array, value, compare_func)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Returns the first index with the given &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; (or nil if not found). Passing in &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt; is optional; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is a table and &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; a table of tables, pass in a comparison function &amp;lt;code&amp;gt;compare_func&amp;lt;/code&amp;gt;, which returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; and an element in &amp;lt;code&amp;gt;tbl&amp;lt;/code&amp;gt; have the same value.{{clarify}}&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;value_provided(s)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Checks if &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; is a non-empty string.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;eval_num_arg(input, def_value)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Evaluates &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; as a number, fraction notation supported but not other expressions; uses &amp;lt;code&amp;gt;def_value&amp;lt;/code&amp;gt; on error.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;log(x, b)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns the logarithm base &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;. Parameter &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; defaults to base 2 (octave) if it is omitted.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;gcd(a, b)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns the greatest common divisor of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;round_dec(x, places)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; decimal places. Parameter &amp;lt;code&amp;gt;places&amp;lt;/code&amp;gt; defaults to 0 if it is omitted.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;round(x, prec)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; rounded to a precision of &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; significant figures. Parameter &amp;lt;code&amp;gt;prec&amp;lt;/code&amp;gt; defaults to 6 if it is omitted.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;is_prime(n)&amp;lt;/code&amp;gt;*&lt;br /&gt;
: Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is a prime number.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;prime_factorization(n)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns the prime factorization of the given integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; using the exponential form (in wikitext).&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;prime_factorization_raw(n)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Returns a table encoding the prime factorization of &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;signum(x)&amp;lt;/code&amp;gt; *&lt;br /&gt;
: Returns 1 for positive numbers, −1 for negative ones, and 0 for zero and non-integer inputs.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;next_young_diagram(d)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns the next Young diagram of the same size; the first one is &amp;lt;code&amp;gt;[N]&amp;lt;/code&amp;gt;, the last one is &amp;lt;code&amp;gt;[1, 1, …, 1]&amp;lt;/code&amp;gt;. After the last one, &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; is returned. The input table is modified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; These functions are designed to be used by other modules only; they cannot be called with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke: }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk/Provisional_style_guide_for_Lua&amp;diff=216313</id>
		<title>User:Ganaram inukshuk/Provisional style guide for Lua</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk/Provisional_style_guide_for_Lua&amp;diff=216313"/>
		<updated>2025-11-06T21:14:11Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following style guide is a personal, provisional guide adapted from the LuaRocks style guide: https://github.com/luarocks/lua-style-guide&lt;br /&gt;
&lt;br /&gt;
Parts of it are adapted for use on the wiki, with details on specific conventions. If a specific convention is missing, fall back to that described in the Luarocks style guide.&lt;br /&gt;
&lt;br /&gt;
== Provisional additions for version 2 ==&lt;br /&gt;
Consistency with param names, including spelling:&lt;br /&gt;
&lt;br /&gt;
* Define all param names at the module level, not the template level&lt;br /&gt;
* Use snake_case for all param names throughout; anything remotely close to snake_case is normalized to snake_case&lt;br /&gt;
* &amp;quot;debug&amp;quot; and &amp;quot;nocat&amp;quot; are reserved for toggling categories; the use of &amp;quot;debug&amp;quot; this way has already been the standard&lt;br /&gt;
&lt;br /&gt;
== Preliminaries ==&lt;br /&gt;
&lt;br /&gt;
=== Indentation and formatting ===&lt;br /&gt;
The in-browser Lua editor uses tabs for indenting, which equates to 4 spaces.&lt;br /&gt;
&lt;br /&gt;
=== Naming and declaring variables ===&lt;br /&gt;
&lt;br /&gt;
Variable names should be short and descriptive, written in &amp;lt;code&amp;gt;snake_case&amp;lt;/code&amp;gt;. Exceptions to this include counter variables, like with &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; in for loops. Boolean variables are prefixed with &amp;lt;code&amp;gt;is_&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;has_&amp;lt;/code&amp;gt; wherever possible. Constants are named using &amp;lt;code&amp;gt;TRAIN_CASE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All variable declarations should start with &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Strings ===&lt;br /&gt;
&lt;br /&gt;
Strings are enclosed in double quotes &amp;lt;code&amp;gt;&amp;quot; &amp;quot;&amp;lt;/code&amp;gt;. If a string contains double quotes, do not escape them while enclosing the string in double quotes, as this reduces readability; instead, enclose the string in single quotes &amp;lt;code&amp;gt;&#039; &#039;&amp;lt;/code&amp;gt;. Escape characters for quotes should only be used if the string contains both single and double quotes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Preferred&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local sentence = &amp;quot;That&#039;s his cheese quesadilla!&amp;quot;&lt;br /&gt;
local quotation = &amp;quot;And he said to me, \&amp;quot;One man&#039;s trash is another man&#039;s treasure.\&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avoid&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local formatting = &amp;quot;padding: 0.25em 0.5em; border: 1px solid white;\&amp;quot; colspan=&amp;quot;2\&amp;quot; | &amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Line lengths ===&lt;br /&gt;
&lt;br /&gt;
The 80-column limit should be observed wherever possible for both comments and code, except for cases where strings, inline comments, or function calls are too long.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
	local function navbox_title()&lt;br /&gt;
		if not title then return &amp;quot;&amp;quot; end&lt;br /&gt;
		local has_navbar = name ~= nil&lt;br /&gt;
&lt;br /&gt;
		return &amp;quot;|-\n&amp;quot; ..&lt;br /&gt;
			&#039;! style=&amp;quot;text-align: center; background-color: #eaecf0; white-space: nowrap; margin: 0em 4em 0em 4em;&#039; ..&lt;br /&gt;
			&#039;padding: 0.25em 0.5em; border: 1px solid white;&amp;quot; colspan=&amp;quot;2&amp;quot; | &#039; ..&lt;br /&gt;
			&#039;&amp;lt;span style=&amp;quot;display: inline-block; float: left; text-align: left; font-weight: normal; font-style: normal; min-width: 4em; padding: 0px; margin: 0px;&amp;quot;&amp;gt;&#039; ..&lt;br /&gt;
			(has_navbar and navbar(name, &amp;quot;mini&amp;quot;, &amp;quot;&amp;quot;) or &amp;quot;&amp;quot;) .. &#039;&amp;lt;/span&amp;gt;&#039; ..&lt;br /&gt;
			&#039;&amp;lt;span style=&amp;quot;font-size: 1.05em;&amp;quot;&amp;gt;&#039; .. title .. &#039;&amp;lt;/span&amp;gt;&#039; ..&lt;br /&gt;
			(is_collapsible and &#039;&#039; or &#039;&amp;lt;span style=&amp;quot;display: inline-block; float: right; font-size: 0.8em; width: 5em;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&#039;)&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Naming, declaring, and calling functions ===&lt;br /&gt;
&lt;br /&gt;
As with variables, functions are named using &amp;lt;code&amp;gt;snake_case&amp;lt;/code&amp;gt;. Functions that return a boolean variable are prefixed with &amp;lt;code&amp;gt;is_&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;has_&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;tbd&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Comments in code ===&lt;br /&gt;
&lt;br /&gt;
Well-commented code should speak for itself. Self-documenting code can only go so far, so comments should be used to briefly describe what the function does. If a module has several types of functions, comments can also be used as section separators.&lt;br /&gt;
&lt;br /&gt;
TODOs are allowed in comments. Separating TODOs into the module&#039;s documentation page makes code harder to maintain.&lt;br /&gt;
&lt;br /&gt;
=== Commented-out code ===&lt;br /&gt;
&lt;br /&gt;
Only block comments &amp;lt;code&amp;gt; --[[   ]]-- &amp;lt;/code&amp;gt; should only be used for commented-out code. This can be hard to do if a string contains a &amp;lt;code&amp;gt;]]&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; may be used instead.&lt;br /&gt;
&lt;br /&gt;
== Conventions for Lua modules ==&lt;br /&gt;
&lt;br /&gt;
=== Boilerplate code ===&lt;br /&gt;
Alphabetize dependencies, except for p, which goes last and separated by a line. Equals signs may be lined up.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Preferred order&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;local mos     = require(&amp;quot;Module:MOS&amp;quot;)&lt;br /&gt;
local rat     = require(&amp;quot;Module:Rational&amp;quot;)&lt;br /&gt;
local utils   = require(&amp;quot;Module:Utils&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Avoid&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
local p = {}&lt;br /&gt;
local mos     = require(&amp;quot;Module:MOS&amp;quot;)&lt;br /&gt;
local rat     = require(&amp;quot;Module:Rational&amp;quot;)&lt;br /&gt;
local utils   = require(&amp;quot;Module:Utils&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
local p = {}&lt;br /&gt;
local rat = require(&amp;quot;Module:Rational&amp;quot;)&lt;br /&gt;
local mos = require(&amp;quot;Module:MOS&amp;quot;)&lt;br /&gt;
local utils = require(&amp;quot;Module:Utils&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Placement of comments and TODO comments ===&lt;br /&gt;
Comments may be placed before modules as a preface, inline with modules to describe what each module does, and after the boilerplate code as a descripion. TODO comments should be placed before the code&#039;s description for ease of access.&lt;br /&gt;
&lt;br /&gt;
TODO comments should not be confused with the todo categories, nor should such code-based TODOs ever be placed in [[Template:Todo]]; placing such tasks in the template makes it harder to maintain code and mixes up code-based tasks with wiki-based tasks.&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;-- Preface goes here&lt;br /&gt;
local mos     = require(&amp;quot;Module:MOS&amp;quot;)       -- For mos scale functions&lt;br /&gt;
local rat     = require(&amp;quot;Module:Rational&amp;quot;)  -- For JI ratio calculations&lt;br /&gt;
local utils   = require(&amp;quot;Module:Utils&amp;quot;)     -- Contains the gcd function&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO goes here, if any&lt;br /&gt;
&lt;br /&gt;
-- Description goes here&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Use of functions ===&lt;br /&gt;
&lt;br /&gt;
===== Modules that implement templates =====&lt;br /&gt;
Modules that implement templates should consist of at least two functions: a &amp;quot;main&amp;quot; function prefixed with an underscore, and a wrapper function of the same name but without an underscore.&lt;br /&gt;
&lt;br /&gt;
The use of a wrapper and &amp;quot;main&amp;quot; function allows for a module to be used directly in another module or indirectly through its corresponding template. A module should only provide &#039;&#039;&#039;one&#039;&#039;&#039; wrapper for &#039;&#039;&#039;one&#039;&#039;&#039; template. If the &amp;quot;main&amp;quot; function is short enough, its code may be merged with the wrapper function.&lt;br /&gt;
&lt;br /&gt;
A tester function may be added for testing purposes, which is itself a wrapper that also calls the &amp;quot;main&amp;quot; function. This allows it to be tested using the in-browser console by calling mw.logObject(p.tester()). Tester functions may be removed if the &amp;quot;main&amp;quot; function is determined to be functional under expected conditions.&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;-- &amp;quot;Main&amp;quot; function to be called by wrapper or another module&lt;br /&gt;
function p._call_me(args)&lt;br /&gt;
    return &amp;quot;something&amp;quot; .. args[&amp;quot;something&amp;quot;]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper function; to be called by template using {{#invoke}}&lt;br /&gt;
function p.call_me(frame)&lt;br /&gt;
    return p._call_me(frame.args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Tester function; test wrapper that calls the &amp;quot;main&amp;quot; function&lt;br /&gt;
function p.tester()&lt;br /&gt;
    local args = { [&amp;quot;something&amp;quot;] = 123 }&lt;br /&gt;
    return p._call_me(args)&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;-- Wrapper function; to be called by template&lt;br /&gt;
function p.call_me(frame)&lt;br /&gt;
    local arg = frame.args[&amp;quot;arg&amp;quot;]&lt;br /&gt;
    &lt;br /&gt;
    -- Code goes here&lt;br /&gt;
    &lt;br /&gt;
    return call_me(arg)&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modules that serve as libraries ====&lt;br /&gt;
Modules that serve as libraries for other modules do not need a wrapper function, apart from the tester. Examples include [[Module:MOS]], [[Module:Rational]], and [[Module:Utils]].&lt;br /&gt;
&lt;br /&gt;
Modules that serve as libraries for multiple, related templates may provide multiple wrapper functions. If a module provides multiple wrappers that each call a corresponding function, the name of the function called within the wrapper must be prefixed with an underscore.&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;-- MAIN FUNCTIONS&lt;br /&gt;
-- Usable by other modules&lt;br /&gt;
&lt;br /&gt;
function p._call_me(arg1, arg2, arg3)&lt;br /&gt;
    -- Code goes here&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._truncate(arg1)&lt;br /&gt;
    -- Code goes here&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- WRAPPER FUNCTIONS&lt;br /&gt;
-- Usable by templates with {{#invoke}}&lt;br /&gt;
&lt;br /&gt;
function p._call_me(frame)&lt;br /&gt;
    return p._clamp(frame.args[&amp;quot;arg1&amp;quot;], frame.args[&amp;quot;arg2&amp;quot;], frame.args[&amp;quot;arg3&amp;quot;])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.truncate(frame)&lt;br /&gt;
    return p._truncate(frame.args[&amp;quot;arg1&amp;quot;])&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;Modules that only provide one function may simply consist of that function as a return value. Example: [[Module:Yesno]].&lt;br /&gt;
&lt;br /&gt;
==== Helper functions ====&lt;br /&gt;
For code readability and code reusability within the module, the use of helper functions is recommended.&lt;br /&gt;
&lt;br /&gt;
Ideally, helper functions should be nested within the calling function if those helpers only serve that function, but this rule may be disregarded for testing purposes, or for helper functions needed by more than one function. Nested functions have access to the variables and parameters of the outer function, so an equivalent nested function may require fewer parameters.&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function p._call_me(args)&lt;br /&gt;
    -- Get args here&lt;br /&gt;
    local arg1 = args[&amp;quot;Arg 1&amp;quot;]&lt;br /&gt;
    local arg2 = args[&amp;quot;Arg 2&amp;quot;]&lt;br /&gt;
    &lt;br /&gt;
    -- Helper function&lt;br /&gt;
    function helper_function(some_value)&lt;br /&gt;
        return &amp;quot;result&amp;quot; .. some_value&lt;br /&gt;
    end&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== What to pass into a &amp;quot;main&amp;quot; function ====&lt;br /&gt;
For an underscore-prefixed &amp;quot;main&amp;quot; function, if its expected inputs is determined to be fixed (for example, no new features are expected to ever be added), the function may accept them individually.&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;-- &amp;quot;Main&amp;quot; function to be called by wrapper or another module&lt;br /&gt;
-- Function signature consists of three args and the return value (not shown)&lt;br /&gt;
function p._call_me(arg1, arg2, arg3)&lt;br /&gt;
    -- Code goes here&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;If there is large amounts of input, or if the number of inputs is not known, the function should have a single parameter that is a table of passed-in arguments. This allows for expansion of the template&#039;s inputs without making the function signature any larger.&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- &amp;quot;Main&amp;quot; function to be called by wrapper or another module&lt;br /&gt;
-- Function signature consists of one table and the output (not shown)&lt;br /&gt;
function p._call_me(args)&lt;br /&gt;
    -- Get args here&lt;br /&gt;
    local arg1 = args[&amp;quot;args1&amp;quot;]&lt;br /&gt;
    local arg2 = args[&amp;quot;args2&amp;quot;]&lt;br /&gt;
    local arg3 = args[&amp;quot;args3&amp;quot;]&lt;br /&gt;
    &lt;br /&gt;
    -- Code goes here&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== What to get out of a function ====&lt;br /&gt;
Most functions should return something (a value, a string, a table, or more than one of those things), with the exception of functions that change the contents of a table. Modules that implement templates typically return a string that represents something that can be interpreted as wikitext. Guidance on how to create such strings is explained in later sections.&lt;br /&gt;
&lt;br /&gt;
=== Concatenating strings ===&lt;br /&gt;
&lt;br /&gt;
When concatenating long strings, it is best practice to insert constituent strings into a table, then concatenate afterwards. https://www.lua.org/pil/11.6.html&lt;br /&gt;
&lt;br /&gt;
This rule does not apply to concatenating a few small strings together.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Preferred&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local lines = {}&lt;br /&gt;
table.insert(lines, &#039;{| class=&amp;quot;wikitable&amp;quot;&#039;)&lt;br /&gt;
table.insert(lines, &#039;|+ Caption text&#039;)&lt;br /&gt;
table.insert(lines, &#039;|-&#039;)&lt;br /&gt;
table.insert(lines, &#039;! Header 1&#039;)&lt;br /&gt;
table.insert(lines, &#039;! Header 2&#039;)&lt;br /&gt;
table.insert(lines, &#039;! Header 3&#039;)&lt;br /&gt;
table.insert(lines, &#039;|-&#039;)&lt;br /&gt;
table.insert(lines, &#039;| aa&#039;)&lt;br /&gt;
table.insert(lines, &#039;| bb&#039;)&lt;br /&gt;
table.insert(lines, &#039;| cc&#039;)&lt;br /&gt;
table.insert(lines, &#039;|-&#039;)&lt;br /&gt;
table.insert(lines, &#039;| dd&#039;)&lt;br /&gt;
table.insert(lines, &#039;| ee&#039;)&lt;br /&gt;
table.insert(lines, &#039;| ff&#039;)&lt;br /&gt;
table.insert(lines, &#039;|}&#039;)&lt;br /&gt;
&lt;br /&gt;
return table.concat(lines, &#039;\n&#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Avoid&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local result = &#039;{| class=&amp;quot;wikitable&amp;quot;\n&#039;&lt;br /&gt;
    .. &#039;|+ Caption text\n&#039;&lt;br /&gt;
    .. &#039;|-\n&#039;&lt;br /&gt;
    .. &#039;! Header 1\n&#039;&lt;br /&gt;
    .. &#039;! Header 2\n&#039;&lt;br /&gt;
    .. &#039;! Header 3\n&#039;&lt;br /&gt;
    .. &#039;|-\n&#039;&lt;br /&gt;
    .. &#039;| aa\n&#039;&lt;br /&gt;
    .. &#039;| bb\n&#039;&lt;br /&gt;
    .. &#039;| cc\n&#039;&lt;br /&gt;
    .. &#039;|-\n&#039;&lt;br /&gt;
    .. &#039;| dd\n&#039;&lt;br /&gt;
    .. &#039;| ee\n&#039;&lt;br /&gt;
    .. &#039;| ff\n&#039;&lt;br /&gt;
    .. &#039;|}\n&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Allowed&#039;&#039;&#039; (although an alternative to this exists by using &amp;lt;code&amp;gt;string.format()&amp;lt;/code&amp;gt;)&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local table_line = &amp;quot;Number of steps: &amp;quot; .. tonumber(num_steps) .. &amp;quot; steps&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mediawiki table formatting ===&lt;br /&gt;
Wikitables should be written with one line per cell instead of one line per row. This is for ease-of-reading when debugging the output of a module-generated table. Add a space between pipes/exclamation points and table entries to avoid accidentally adding new rows, such as when inputting negative numbers. Mediawiki tables generated using Lua code must follow this convention.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Preferred&#039;&#039;&#039;&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Header 1&lt;br /&gt;
! Header 2&lt;br /&gt;
! Header 3&lt;br /&gt;
|-&lt;br /&gt;
| aa&lt;br /&gt;
| bb&lt;br /&gt;
| cc&lt;br /&gt;
|-&lt;br /&gt;
| dd&lt;br /&gt;
| ee&lt;br /&gt;
| ff&lt;br /&gt;
|}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avoid&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Header 1 !! Header 2 !! Header 3&lt;br /&gt;
|-&lt;br /&gt;
| aa || bb || cc&lt;br /&gt;
|-&lt;br /&gt;
| dd || ee || ff&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;ipairs&amp;lt;/code&amp;gt; versus &amp;lt;code&amp;gt;pairs&amp;lt;/code&amp;gt; versus &amp;lt;code&amp;gt;for&amp;lt;/code&amp;gt; loop ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local sometable = { &amp;quot;egg&amp;quot;, &amp;quot;bread&amp;quot;, &amp;quot;banana&amp;quot;, nil, &amp;quot;milk&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
-- As a for loop&lt;br /&gt;
-- Order is guaranteed, but where to stop and start is needed&lt;br /&gt;
-- Iterates through all numeric indices, even if values are nil&lt;br /&gt;
for i = 1, #sometable do&lt;br /&gt;
    -- Code goes here&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- As a for loop using ipairs&lt;br /&gt;
-- Order is guaranteed, in ascending order&lt;br /&gt;
-- Iterates through numeric keys/indices, but stops at the first value of nil encountered&lt;br /&gt;
-- Obviates using sometable[i], as value has the same... value&lt;br /&gt;
for index, value in ipairs(sometable) do&lt;br /&gt;
    -- Code goes here&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- As a for loop using pairs&lt;br /&gt;
-- Order is not guaranteed&lt;br /&gt;
-- Iterates through numeric and non-numeric keys&lt;br /&gt;
for key, value in pairs(sometable) do&lt;br /&gt;
    -- Code goes here&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Templates and modules ==&lt;br /&gt;
&lt;br /&gt;
=== Param names ===&lt;br /&gt;
Capitalized, short, and descriptive parameter names are preferred wherever possible, such as &amp;lt;code&amp;gt;Scale Signature&amp;lt;/code&amp;gt;, and not &amp;lt;code&amp;gt;scalesig&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ssg&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Non-capitalized parameter names are used for debugging, testing, or meta-use (parameters used to build other templates and typically would never be seen in normal use), such as &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt;. Templates with simple usage can use non-capitalized parameter names throughout.&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Module_introspection&amp;diff=216312</id>
		<title>Template:Module introspection</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Module_introspection&amp;diff=216312"/>
		<updated>2025-11-06T21:09:20Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: template should have no params defined at the template level; it can all be done at the module level&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke: Module introspection | module_introspection}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Module_introspection&amp;diff=216311</id>
		<title>Module:Module introspection</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Module_introspection&amp;diff=216311"/>
		<updated>2025-11-06T21:07:22Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: for consistency, &amp;quot;debug&amp;quot; should be used for toggling categories; either rename this or use special:expandtemplates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local getArgs = require(&amp;quot;Module:Arguments&amp;quot;).getArgs&lt;br /&gt;
local iutils  = require(&amp;quot;Module:Introspection utils&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Helper function&lt;br /&gt;
-- Given the output of the above function, create a mediawiki table&lt;br /&gt;
function p.make_dependency_table(module_deps)&lt;br /&gt;
&lt;br /&gt;
	-- Table headers&lt;br /&gt;
	local lines = {}&lt;br /&gt;
	table.insert(lines, &#039;{| class=&amp;quot;wikitable sortable&amp;quot;&#039;)&lt;br /&gt;
	table.insert(lines, &amp;quot;|+ style=\&amp;quot;font-size: 105%;\&amp;quot; | Lua&amp;amp;nbsp;modules&amp;amp;nbsp;required&amp;amp;nbsp;&amp;quot; .. string.format(&amp;quot;(%d)&amp;quot;, #module_deps))&lt;br /&gt;
	table.insert(lines, &amp;quot;|-&amp;quot;)&lt;br /&gt;
	table.insert(lines, &amp;quot;! Variable&amp;quot;)&lt;br /&gt;
	table.insert(lines, &amp;quot;! Module&amp;quot;)&lt;br /&gt;
	table.insert(lines, &amp;quot;! Functions&amp;amp;nbsp;used&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	-- Table rows (assuming they&#039;re all alphabetized)&lt;br /&gt;
	for _, info in ipairs(module_deps) do&lt;br /&gt;
		local funcs_text&lt;br /&gt;
		if #info.funcs == 0 then&lt;br /&gt;
			funcs_text = &amp;quot;&#039;&#039;dependency not used&#039;&#039;&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			local func_lines = {}&lt;br /&gt;
			for _, func in ipairs(info.funcs) do&lt;br /&gt;
				table.insert(func_lines, string.format(&amp;quot;&amp;lt;code&amp;gt;%s&amp;lt;/code&amp;gt;&amp;quot;, func))&lt;br /&gt;
			end&lt;br /&gt;
			funcs_text = table.concat(func_lines, &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		table.insert(lines, &amp;quot;|-&amp;quot;)&lt;br /&gt;
		table.insert(lines, &amp;quot;| &amp;quot; .. info.var)&lt;br /&gt;
		table.insert(lines, &amp;quot;| [[&amp;quot; .. info.dep .. &amp;quot;]]&amp;quot;)&lt;br /&gt;
		table.insert(lines, &amp;quot;| &amp;quot; .. funcs_text)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Table footer&lt;br /&gt;
	table.insert(lines, &amp;quot;|}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	-- Join all lines into a single string&lt;br /&gt;
	return table.concat(lines, &amp;quot;\n&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function&lt;br /&gt;
-- Lists module&#039;s own functions; requires module name to produce links to each&lt;br /&gt;
-- function.&lt;br /&gt;
function p.make_function_table(module_name, module_funcs, descriptions, main_function)&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether descriptions was passed in&lt;br /&gt;
	local has_descriptions = false&lt;br /&gt;
	if type(descriptions) == &amp;quot;table&amp;quot; then&lt;br /&gt;
		for _, _ in pairs(descriptions) do&lt;br /&gt;
			has_descriptions = true&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Table headers&lt;br /&gt;
	local lines = {}&lt;br /&gt;
	--table.insert(lines, string.format(&amp;quot;&#039;&#039;&#039;Module:%s&#039;&#039;&#039; provides %d function(s):&amp;quot;, module_name, #module_funcs))&lt;br /&gt;
	table.insert(lines, &#039;{| class=&amp;quot;wikitable sortable&amp;quot;&#039;)&lt;br /&gt;
	table.insert(lines, &amp;quot;|+ style=\&amp;quot;font-size: 105%;\&amp;quot; | Functions&amp;amp;nbsp;provided&amp;amp;nbsp;&amp;quot; .. string.format(&amp;quot;(%d)&amp;quot;, #module_funcs))&lt;br /&gt;
	table.insert(lines, &amp;quot;|-&amp;quot;)&lt;br /&gt;
	table.insert(lines, &amp;quot;! Line&amp;quot;)&lt;br /&gt;
	table.insert(lines, &amp;quot;! Function&amp;quot;)&lt;br /&gt;
	table.insert(lines, &amp;quot;! Params&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	-- If there are descriptions, add a column for that&lt;br /&gt;
	if has_descriptions then&lt;br /&gt;
		table.insert(lines, &amp;quot;! Description&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Table rows&lt;br /&gt;
	for _, info in ipairs(module_funcs) do&lt;br /&gt;
		&lt;br /&gt;
		-- Find params for that function, or say &amp;quot;none&amp;quot; if none&lt;br /&gt;
		local params = {}&lt;br /&gt;
		for _, param in ipairs(info.params) do&lt;br /&gt;
			table.insert(params, param)	&lt;br /&gt;
		end&lt;br /&gt;
		local params_string = &amp;quot;&amp;quot;&lt;br /&gt;
		if #params == 0 then&lt;br /&gt;
			params_string = &amp;quot;&#039;&#039;none&#039;&#039;&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			params_string = string.format(&amp;quot;&amp;lt;code&amp;gt;(%s)&amp;lt;/code&amp;gt;&amp;quot;, table.concat(params, &amp;quot;, &amp;quot;))&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Create link to line for that function&lt;br /&gt;
		local line_num = string.format(&amp;quot;[[Module:%s#L-%d|%d]]&amp;quot;, module_name, info.line, info.line)&lt;br /&gt;
		&lt;br /&gt;
		-- Create text for function&lt;br /&gt;
		local func = &amp;quot;&amp;quot;&lt;br /&gt;
		if info.name then&lt;br /&gt;
			func = string.format(&amp;quot;&amp;lt;code&amp;gt;%s&amp;lt;/code&amp;gt;&amp;quot;, info.name)&lt;br /&gt;
		else&lt;br /&gt;
			func = &amp;quot;&#039;&#039;none&#039;&#039;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- If the function is the main function, add &amp;quot;main&amp;quot; to that cell&lt;br /&gt;
		if info.name == main_function then&lt;br /&gt;
			func = func .. &amp;quot; &#039;&#039;&#039;(main)&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- If the function is invokable (it has one param called &amp;quot;frame&amp;quot;), add&lt;br /&gt;
		-- &amp;quot;invokable&amp;quot; to that cell&lt;br /&gt;
		if #params == 1 and params[1] == &amp;quot;frame&amp;quot; then&lt;br /&gt;
			func = func .. &amp;quot; &#039;&#039;&#039;(invokable)&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		table.insert(lines, &amp;quot;|-&amp;quot;)&lt;br /&gt;
		table.insert(lines, &amp;quot;| &amp;quot; .. line_num)&lt;br /&gt;
		table.insert(lines, &amp;quot;| &amp;quot; .. func)&lt;br /&gt;
		table.insert(lines, &amp;quot;| &amp;quot; .. params_string)&lt;br /&gt;
		&lt;br /&gt;
		if has_descriptions then&lt;br /&gt;
			table.insert(lines, &amp;quot;| &amp;quot; .. (descriptions[info.name] or &amp;quot;&amp;quot;))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	table.insert(lines, &amp;quot;|}&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(lines, &amp;quot;\n&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Main function; to be called by wrapper&lt;br /&gt;
function p._module_introspection(args)&lt;br /&gt;
	local args = args or {}&lt;br /&gt;
	local module_name   = args[&amp;quot;module_name&amp;quot;  ]&lt;br /&gt;
	local main_function = args[&amp;quot;main_function&amp;quot;]&lt;br /&gt;
	local descriptions  = args[&amp;quot;descriptions&amp;quot; ]&lt;br /&gt;
	local is_doc = args[&amp;quot;is_doc&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether this page is a docpage&lt;br /&gt;
	-- If so, don&#039;t bother&lt;br /&gt;
	if is_doc then&lt;br /&gt;
		return &amp;quot;&#039;&#039;To see introspection summary, see this module&#039;s main page.&#039;&#039;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Preprocess module and blank-out comments&lt;br /&gt;
	--local title = mw.title.new(&#039;Module:&#039; .. module_name)&lt;br /&gt;
	--local code = title:getContent()&lt;br /&gt;
	--code = iutils.preprocess_code(code)		-- Blank-out comments&lt;br /&gt;
	local code = iutils.get_and_preprocess_content(&amp;quot;Module&amp;quot;, module_name)&lt;br /&gt;
	&lt;br /&gt;
	-- Get dependencies and their functions used, then build a table&lt;br /&gt;
	local module_deps = iutils.find_dependencies(code)&lt;br /&gt;
	local dep_table = p.make_dependency_table(module_deps)&lt;br /&gt;
&lt;br /&gt;
	-- Get module&#039;s functions, then build a table using that information&lt;br /&gt;
	local module_funcs = iutils.find_functions(code)&lt;br /&gt;
	local func_table = p.make_function_table(module_name, module_funcs, descriptions, main_function)&lt;br /&gt;
&lt;br /&gt;
	-- Return the tables&lt;br /&gt;
	-- Styling may be improved at a later time&lt;br /&gt;
	local lines = {&lt;br /&gt;
		&#039;{| class=&amp;quot;wikitable mw-collapsible&amp;quot;&#039;,&lt;br /&gt;
		&#039;|-&#039;,&lt;br /&gt;
		&#039;! colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-size: 105%;&amp;quot; | Introspection summary for Module:&#039; .. module_name .. &amp;quot;&amp;amp;nbsp;&amp;quot;,&lt;br /&gt;
		&amp;quot;|-&amp;quot;,&lt;br /&gt;
		&#039;| style=&amp;quot;vertical-align: top; border-right: none;&amp;quot;; |&#039;,&lt;br /&gt;
		func_table,&lt;br /&gt;
		&#039;| style=&amp;quot;vertical-align: top; border-left: none;&amp;quot; |&#039;,&lt;br /&gt;
		dep_table,&lt;br /&gt;
		&amp;quot;|}&amp;quot;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	-- Check whether descriptions was passed in&lt;br /&gt;
	local has_descriptions = false&lt;br /&gt;
	if type(descriptions) == &amp;quot;table&amp;quot; then&lt;br /&gt;
		for _, _ in pairs(descriptions) do&lt;br /&gt;
			has_descriptions = true&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- If no descriptions were provided, add text below that points to the code.&lt;br /&gt;
	if not has_descriptions then&lt;br /&gt;
		table.insert(lines, &amp;quot;&#039;&#039;No function descriptions were provided. The Lua code may have further information.&#039;&#039;&amp;quot;)	&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat(lines, &amp;quot;\n&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper function for modules&lt;br /&gt;
function p.module_introspection(frame)&lt;br /&gt;
	-- Extract arguments using getArgs&lt;br /&gt;
	local args = getArgs(frame) or {}&lt;br /&gt;
&lt;br /&gt;
	-- Get module name from arguments, or default to current page&lt;br /&gt;
	local module_name = args[&amp;quot;module_name&amp;quot;] or mw.title.getCurrentTitle().text&lt;br /&gt;
&lt;br /&gt;
	-- Strip trailing &amp;quot;/doc&amp;quot; if the template is used on a documentation subpage&lt;br /&gt;
	--module_name = module_name:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether page is the doc page&lt;br /&gt;
	-- To ensure proper referencing, do not display introspection on a docpage.&lt;br /&gt;
	local is_doc = string.find(module_name, &amp;quot;/doc$&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	-- Normalize module name so it can be used to find the main function, which&lt;br /&gt;
	-- is assumed to be the same name as the module. Module assumes snake_case&lt;br /&gt;
	-- is used for function names. (If this fails, it can be entered manually.)&lt;br /&gt;
	local normalized_name = module_name:gsub(&amp;quot;[^%w]&amp;quot;, &amp;quot;_&amp;quot;):lower()&lt;br /&gt;
	local main_function = args[&amp;quot;main_function&amp;quot;] or &amp;quot;_&amp;quot; .. normalized_name&lt;br /&gt;
	&lt;br /&gt;
	-- Process all function descriptions, if provided as desc_function_name&lt;br /&gt;
	local func_descriptions = {}&lt;br /&gt;
	for key, val in pairs(args) do&lt;br /&gt;
		local func_name = key:match(&amp;quot;^desc_([%w_]+)$&amp;quot;)&lt;br /&gt;
		if func_name and val and val ~= &amp;quot;&amp;quot; then&lt;br /&gt;
			func_descriptions[func_name] = val&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Return&lt;br /&gt;
	local result = p._module_introspection({&lt;br /&gt;
		[&amp;quot;module_name&amp;quot;  ] = module_name,&lt;br /&gt;
		[&amp;quot;main_function&amp;quot;] = main_function,&lt;br /&gt;
		[&amp;quot;descriptions&amp;quot; ] = func_descriptions,&lt;br /&gt;
		[&amp;quot;is_doc&amp;quot;] = is_doc&lt;br /&gt;
	})&lt;br /&gt;
	&lt;br /&gt;
	return frame:preprocess(result)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215943</id>
		<title>Module:Dochead</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215943"/>
		<updated>2025-11-03T09:18:58Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: quick and dirty fix to add none header back&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local getArgs = require(&amp;quot;Module:Arguments&amp;quot;).getArgs&lt;br /&gt;
local iutils  = require(&amp;quot;Module:Introspection utils&amp;quot;)&lt;br /&gt;
local yesno   = require(&amp;quot;Module:Yesno&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: (Low-ish priority): rewrite to eliminate redundant code&lt;br /&gt;
&lt;br /&gt;
-- Produces a hatnote that is placed on the top of a documentation page (either&lt;br /&gt;
-- template or module documentation) and can autodetect and categorize:&lt;br /&gt;
-- - FOR MODULES:&lt;br /&gt;
--   - whether a module has an accompanying template (overridable/toggleable)&lt;br /&gt;
--   - whether a module is meant as a library for other modules&lt;br /&gt;
-- - FOR TEMPLATES:&lt;br /&gt;
--   - whether a template has an accompanying module (overridable/toggleable)&lt;br /&gt;
--   - what functions from which modules are invoked&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize modules&lt;br /&gt;
local function categorize_module(pagename)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Module documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Lua modules]]&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle modules&lt;br /&gt;
function p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding template exists&lt;br /&gt;
	-- Then check whether that template invokes the module&lt;br /&gt;
	local has_template = iutils.page_exists(&amp;quot;Template:&amp;quot; .. corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse, metatemplate, or noinvoke, this option&lt;br /&gt;
	-- is ignored. For any other option, it&#039;s not.&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; and header ~= &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		has_template = has_template and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- If the module has a template, check for whether it invokes it.&lt;br /&gt;
	if has_template then&lt;br /&gt;
		local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
		has_template = has_template and iutils.invocation_exists(invokes, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on module&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke indicates a lua-based template, but the module&#039;s code is so&lt;br /&gt;
	--   specialized that its code should not be used by other modules or&lt;br /&gt;
	--   invoked by other templates.&lt;br /&gt;
	-- - metamodule and library indicate a module whose code is used mainly for&lt;br /&gt;
	--   other modules. Such modules generally don&#039;t have a corresponding&lt;br /&gt;
	--   template.&lt;br /&gt;
	-- - data/datamodule indicates a module whose purpose is to provide data&lt;br /&gt;
	--   values to other modules. Like library modules, these don&#039;t have a&lt;br /&gt;
	--   corresponding template.&lt;br /&gt;
	-- Does the module have a template?&lt;br /&gt;
	-- - dualuse, metatemplate, and noinvoke: YES (REQUIRED!!)&lt;br /&gt;
	-- - metamodule/library and data: GENERALLY NO&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module has a corresopnding template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a metatemplate, and may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This module is used to create other Lua-based templates and has no corresponding template.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module should not be invoked directly; use its corresponding instead: [[Template:%s]].&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This module primarily serves as a library for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	elseif header == &amp;quot;data&amp;quot; or pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;):match(&amp;quot;/data$&amp;quot;) then&lt;br /&gt;
		result = &amp;quot;This module primarily serves to provide data values for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	elseif header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		result = &amp;quot;&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	else&lt;br /&gt;
		if has_template and header ~= &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;%s This module implements [[Template:%s]].&amp;quot;, header, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		elseif has_template and header == &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;This module implements [[Template:%s]].&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Produce categories&lt;br /&gt;
	local cats = categorize_module(pagename)&lt;br /&gt;
	&lt;br /&gt;
	-- Return&lt;br /&gt;
	if result == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot; .. cats&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize template&lt;br /&gt;
local function categorize_template(pagename, has_invoke)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Template documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Templates]]&amp;quot;&lt;br /&gt;
		if has_invoke then&lt;br /&gt;
			cats = cats .. &amp;quot; [[Category:Lua-based templates]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function&lt;br /&gt;
-- Creates an additional hatnote denoting which functions are invoked from which&lt;br /&gt;
-- modules, if a has more than one invoke.&lt;br /&gt;
local function make_invocation_hatnote(invokes)&lt;br /&gt;
	local hatnote = &amp;quot;&amp;quot;&lt;br /&gt;
	if #invokes == 0 then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		hatnote = &amp;quot;This template invokes the following functions:&amp;quot;&lt;br /&gt;
		local calls = {}&lt;br /&gt;
		for _, call in ipairs(invokes) do&lt;br /&gt;
			local module_link = iutils.make_module_link(call.module)&lt;br /&gt;
			table.insert(calls, string.format(&amp;quot;&#039;&#039;&#039;%s&#039;&#039;&#039; from %s&amp;quot;, call.func, module_link))&lt;br /&gt;
		end&lt;br /&gt;
		return string.format(&amp;quot;%s %s.&amp;quot;, hatnote, table.concat(calls, &amp;quot;, &amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle templates&lt;br /&gt;
function p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding module exists&lt;br /&gt;
	-- Then check whether this template invokes the module&lt;br /&gt;
	local has_module = iutils.page_exists(&amp;quot;Module:&amp;quot; .. corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse or metatemplate, this option is ignored.&lt;br /&gt;
	-- For any other option, it&#039;s not (although it also has no effect on&lt;br /&gt;
	-- noinvoke or library/metamodule).&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		has_module = has_module and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Check for whether the template invokes that module, regardless of whether&lt;br /&gt;
	-- it uses the corresponding module.&lt;br /&gt;
	local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
	local is_module_invoked = iutils.invocation_exists(invokes, corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on templates&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke and metamodule/library don&#039;t have use for templates.&lt;br /&gt;
	-- Does the template have a module?&lt;br /&gt;
	-- - dualuse and metatemplate: YES (REQUIRED!!)&lt;br /&gt;
	-- - noinvoke, metamodule/library, and data/datamodule: option&#039;s don&#039;t apply&lt;br /&gt;
	--   to templates.&lt;br /&gt;
	-- RATIONALE FOR NOINVOKE NOT APPLYING: a template may invoke functions from&lt;br /&gt;
	-- more than one module, but one of them must be the &amp;quot;main&amp;quot; module. Since&lt;br /&gt;
	-- there&#039;s no way to autodetect that, that info must be manually entered.&lt;br /&gt;
	-- If that doesn&#039;t happen&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]]. See its module page for Lua-based template implementation.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by a module that is currently missing. [[Special:EditPage/Module:%s]]&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This metatemplate has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; or header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; or header == &amp;quot;data&amp;quot; or header == &amp;quot;datamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This template has a header option in the wrong namespace. It should be used within the Module namespace.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		if has_module and header ~= &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header ~= &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find all invocations for the template and add it as an addl hatnote.&lt;br /&gt;
	local invocation_hatnote = make_invocation_hatnote(invokes)&lt;br /&gt;
	&lt;br /&gt;
	-- Categorize&lt;br /&gt;
	local cats = categorize_template(pagename, #invokes &amp;gt; 0)&lt;br /&gt;
	&lt;br /&gt;
	if header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		return cats&lt;br /&gt;
	elseif result == &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	elseif result == &amp;quot;&amp;quot; and invocation_hatnote ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, invocation_hatnote, cats)&lt;br /&gt;
	elseif result ~= &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;\n:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, invocation_hatnote, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Main function&lt;br /&gt;
function p._dochead(args)&lt;br /&gt;
	local namespace = args[&amp;quot;namespace&amp;quot;]&lt;br /&gt;
	local pagename  = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	local header    = args[&amp;quot;header&amp;quot;] or &amp;quot;none&amp;quot;&lt;br /&gt;
	local corr_template = args[&amp;quot;temp&amp;quot;] or pagename&lt;br /&gt;
	local corr_module   = args[&amp;quot;mod&amp;quot;]  or pagename&lt;br /&gt;
	local detect_corr_page = args[&amp;quot;detect_corr_page&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
	-- If header is none, skip everything&lt;br /&gt;
	if header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		--return categorize(namespace, pagename)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Call appropriate hatnote-making function&lt;br /&gt;
	-- Remove /doc suffix if this is on a /doc page to ensure links are made&lt;br /&gt;
	-- properly. :gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if namespace == &amp;quot;Module&amp;quot; then&lt;br /&gt;
		result = p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	elseif namespace == &amp;quot;Template&amp;quot; then&lt;br /&gt;
		result = p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	else&lt;br /&gt;
		result = &amp;quot;:&#039;&#039;This documentation template is in the wrong namespace. It should be within the Template or Module namespaces.&#039;&#039;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper to be invoked&lt;br /&gt;
function p.dochead(frame)&lt;br /&gt;
	local args = getArgs(frame, { removeBlanks = true }) or {}&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Extract or parse args&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = args[&amp;quot;namespace&amp;quot;] or title.nsText&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = args[&amp;quot;pagename&amp;quot; ] or title.text&lt;br /&gt;
&lt;br /&gt;
	-- Extract header or set it to defaults&lt;br /&gt;
	if args[&amp;quot;header&amp;quot;] == nil or args[&amp;quot;header&amp;quot;] == &amp;quot;&amp;quot; then&lt;br /&gt;
		if args[&amp;quot;namespace&amp;quot;] == &amp;quot;Module&amp;quot; then&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;noinvoke&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Extract template/module names, or autogenerate them&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;temp&amp;quot;] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;mod&amp;quot; ] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	-- Option to detect corresponding page (default true)&lt;br /&gt;
	args[&amp;quot;detect_corr_page&amp;quot;] = args[&amp;quot;detect_corr_page&amp;quot;] == nil and true or yesno(args[&amp;quot;detect_corr_page&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tester()&lt;br /&gt;
	local args = {}&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = &amp;quot;Template&amp;quot;&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = &amp;quot;Module introspection&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215659</id>
		<title>Module:Dochead</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215659"/>
		<updated>2025-11-02T02:21:28Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: temporarily disable categories for none header, pending a proper fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local getArgs = require(&amp;quot;Module:Arguments&amp;quot;).getArgs&lt;br /&gt;
local iutils  = require(&amp;quot;Module:Introspection utils&amp;quot;)&lt;br /&gt;
local yesno   = require(&amp;quot;Module:Yesno&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: (Low-ish priority): rewrite to eliminate redundant code&lt;br /&gt;
&lt;br /&gt;
-- Produces a hatnote that is placed on the top of a documentation page (either&lt;br /&gt;
-- template or module documentation) and can autodetect and categorize:&lt;br /&gt;
-- - FOR MODULES:&lt;br /&gt;
--   - whether a module has an accompanying template (overridable/toggleable)&lt;br /&gt;
--   - whether a module is meant as a library for other modules&lt;br /&gt;
-- - FOR TEMPLATES:&lt;br /&gt;
--   - whether a template has an accompanying module (overridable/toggleable)&lt;br /&gt;
--   - what functions from which modules are invoked&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize modules&lt;br /&gt;
local function categorize_module(pagename)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Module documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Lua modules]]&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle modules&lt;br /&gt;
function p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding template exists&lt;br /&gt;
	-- Then check whether that template invokes the module&lt;br /&gt;
	local has_template = iutils.page_exists(&amp;quot;Template:&amp;quot; .. corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse, metatemplate, or noinvoke, this option&lt;br /&gt;
	-- is ignored. For any other option, it&#039;s not.&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; and header ~= &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		has_template = has_template and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- If the module has a template, check for whether it invokes it.&lt;br /&gt;
	if has_template then&lt;br /&gt;
		local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
		has_template = has_template and iutils.invocation_exists(invokes, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on module&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke indicates a lua-based template, but the module&#039;s code is so&lt;br /&gt;
	--   specialized that its code should not be used by other modules or&lt;br /&gt;
	--   invoked by other templates.&lt;br /&gt;
	-- - metamodule and library indicate a module whose code is used mainly for&lt;br /&gt;
	--   other modules. Such modules generally don&#039;t have a corresponding&lt;br /&gt;
	--   template.&lt;br /&gt;
	-- - data/datamodule indicates a module whose purpose is to provide data&lt;br /&gt;
	--   values to other modules. Like library modules, these don&#039;t have a&lt;br /&gt;
	--   corresponding template.&lt;br /&gt;
	-- Does the module have a template?&lt;br /&gt;
	-- - dualuse, metatemplate, and noinvoke: YES (REQUIRED!!)&lt;br /&gt;
	-- - metamodule/library and data: GENERALLY NO&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module has a corresopnding template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a metatemplate, and may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This module is used to create other Lua-based templates and has no corresponding template.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module should not be invoked directly; use its corresponding instead: [[Template:%s]].&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This module primarily serves as a library for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	elseif header == &amp;quot;data&amp;quot; or pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;):match(&amp;quot;/data$&amp;quot;) then&lt;br /&gt;
		result = &amp;quot;This module primarily serves to provide data values for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	else&lt;br /&gt;
		if has_template and header ~= &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;%s This module implements [[Template:%s]].&amp;quot;, header, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		elseif has_template and header == &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;This module implements [[Template:%s]].&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Produce categories&lt;br /&gt;
	local cats = categorize_module(pagename)&lt;br /&gt;
	&lt;br /&gt;
	-- Return&lt;br /&gt;
	if result == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot; .. cats&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize template&lt;br /&gt;
local function categorize_template(pagename, has_invoke)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Template documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Templates]]&amp;quot;&lt;br /&gt;
		if has_invoke then&lt;br /&gt;
			cats = cats .. &amp;quot; [[Category:Lua-based templates]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function&lt;br /&gt;
-- Creates an additional hatnote denoting which functions are invoked from which&lt;br /&gt;
-- modules, if a has more than one invoke.&lt;br /&gt;
local function make_invocation_hatnote(invokes)&lt;br /&gt;
	local hatnote = &amp;quot;&amp;quot;&lt;br /&gt;
	if #invokes == 0 then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		hatnote = &amp;quot;This template invokes the following functions:&amp;quot;&lt;br /&gt;
		local calls = {}&lt;br /&gt;
		for _, call in ipairs(invokes) do&lt;br /&gt;
			local module_link = iutils.make_module_link(call.module)&lt;br /&gt;
			table.insert(calls, string.format(&amp;quot;&#039;&#039;&#039;%s&#039;&#039;&#039; from %s&amp;quot;, call.func, module_link))&lt;br /&gt;
		end&lt;br /&gt;
		return string.format(&amp;quot;%s %s.&amp;quot;, hatnote, table.concat(calls, &amp;quot;, &amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle templates&lt;br /&gt;
function p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding module exists&lt;br /&gt;
	-- Then check whether this template invokes the module&lt;br /&gt;
	local has_module = iutils.page_exists(&amp;quot;Module:&amp;quot; .. corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse or metatemplate, this option is ignored.&lt;br /&gt;
	-- For any other option, it&#039;s not (although it also has no effect on&lt;br /&gt;
	-- noinvoke or library/metamodule).&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		has_module = has_module and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Check for whether the template invokes that module, regardless of whether&lt;br /&gt;
	-- it uses the corresponding module.&lt;br /&gt;
	local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
	local is_module_invoked = iutils.invocation_exists(invokes, corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on templates&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke and metamodule/library don&#039;t have use for templates.&lt;br /&gt;
	-- Does the template have a module?&lt;br /&gt;
	-- - dualuse and metatemplate: YES (REQUIRED!!)&lt;br /&gt;
	-- - noinvoke, metamodule/library, and data/datamodule: option&#039;s don&#039;t apply&lt;br /&gt;
	--   to templates.&lt;br /&gt;
	-- RATIONALE FOR NOINVOKE NOT APPLYING: a template may invoke functions from&lt;br /&gt;
	-- more than one module, but one of them must be the &amp;quot;main&amp;quot; module. Since&lt;br /&gt;
	-- there&#039;s no way to autodetect that, that info must be manually entered.&lt;br /&gt;
	-- If that doesn&#039;t happen&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]]. See its module page for Lua-based template implementation.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by a module that is currently missing. [[Special:EditPage/Module:%s]]&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This metatemplate has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; or header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; or header == &amp;quot;data&amp;quot; or header == &amp;quot;datamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This template has a header option in the wrong namespace. It should be used within the Module namespace.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		if has_module and header ~= &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header ~= &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find all invocations for the template and add it as an addl hatnote.&lt;br /&gt;
	local invocation_hatnote = make_invocation_hatnote(invokes)&lt;br /&gt;
	&lt;br /&gt;
	-- Categorize&lt;br /&gt;
	local cats = categorize_template(pagename, #invokes &amp;gt; 0)&lt;br /&gt;
	&lt;br /&gt;
	if result == &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	elseif result == &amp;quot;&amp;quot; and invocation_hatnote ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, invocation_hatnote, cats)&lt;br /&gt;
	elseif result ~= &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;\n:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, invocation_hatnote, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Main function&lt;br /&gt;
function p._dochead(args)&lt;br /&gt;
	local namespace = args[&amp;quot;namespace&amp;quot;]&lt;br /&gt;
	local pagename  = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	local header    = args[&amp;quot;header&amp;quot;] or &amp;quot;none&amp;quot;&lt;br /&gt;
	local corr_template = args[&amp;quot;temp&amp;quot;] or pagename&lt;br /&gt;
	local corr_module   = args[&amp;quot;mod&amp;quot;]  or pagename&lt;br /&gt;
	local detect_corr_page = args[&amp;quot;detect_corr_page&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
	-- If header is none, skip everything&lt;br /&gt;
	if header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		--return categorize(namespace, pagename)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Call appropriate hatnote-making function&lt;br /&gt;
	-- Remove /doc suffix if this is on a /doc page to ensure links are made&lt;br /&gt;
	-- properly. :gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if namespace == &amp;quot;Module&amp;quot; then&lt;br /&gt;
		result = p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	elseif namespace == &amp;quot;Template&amp;quot; then&lt;br /&gt;
		result = p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	else&lt;br /&gt;
		result = &amp;quot;:&#039;&#039;This documentation template is in the wrong namespace. It should be within the Template or Module namespaces.&#039;&#039;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper to be invoked&lt;br /&gt;
function p.dochead(frame)&lt;br /&gt;
	local args = getArgs(frame, { removeBlanks = true }) or {}&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Extract or parse args&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = args[&amp;quot;namespace&amp;quot;] or title.nsText&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = args[&amp;quot;pagename&amp;quot; ] or title.text&lt;br /&gt;
&lt;br /&gt;
	-- Extract header or set it to defaults&lt;br /&gt;
	if args[&amp;quot;header&amp;quot;] == nil or args[&amp;quot;header&amp;quot;] == &amp;quot;&amp;quot; then&lt;br /&gt;
		if args[&amp;quot;namespace&amp;quot;] == &amp;quot;Module&amp;quot; then&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;noinvoke&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Extract template/module names, or autogenerate them&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;temp&amp;quot;] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;mod&amp;quot; ] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	-- Option to detect corresponding page (default true)&lt;br /&gt;
	args[&amp;quot;detect_corr_page&amp;quot;] = args[&amp;quot;detect_corr_page&amp;quot;] == nil and true or yesno(args[&amp;quot;detect_corr_page&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tester()&lt;br /&gt;
	local args = {}&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = &amp;quot;Template&amp;quot;&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = &amp;quot;Module introspection&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk&amp;diff=215630</id>
		<title>User:Ganaram inukshuk</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk&amp;diff=215630"/>
		<updated>2025-11-01T07:24:07Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I generally go by &amp;quot;Ganaram&amp;quot; or some variant of that (ganaram_inukshuk, gdinuk). (Discord: ganaraminukshuk0; he/they; generally more active on the Xen Discord unless work bogs me down.)&lt;br /&gt;
&lt;br /&gt;
I&#039;ve heard about microtonality on and off over the years, but what drew me into the topic was two things: HEHEHE I AM A SUPAHSTAR SAGA&#039;s video series on 19edo and Patricia Taxxon&#039;s song Spiral Staircase.&lt;br /&gt;
&lt;br /&gt;
From a compositional perspective, my goal is to incorporate xenharmonic elements into an otherwise normal-sounding song, though my more ambitious goal is to not use the diatonic (LLLsLLs) scale structure at all.&lt;br /&gt;
&lt;br /&gt;
From a theory perspective, my goal is to better understand xenharmony from a temperament-agnostic perspective. This primarily means edos and MOSses, but extends to MV3 scales and higher.&lt;br /&gt;
&lt;br /&gt;
From a wikian perspective, my goal is to better the wiki itself, at least as it pertains to how mos-related info is displayed. The most immediate way to achieve this is to create and deploy templates for the most commonly displayed mos-related info, as well as wikifying any text present (so it looks like an actual wiki page!) and trying to verify the source or attribution to things taken for granted (because misattribution happens concerningly). I&#039;ve written a style guide to be applied to all mos pages (see subpages below), but I&#039;m also open to better ideas.&lt;br /&gt;
&lt;br /&gt;
== Main mindset ==&lt;br /&gt;
I summarize my main mindset using the following trinity: &#039;&#039;&#039;temperaments, mosses, and edos are not each other&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Temperaments produce mosses, but two different temperaments may produce the same mos. Edos support more than one family of mos, so it&#039;s fruitless to shoehorn the notation meant for one mos for a different mos within the same edo. Two temperaments may produce the same JI ratio, but have different qualities in different mosses.&lt;br /&gt;
&lt;br /&gt;
This level of decoupling makes it so I don&#039;t let any one temperament, mos, or edo influence how I look at either. Just because a nondiatonic mos has a perfect 5th doesn&#039;t mean I should think of it as such, especially if that isn&#039;t the generator to begin with.&lt;br /&gt;
&lt;br /&gt;
That said, I focus more on mosses and, secondarily, edos when it comes to this trinity. I prefer to look at scales based in a temperament-agnostic sense, as mosses that are supported by an edo, or different edos. Doing so relieves me of the expectation that a certain interval must necessarily fall within a few cents of a [[Just intonation|JI]] ratio and lets me be more explorative with musical scales. This is also less names to memorize, since there are a lot of temperament names, and looking at mosses directly means fewer names to remember.&lt;br /&gt;
&lt;br /&gt;
Other running assumptions and techniques may be found under the methodologies page below.&lt;br /&gt;
&lt;br /&gt;
== TO-DO list, major contributions, and wish list ==&lt;br /&gt;
=== Contributions ===&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;font-size: 105%; white-space: nowrap;&amp;quot; | Major work on modules and templates in (roughly) chronological order of inception or involvement&lt;br /&gt;
|-&lt;br /&gt;
! Modules and templates&lt;br /&gt;
! New?&lt;br /&gt;
! Description of template or contribution&lt;br /&gt;
! Status or todo&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:SB tree]]&lt;br /&gt;
[[Template:SB tree]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Creates a Stern-Brocot tree&#039;s entries and their depths.&lt;br /&gt;
| Fallen into disuse.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Scale tree|&amp;lt;s&amp;gt;Module:Scale tree&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:Scale tree|&amp;lt;s&amp;gt;Template:Scale tree&amp;lt;/s&amp;gt;]]&lt;br /&gt;
| No&lt;br /&gt;
| Automates the creation of a mos&#039;s scale tree and tuning spectrum.&lt;br /&gt;
Contributor with CompactStar. (I made it so comments can be entered using one param.)&lt;br /&gt;
| &#039;&#039;&#039;Deprecated, following changes that made it unmaintainable.&#039;&#039;&#039;&lt;br /&gt;
Superseded by Module:MOS tuning spectrum.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS modes]]&lt;br /&gt;
[[Template:MOS modes]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays the modes of a mos.&lt;br /&gt;
| Current means of row/col data is not ideal.&lt;br /&gt;
Further developments uncertain due to personal decision to halt further improvement.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS intro]]&lt;br /&gt;
[[Template:MOS intro]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Creates a consistent, common introductory paragraph for a mos page&#039;s lead section.&lt;br /&gt;
| &#039;&#039;&#039;Possibly rewrite to follow new coding conventions.&#039;&#039;&#039;&lt;br /&gt;
Rewording for nonoctave tunings.&lt;br /&gt;
&lt;br /&gt;
Deprecate name fields as they&#039;re redundant if used with Template:TAMNAMS name.&lt;br /&gt;
&lt;br /&gt;
Possible refactoring.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS gamut]]&lt;br /&gt;
[[Template:MOS gamut]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Given a notation scheme and assigned mode for a mos for an edo, display the note names.&lt;br /&gt;
| Fallen into disuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;[[Module:MOS degrees]]&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;s&amp;gt;[[Template:MOS degrees]]&amp;lt;/s&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays cent values for a mos for up to 5 step ratios.&lt;br /&gt;
| &#039;&#039;&#039;Deprecated, following decision to start over.&#039;&#039;&#039;&lt;br /&gt;
Superseded by Module:MOS tunings.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS notation]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Helper module for displaying mos notation.&lt;br /&gt;
| Fallen into disuse.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS intervals]]&lt;br /&gt;
[[Template:MOS intervals]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays the interval names of a mos and their cent ranges.&lt;br /&gt;
Rewritten to new coding conventions.&lt;br /&gt;
| Experiment with interval lookup.&lt;br /&gt;
&#039;&#039;&#039;REFACTOR.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS mode degrees]]&lt;br /&gt;
[[Template:MOS mode degrees]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Displays the qualities of each scale degree of every mode of a mos.&lt;br /&gt;
| &#039;&#039;&#039;Possibly rewrite to follow new coding conventions.&#039;&#039;&#039;&lt;br /&gt;
Split modmos info into its own template; see Template:MODMOS mode degrees.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REFACTOR.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS in EDO]]&lt;br /&gt;
[[Template:MOS in EDO]]&lt;br /&gt;
| Yes&lt;br /&gt;
|  rowspan=&amp;quot;4&amp;quot; | Displays and visualizes the mosses that an edo contains.&lt;br /&gt;
&lt;br /&gt;
* MOS in EDO: shows the mosses created using a particular generator and period.&lt;br /&gt;
* ...allgens: shows all mosses for all generators for a particular period.&lt;br /&gt;
* ...allperiods or MOSes in EDO: shows all mosses for all generators for all periods.&lt;br /&gt;
|  rowspan=&amp;quot;4&amp;quot; | &#039;&#039;&#039;To be rewritten as a subst-template.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS in EDO allgens]]&lt;br /&gt;
[[Template:MOS in EDO allgens]]&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS in EDO allperiods]]&lt;br /&gt;
[[Template:MOS in EDO allperiods]]&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOSes in EDO]] (shortcut template)&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Template input parse]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Helper module for various templates that have large amounts of info to be displayed.&lt;br /&gt;
| Possible reorganization?&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Step vis]]&lt;br /&gt;
[[Template:Step vis]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Step visualization template for MOS(es) in EDO for standalone use.&lt;br /&gt;
| Consider html-based visualization?&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;[[Module:EDO intro]]&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;s&amp;gt;[[Template:EDO intro]]&amp;lt;/s&amp;gt;&lt;br /&gt;
| Yes (module only)&lt;br /&gt;
| Automation of the EDO intro.&lt;br /&gt;
| &#039;&#039;&#039;Deprecated.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Superseded by Module:ED intro.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;[[Module:JI ratio finder]]&amp;lt;/s&amp;gt;&lt;br /&gt;
| Yes&lt;br /&gt;
| Helper module for JI ratios in ED. Superseded by Module:JI ratios.&lt;br /&gt;
| Fallen into disuse, but not officially deprecated.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:JI ratios in ED|&amp;lt;s&amp;gt;Module:JI ratios in ED&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:JI ratios in ED|&amp;lt;s&amp;gt;Template:JI ratios in ED&amp;lt;/s&amp;gt;]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Creates a table showing the JI ratios approximated by an ED.&lt;br /&gt;
| Fallen into disuse, as JI ratio finder was superseded.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Xenpaper]]&lt;br /&gt;
| Yes&lt;br /&gt;
| For making links to audio examples to be listened to.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:ED intro]]&lt;br /&gt;
[[Template:ED intro]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Automation of the EDO intro, generalized for other equaves.&lt;br /&gt;
| Possible code cleanup.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Idiosyncratic terms]]&lt;br /&gt;
| Yes&lt;br /&gt;
| An alternative to [[Template:Idiosyncratic]] when the original&#039;s use is infeasible.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Infobox MOS]]&lt;br /&gt;
[[Template:Infobox MOS]]&lt;br /&gt;
| No&lt;br /&gt;
| Code cleanup and additional info.&lt;br /&gt;
Moved 8-link infobox to infobox module.&lt;br /&gt;
| &#039;&#039;&#039;Possibly rewrite to follow new coding conventions.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Infobox]]&lt;br /&gt;
| No&lt;br /&gt;
| Support for infoboxes with 8 navlinks added.&lt;br /&gt;
| &#039;&#039;&#039;REFACTOR.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Keyboard vis]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Keyboard visualization template for Infobox MOS. No template currently exists.&lt;br /&gt;
| Possibly extend to ternary and quaternary scales.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Mbox]]&lt;br /&gt;
| No&lt;br /&gt;
| Added the option to show an icon.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Quickstart]]&lt;br /&gt;
[[Template:Has quickstart]]&lt;br /&gt;
| Yes&lt;br /&gt;
| For disambiguating pages meant for theory from pages meant for practice, and for linking between them.&lt;br /&gt;
| ROLLOUT.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS]]&lt;br /&gt;
| No&lt;br /&gt;
| Splitting TAMNAMS-related stuff to its own module.&lt;br /&gt;
Redefining the module into a library for all mos-related templates/modules.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:TAMNAMS]]&lt;br /&gt;
| Yes&lt;br /&gt;
| A module that contains the entire TAMNAMS specification as it pertains to mosses and step ratios.&lt;br /&gt;
Has lookup functions for names and related mosses.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:TAMNAMS use]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Shows that a scale page uses TAMNAMS.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS genchain]]&lt;br /&gt;
[[Template:MOS genchain]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Shows the generator chain of a mos.&lt;br /&gt;
| Dev on hold.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOS scale properties|&amp;lt;s&amp;gt;Template:MOS scale properties&amp;lt;/s&amp;gt;]] (former name)&lt;br /&gt;
|  rowspan=&amp;quot;2&amp;quot; | Yes&lt;br /&gt;
|  rowspan=&amp;quot;2&amp;quot; | Combo template of:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;s&amp;gt;Template:TAMNAMS use&amp;lt;/s&amp;gt;&lt;br /&gt;
* Template:MOS intervals&lt;br /&gt;
* Template:MOS genchain&lt;br /&gt;
* Template:MOS mode degrees&lt;br /&gt;
|  rowspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Deprecated, following changes that made it unmaintainable.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;No combo templates for mos pages.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS data|&amp;lt;s&amp;gt;Module:MOS data&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:MOS data|&amp;lt;s&amp;gt;Template:MOS data&amp;lt;/s&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:TAMNAMS lookup]]&lt;br /&gt;
[[Template:TAMNAMS lookup]]&lt;br /&gt;
| Yes&lt;br /&gt;
| TAMNAMS name lookup as a standalone template.&lt;br /&gt;
| Dev direction unclear.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:TAMNAMS name]]&lt;br /&gt;
| Yes&lt;br /&gt;
| For writing the paragraph that states a mos&#039;s TAMNAMS name and its etymology or reasoning.&lt;br /&gt;
| ROLLOUT.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS interval HE]]&lt;br /&gt;
[[Template:MOS interval HE]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Standalone template for harmonic entropy.&lt;br /&gt;
Formerly a part of MOS intervals; added by [[User:R-4981]] but separated due to concerns regarding HE.&lt;br /&gt;
| Further developments uncertain.&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:MOS tunings]]&lt;br /&gt;
[[Template:MOS tunings]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Replacement for Template:MOS degrees.&lt;br /&gt;
| &#039;&#039;&#039;Rewrite to follow new coding conventions.&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Nutshell]]&lt;br /&gt;
| Yes&lt;br /&gt;
| See equivalent template on Wikipedia.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:JI ratios]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Module for searching for JI ratios, as well as parsing them from template input.&lt;br /&gt;
Replacement for Module:JI ratio finder.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Mediants]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Standalone template for mediant calculations. To be used for the following modules:&lt;br /&gt;
&lt;br /&gt;
* Module:SB tree&lt;br /&gt;
* &amp;lt;s&amp;gt;Module:Scale tree&amp;lt;/s&amp;gt;&lt;br /&gt;
* Module:MOS tuning spectrum&lt;br /&gt;
* Module:JI ratios&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Deprecated parameters]]&lt;br /&gt;
| Yes&lt;br /&gt;
| A module for denoting one or more deprecated parameters in a template.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | New templates after this line follow new (personal) coding conventions, outlined in v1 of my style guide.&lt;br /&gt;
|-&lt;br /&gt;
! Modules and templates&lt;br /&gt;
! New?&lt;br /&gt;
! Description of template or contribution&lt;br /&gt;
! Status or todo&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:Navbox]]&lt;br /&gt;
[[Module:Navbox]]&lt;br /&gt;
| Yes&lt;br /&gt;
| A template and module for producing a navbox. Module builds up navbox from input.&lt;br /&gt;
Navboxes can be made either as a template or using a lua module calling the navbox functions.&lt;br /&gt;
|Possibly add templatestyles integration&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Infobox]]&lt;br /&gt;
[[Template:Infobox]]&lt;br /&gt;
| Yes (template only)&lt;br /&gt;
| Rewrote entire infobox from scratch to support infobox template.&lt;br /&gt;
Same as navbox; infoboxes can be made either using a module calling the infobox functions or with a template.&lt;br /&gt;
|Possibly add templatestyles integration&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Numlinks]]&lt;br /&gt;
[[Template:Numlinks]]&lt;br /&gt;
|Yes&lt;br /&gt;
| A template for calculating and creating prev/next links for a numbered page. Pages are incremented (or decremented) by 1.&lt;br /&gt;
| Possibly let template auto-extract text.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOS tuning spectrum]]&lt;br /&gt;
[[Module:MOS tuning spectrum]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Made to address maintenance issues with Module:Scale tree.&lt;br /&gt;
Comment entries are reverted back to having one param per ratio, where params are generated on the fly, not hardocded.&lt;br /&gt;
| Add comments for step ratios not found by search.&lt;br /&gt;
|-&lt;br /&gt;
| [[Template:MOS scalesig]]&lt;br /&gt;
[[Module:MOS scalesig]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Made to address shortcomings with [[Template:Scale link]] and need to format mos scalesigs.&lt;br /&gt;
This template auto-formats a scale signature:&lt;br /&gt;
&lt;br /&gt;
* Spaces are replaced with nonbreaking spaces.&lt;br /&gt;
* For nonoctave scales, angle brackets are replaced with the appropriate ones.&lt;br /&gt;
* Can format the scalesig as a link, if needed.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;s&amp;gt;Template:MOS stub&amp;lt;/s&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| A proposed combination template consisting of:&lt;br /&gt;
&lt;br /&gt;
* Template:Infobox MOS&lt;br /&gt;
* Template:MOS intro&lt;br /&gt;
* Template:MOS intervals&lt;br /&gt;
* Template:MOS tuning spectrum&lt;br /&gt;
Such a template would be a subst-template.&lt;br /&gt;
| &#039;&#039;&#039;Cancelled. No combo templates for mos pages.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:JI ratios]]&lt;br /&gt;
|Yes&lt;br /&gt;
|Rewrite of existing JI ratios module into two modules: one for searching for ratios, and one for filtering ratios&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Disavowed]]&lt;br /&gt;
|Yes&lt;br /&gt;
|Denotes terms whose usage is no longer advised, generally due to the name being unsuitable (EG, offensive, inappropriate, etc) or due to the person who coined the term retracting it.&lt;br /&gt;
|Use-cases to be determined.&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Navbox Lumatone]]&lt;br /&gt;
[[Template:Navbox fractional-octave]]&lt;br /&gt;
[[Module:Navbar]]&lt;br /&gt;
|No&lt;br /&gt;
|Decoupling navbar so it doesn&#039;t generate navboxes&#039; or their prev/next links; that work is delegated to Template:Numlinks and Template:Navbox.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Sidebar]]&lt;br /&gt;
[[Module:Sidebar]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A template that&#039;s a basic implementation of Wikipedia&#039;s sidebar. Some infobox-like templates use this over the actual infobox, so it&#039;s made into an actual template.&lt;br /&gt;
|Possibly add templatestyles integration&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Template input utils]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A library for preprocessing template args.&lt;br /&gt;
May possibly be a new location for Module:Template input parse (TIP).&lt;br /&gt;
&lt;br /&gt;
Proposed functions:&lt;br /&gt;
&lt;br /&gt;
* numbered_args_to_table(args, key_fmt, max_num)&lt;br /&gt;
* header_data_pairs_to_table(args, header_fmt, data_fmt)&lt;br /&gt;
* Functions to parse key-value, ratios, and sequences of ratios (from TIP)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Numlinks 2-num]]&lt;br /&gt;
[[Module:Numlinks 2-num]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A variant of numlinks that supports two varying numbers. Intended for pages such as mosses, EG 5L 2s.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Template rating]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A template that implements Wikipedia&#039;s template/module rating template. Advises editors that the template is one of several things:&lt;br /&gt;
&lt;br /&gt;
* Draft; a mockup of a new template/module that is undergoing testing. Not ready for use anywhere except test pages. (encompasses pre-alpha/alpha/beta/mockup)&lt;br /&gt;
* Ready; template/module is ready for use&lt;br /&gt;
* Broken; self-explanatory. Definitely do not use until it&#039;s either fixed or deemed unfixable.&lt;br /&gt;
* Replaced; template is deprecated and has a replacement; template is kept for archival purposes or can be deleted.&lt;br /&gt;
* Deprecated; do not use anywhere; template is kept for archival purposes or can be deleted.&lt;br /&gt;
|In development&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Category handler]]&lt;br /&gt;
[[Module:Category handler]]&lt;br /&gt;
|Yes&lt;br /&gt;
|A proposed template-module pair that is a basic implementation of Wikipedia&#039;s module of the same name: https://en.wikipedia.org/wiki/Module:Category_handler&lt;br /&gt;
Features:&lt;br /&gt;
&lt;br /&gt;
* Allows templates to categorize pages, given a list of categories&lt;br /&gt;
&lt;br /&gt;
* Suppresses categories based on a list of suppressed namespaces (configurable) and a list of suppressed suffixes (subpages; configurable)&lt;br /&gt;
* Module is standalone; it requires no other modules as dependencies, apart from possibly utility modules.&lt;br /&gt;
|Attempted in the past by someone else but was deleted.&lt;br /&gt;
|-&lt;br /&gt;
|[[Template:Todo]]&lt;br /&gt;
|No&lt;br /&gt;
|Integrate category handler so templates/modules with todos don&#039;t get categorized twice (once for the template/module and once more for its /doc page)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; |New templates after this line follow new (personal) coding conventions, outlined in v2 of my style guide. Features:&lt;br /&gt;
Use of snake_case for ALL param names, wherever possible; previous templates go through template name normalization to maintain backwards-compatibility&lt;br /&gt;
For lua-based templates, no params will ever be defined at the template level; params are defined at the module level&lt;br /&gt;
|-&lt;br /&gt;
!Modules and templates&lt;br /&gt;
!New?&lt;br /&gt;
!Description of template or contribution&lt;br /&gt;
!Status or todo&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Module introspection]]&lt;br /&gt;
[[Template:Module introspection]]&lt;br /&gt;
|Yes&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |A set of modules that inspects mediawiki templates and lua code for:&lt;br /&gt;
&lt;br /&gt;
* (FOR TEMPLATES): detecting whether a template invokes a module&#039;s function&lt;br /&gt;
* (FOR MODULES): detecting a module&#039;s dependencies and the functions used.&lt;br /&gt;
&lt;br /&gt;
Common functionality is stored in Module:Introspection utils. Module introspection serves to implement this functionality for modules; template introspection is handled as part of Module:Dochead.&lt;br /&gt;
&lt;br /&gt;
These templates/changes replace [[Template:Lua]] as used on module docpaegs.&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Template introspection|&amp;lt;s&amp;gt;Module:Template introspection&amp;lt;/s&amp;gt;]]&lt;br /&gt;
[[Template:Template introspection|&amp;lt;s&amp;gt;Template:Template introspection&amp;lt;/s&amp;gt;]]&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Introspection utils]]&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|[[Module:Dochead]]&lt;br /&gt;
[[Template:Dochead]]&lt;br /&gt;
|Yes (module only)&lt;br /&gt;
|Proposed module is a rewrite of Template:Dochead that makes the template able to:&lt;br /&gt;
&lt;br /&gt;
* Autodetect modules with corresponding templates, with options for overrides&lt;br /&gt;
* Autodetect templates with corresponding modules, with options for overrides&lt;br /&gt;
* Display which functions are invoked and from which modules.&lt;br /&gt;
These templates/changes replace [[Template:Lua]] as used on template docpages.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|All deprecation templates except [[Template:Deprecated parameters]]&lt;br /&gt;
|No&lt;br /&gt;
|Minor changes to inform editors if they&#039;re used in the wrong namespaces.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|All categorizing infoboxes:&lt;br /&gt;
&lt;br /&gt;
* [[Template:Infobox MOS]]&lt;br /&gt;
* [[Template:Infobox AFDO]]&lt;br /&gt;
* [[Template:Infobox chord]]&lt;br /&gt;
* [[Template:Infobox ET]]&lt;br /&gt;
* [[Template:Infobox interval]]&lt;br /&gt;
|No&lt;br /&gt;
|Proposal to add [[Module:Category handler]] so these templates automatically categorize themselves when in the correct namespaces&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Template:Keyboard vis&lt;br /&gt;
|&lt;br /&gt;
|See Module:Keyboard vis.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:ED ratios&lt;br /&gt;
Template:ED ratios&lt;br /&gt;
|&lt;br /&gt;
| A proposed template that is an upgraded version of Module:JI ratios in ED&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:Interval regions&lt;br /&gt;
|&lt;br /&gt;
| A proposed module for roughly classifying diatonic intervals (1st, 2nd etc; major, minor) plus some intermediate or in-between categories ( neutral and interseptimal intervals)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:MODMOS mode degrees&lt;br /&gt;
Template:MODMOS mode degrees&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Module:MOS superset degrees&lt;br /&gt;
Template:MOS superset degrees&lt;br /&gt;
|&lt;br /&gt;
| Like MOS mode degrees, except the scale degrees are in relation to an ancestor mos.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Wikiprojects and style guides ===&lt;br /&gt;
* [[Xenharmonic Wiki:WikiProject Mospage|Project Mospage]] and [[Xenharmonic Wiki:MOS page style guide|mospage style guide]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Docpage style guide|Docpage style guide]] (not worthy of a wikiproject since most docpages have been written alraedy)&lt;br /&gt;
&lt;br /&gt;
=== Project mbox-icon ===&lt;br /&gt;
Various wikis have custom/themed icons. Apart from exceptions where a more common icon is preferred, why not have custom mbox icons for xenwiki?&lt;br /&gt;
&lt;br /&gt;
=== Other contributions ===&lt;br /&gt;
* Mos page standardization (work-in-progress)&lt;br /&gt;
* [[Recursive structure of MOS scales|MOS recursion and MOS recursion algorithms]]; tried my best to make the descriptions for MOS recursion apply to all cases (Work-in-progress)&lt;br /&gt;
* Some rewording of the [[TAMNAMS]] page for readability and flow. I have a few TAMNAMS-related proposals of my own that aren&#039;t quite ready to be called official. See todo list or TAMNAMS subpage.&lt;br /&gt;
* [[Horogram|A page for horograms]], since it was totally absent (Work-in-progress).&lt;br /&gt;
* [[MOS Scale Family Tree|Mos family tree page]] for a tree I independently discovered before realizing Erv Wilson had already described it. Also has to do with mos recursion.&lt;br /&gt;
&lt;br /&gt;
===To-do list ===&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;s&amp;gt;Rewrite page(s)&amp;lt;/s&amp;gt; Under jurisdiction of Project Mospage.&#039;&#039;&#039;&lt;br /&gt;
** [[Operations on MOSes|&amp;lt;s&amp;gt;Operations on MOSes&amp;lt;/s&amp;gt;]]&lt;br /&gt;
** [[MOS scale|&amp;lt;s&amp;gt;MOS scale&amp;lt;/s&amp;gt;]]&lt;br /&gt;
** &amp;lt;s&amp;gt;[[TAMNAMS/Appendix]] (primarily for names reasoning and adding general principles)&amp;lt;/s&amp;gt;&lt;br /&gt;
** &amp;lt;s&amp;gt;[[TAMNAMS Extension]] (since such names should follow the same naming principles as the &amp;quot;named range&amp;quot; names, but no such principles currently exist)&amp;lt;/s&amp;gt;&lt;br /&gt;
* &amp;lt;s&amp;gt;&#039;&#039;&#039;Rewrite all octave-equivalent mos pages.&#039;&#039;&#039; This is primarily replacing every scale tree for the corresponding template and rewriting the lead sections to make sense and does not present redundant information already given by one of the templates. To a lesser extent, this also involves trying to confirm temperaments said to be attributed to these mosses, but this step will require additional help.&amp;lt;/s&amp;gt; &#039;&#039;&#039;Under jurisdiction of Project Mospage.&#039;&#039;&#039;&lt;br /&gt;
** &amp;lt;s&amp;gt;This is done concurrently with writing a style guide for these pages; see [[User:Ganaram inukshuk/MOS page standardization guide]] for a proposed guide.&amp;lt;/s&amp;gt;&lt;br /&gt;
** &amp;lt;s&amp;gt;Mosses whose pages have been rewritten to meet the style guide to satisfactory levels (that doesn&#039;t mean the pages can&#039;t be polished further!):&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;5L 1s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;5L 2s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;4L 3s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;3L 4s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;2L 5s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;1L 5s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;7L 1s&amp;lt;/s&amp;gt;&lt;br /&gt;
*** &amp;lt;s&amp;gt;3L 7s&amp;lt;/s&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Update templates I&#039;ve made to current coding style/structure&#039;&#039;&#039;:&lt;br /&gt;
** The template calls a wrapper function, meant to be used with template params as input. Its name should be suggestive of the module&#039;s primary use, and is usually the same name as the template.&lt;br /&gt;
** The wrapper function calls the &amp;quot;main function&amp;quot;, which has the code that produces the output. Its name is the same as name as with the wrapper function, except it&#039;s prefixed by an underscore.&lt;br /&gt;
* Clean up mos recursion page (because I feel bad leaving the algorithms untouched and untested for so long).&lt;br /&gt;
** Replace pseudocode for is-this-scale-a-mos? program with python code; clarify with more examples.&lt;br /&gt;
** Relate mos recursion with the mos family tree.&lt;br /&gt;
** All the recursive algorithms described on that page have time complexities of O(n log n), but the algorithm that generates a Christoffel word (combinatorics-on-words term for the brightest mode of a mos) has a time complexity of O(n). Resolve...?&lt;br /&gt;
* Standardize mosinedo pages. Examples include:&lt;br /&gt;
** [[List of MOS scales in 12edo]]&lt;br /&gt;
** [[List of MOS scales in 17edo]]&lt;br /&gt;
** [[List of MOS scales in 29edo]]&lt;br /&gt;
** [[List of MOS scales in 31edo]]&lt;br /&gt;
&lt;br /&gt;
=== Wish list ===&lt;br /&gt;
* Composing music with these abstract ideas.&lt;br /&gt;
&lt;br /&gt;
== Subpages ==&lt;br /&gt;
These pages contain content that currently don&#039;t have an exact place elsewhere on the Wiki, or contains personal notes that otherwise don&#039;t have an exact place on the Wiki. I do my best to explain these things as though I magically forgot everything I know about xenharmony, so I consider it a bonus if someone else found this easy to understand.&lt;br /&gt;
* [[User:Ganaram inukshuk/Diagrams]] – For xen-related diagrams&lt;br /&gt;
* [[User:Ganaram inukshuk/Notes]] – For xen-related notes&lt;br /&gt;
** [[User:Ganaram inukshuk/Notes/TAMNAMS]] – Since I have so many notes related to TAMNAMS, I made a dedicated page for it&lt;br /&gt;
* [[User:Ganaram inukshuk/Tables]] – For xen-related tables&lt;br /&gt;
* [[User:Ganaram inukshuk/Code]] – For xen-related code&lt;br /&gt;
* [[User:Ganaram inukshuk/Models]] – For xen-related models (needs reorganizing)&lt;br /&gt;
* [[User:Ganaram inukshuk/TAMNAMS Extension]] – Since there were others making their own TAMNAMS extension pages, I decided to make my own.&lt;br /&gt;
** [[User:Ganaram inukshuk/TAMEX]] – Rewrite of the above page for describing any mos descendant, short for &amp;quot;temperament-agnostic moment-of-symmetry scale extension description system&amp;quot;&lt;br /&gt;
** [[User:Ganaram inukshuk/Additional temperament-agnostic mos names]] – Rewrite of the above page for names for proposed names.&lt;br /&gt;
&lt;br /&gt;
These pages are descriptions on how I approach various things, such as compositional techniques and how I approach a scale I&#039;ve never used before.&lt;br /&gt;
* [[User:Ganaram inukshuk/Methodologies]]&lt;br /&gt;
&lt;br /&gt;
Sandbox pages (for testing things)&lt;br /&gt;
* [[User:Ganaram inukshuk/Sandbox]]&lt;br /&gt;
** [[User:Ganaram inukshuk/Sandbox/JI ratios]]&lt;br /&gt;
**[[User:Ganaram inukshuk/Sandbox/Navboxes]]&lt;br /&gt;
**[[User:Ganaram inukshuk/Sandbox/Modmosses]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template sandbox]]&lt;br /&gt;
&lt;br /&gt;
Test pages (for proposed rewrites or new templates):&lt;br /&gt;
* [[User:Ganaram inukshuk/Catalog of MOS Scales]]&lt;br /&gt;
* [[User:Ganaram inukshuk/4L 3s]] (Template test page and test page for style guide)&lt;br /&gt;
* [[User:Ganaram inukshuk/5L 2s]] (Template test page and test page for style guide)&lt;br /&gt;
** [[User:Ganaram inukshuk/MODMOS scales of 5L 2s]]&lt;br /&gt;
* [[User:Ganaram inukshuk/7L 3s]] (Rewrite page)&lt;br /&gt;
* [[User:Ganaram inukshuk/TAMNAMS]] (Rewrite page)&lt;br /&gt;
** [[User:Ganaram inukshuk/TAMNAMS/Appendix]]&lt;br /&gt;
* [[User:Ganaram inukshuk/MOS scale]] (rewrite page)&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Rewrite draft]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Template rating]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Todo]]&lt;br /&gt;
&lt;br /&gt;
Experimental pages (for content considered idiosyncratic, ad-hoc, or otherwise weird):&lt;br /&gt;
* [[User:Ganaram inukshuk/LCP 5L 3s]]&lt;br /&gt;
&lt;br /&gt;
Test templates:&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Mbox]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:TAMNAMS name]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Tcode]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Tester]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Transcript]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Joke page|User:Ganaram inukshuk/Joke page]]&lt;br /&gt;
* [[User:Ganaram inukshuk/JI ratios]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Navbox fractional-octave]]&lt;br /&gt;
* [[User:Ganaram inukshuk/Template:Navbox Lumatone]]&lt;br /&gt;
&lt;br /&gt;
Other:&lt;br /&gt;
* [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
&lt;br /&gt;
[[Category:User on Discord]]&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Deprecated/doc&amp;diff=215629</id>
		<title>Template:Deprecated/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Deprecated/doc&amp;diff=215629"/>
		<updated>2025-11-01T07:18:12Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead}}{{substitute|no}}&lt;br /&gt;
:&#039;&#039;This template is used to deprecate content pages. For the template that is added to a template&#039;s documentation, see [[Template:Template rating]]. For the template that is added to to a template&#039;s code, see [[Template:Deprecated template]].&lt;br /&gt;
The &#039;&#039;&#039;Deprecated&#039;&#039;&#039; template adds a [[Template:Mbox|message box]] to inform readers of pages that is no longer valid, but worth being kept. It also places the page in [[:Category: Deprecated pages]].&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This template should be placed at the top of the page, without any argument.&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template:Deprecated template]] – for templates whose use is no longer advised.&lt;br /&gt;
* [[Template:Deprecated parameters]] – for template parameters whose use is no longer advised.&lt;br /&gt;
* [[Template:Archive]]&lt;br /&gt;
* [[Template:Delete]]&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Deprecated/doc&amp;diff=215628</id>
		<title>Template:Deprecated/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Deprecated/doc&amp;diff=215628"/>
		<updated>2025-11-01T07:16:22Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead}}{{substitute|no}}&lt;br /&gt;
:&#039;&#039;This template is used to deprecate content pages. For the template that is added to a template page&#039;s documentation, see [[Template:Template rating]]. For the template that is added to to a template&#039;s code, see [[Template:Deprecated template]].&lt;br /&gt;
The &#039;&#039;&#039;Deprecated&#039;&#039;&#039; template adds a [[Template:Mbox|message box]] to inform readers of pages that is no longer valid, but worth being kept. It also places the page in [[:Category: Deprecated pages]].&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This template should be placed at the top of the page, without any argument.&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template:Deprecated template]] – for templates whose use is no longer advised.&lt;br /&gt;
* [[Template:Deprecated parameters]] – for template parameters whose use is no longer advised.&lt;br /&gt;
* [[Template:Archive]]&lt;br /&gt;
* [[Template:Delete]]&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Deprecated&amp;diff=215627</id>
		<title>Template:Deprecated</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Deprecated&amp;diff=215627"/>
		<updated>2025-11-01T07:09:50Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#switch: {{NAMESPACE}}&lt;br /&gt;
| Template | Module = {{mbox&lt;br /&gt;
  | icon = Icon-Blank.png&lt;br /&gt;
  | type = aaa&lt;br /&gt;
  | text = &#039;&#039;&#039;This template should only be used in the main namespace and other content pages.&#039;&#039;&#039; For documenting templates or modules&#039; pages as deprecated, use [[Template:Template rating]] with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;rating=deprecated&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;rating=replaced&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. For marking templates themselves as deprecated, use [[Template:Deprecated template]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
| default = {{mbox&lt;br /&gt;
  | icon = Icon-Deprecated.png&lt;br /&gt;
  | type = delete&lt;br /&gt;
  | text = &#039;&#039;&#039;This page is [[:Category:Deprecated pages|deprecated]].&#039;&#039;&#039; It is being kept for posterity and for reference, but is no longer being actively maintained.&lt;br /&gt;
&lt;br /&gt;
If you have contributions to add to this page, it would be advisable to add them to a different, related page instead. &lt;br /&gt;
&lt;br /&gt;
When writing other pages, avoid including links to this page.&lt;br /&gt;
}}&lt;br /&gt;
{{#ifeq: {{lc: {{ARTICLEROOTPAGENAME}}}} | template:deprecated || [[Category:Deprecated pages]]}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Message boxes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Deprecated&amp;diff=215626</id>
		<title>Template:Deprecated</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Deprecated&amp;diff=215626"/>
		<updated>2025-11-01T07:04:42Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#ifeq: {{NAMESPACE}} | Template&lt;br /&gt;
| {{mbox&lt;br /&gt;
  | icon = Icon-Blank.png&lt;br /&gt;
  | type = aaa&lt;br /&gt;
  | text = &#039;&#039;&#039;This template should only be used in the main namespace.&#039;&#039;&#039; For marking template &#039;&#039;pages&#039;&#039; as deprecated, use [[Template:Template rating]] with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;rating=deprecated&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;rating=replaced&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. For the template that&#039;s &#039;&#039;added&#039;&#039; to a template to notify editors of its status, use [[Template:Deprecated template]].&lt;br /&gt;
}}&lt;br /&gt;
| {{mbox&lt;br /&gt;
  | icon = Icon-Deprecated.png&lt;br /&gt;
  | type = delete&lt;br /&gt;
  | text = &#039;&#039;&#039;This page is [[:Category:Deprecated pages|deprecated]].&#039;&#039;&#039; It is being kept for posterity and for reference, but is no longer being actively maintained.&lt;br /&gt;
&lt;br /&gt;
If you have contributions to add to this page, it would be advisable to add them to a different, related page instead. &lt;br /&gt;
&lt;br /&gt;
When writing other pages, avoid including links to this page.&lt;br /&gt;
}}&lt;br /&gt;
{{#ifeq: {{lc: {{ARTICLEROOTPAGENAME}}}} | template:deprecated || [[Category:Deprecated pages]]}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Message boxes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Deprecated&amp;diff=215625</id>
		<title>Template:Deprecated</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Deprecated&amp;diff=215625"/>
		<updated>2025-11-01T07:03:48Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#ifeq: {{NAMESPACE}} | Template&lt;br /&gt;
{{mbox&lt;br /&gt;
  | icon = Icon-Blank.png&lt;br /&gt;
  | type = aaa&lt;br /&gt;
  | text = &#039;&#039;&#039;This template should only be used in the main namespace.&#039;&#039;&#039; For marking template &#039;&#039;pages&#039;&#039; as deprecated, use [[Template:Template rating]] with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;rating=deprecated&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;rating=replaced&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. For the template that&#039;s &#039;&#039;added&#039;&#039; to a template to notify editors of its status, use [[Template:Deprecated template]].&lt;br /&gt;
}}&lt;br /&gt;
| {{mbox&lt;br /&gt;
  | icon = Icon-Deprecated.png&lt;br /&gt;
  | type = delete&lt;br /&gt;
  | text = &#039;&#039;&#039;This page is [[:Category:Deprecated pages|deprecated]].&#039;&#039;&#039; It is being kept for posterity and for reference, but is no longer being actively maintained.&lt;br /&gt;
&lt;br /&gt;
If you have contributions to add to this page, it would be advisable to add them to a different, related page instead. &lt;br /&gt;
&lt;br /&gt;
When writing other pages, avoid including links to this page.&lt;br /&gt;
}}&lt;br /&gt;
{{#ifeq: {{lc: {{ARTICLEROOTPAGENAME}}}} | template:deprecated || [[Category:Deprecated pages]]}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Message boxes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Deprecated&amp;diff=215624</id>
		<title>Template:Deprecated</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Deprecated&amp;diff=215624"/>
		<updated>2025-11-01T06:57:51Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#ifeq:{{NAMESPACE}}||&lt;br /&gt;
  {{Mbox&lt;br /&gt;
   | icon = Icon-Deprecated.png&lt;br /&gt;
   | type = delete&lt;br /&gt;
   | text = &#039;&#039;&#039;This page is [[:Category:Deprecated pages|deprecated]].&#039;&#039;&#039; It is being kept for posterity and for reference, but is no longer being actively maintained.&lt;br /&gt;
&lt;br /&gt;
If you have contributions to add to this page, it would be advisable to add them to a different, related page instead. &lt;br /&gt;
&lt;br /&gt;
When writing other pages, avoid including links to this page.&lt;br /&gt;
  }}&lt;br /&gt;
  {{#ifeq: {{lc: {{ARTICLEROOTPAGENAME}}}} | template:deprecated || [[Category:Deprecated pages]]}}&lt;br /&gt;
|&lt;br /&gt;
  {{Mbox&lt;br /&gt;
   | icon = Icon-Blank.png&lt;br /&gt;
   | type = aaa&lt;br /&gt;
   | text = &#039;&#039;&#039;This template should only be used in the main namespace.&#039;&#039;&#039; For marking template &#039;&#039;pages&#039;&#039; as deprecated, use [[Template:Template rating]] with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;rating=deprecated&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;rating=replaced&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. For the template that&#039;s &#039;&#039;added&#039;&#039; to a template to notify editors of its status, use [[Template:Deprecated template]].&lt;br /&gt;
  }}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Message boxes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Deprecated_template/doc&amp;diff=215623</id>
		<title>Template:Deprecated template/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Deprecated_template/doc&amp;diff=215623"/>
		<updated>2025-11-01T06:51:27Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead}}{{substitute|no}}{{wikipedia|Template:Deprecated template}}&lt;br /&gt;
: &#039;&#039;Not to be confused with [[Template:Deprecated]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;{{ARTICLEROOTPAGENAME}}&#039;&#039;&#039; notifies users that a template has been replaced by one or more new templates, or deprecated (advised to no longer be used) without a replacement. This template should &#039;&#039;not&#039;&#039; be placed in a page&#039;s documentation page; instead, it is placed &#039;&#039;within&#039;&#039; a template&#039;s code, either as part of it or replacing it entirely, to notify editors about that template&#039;s status. Pages that include this template are placed under [[:Category:Pages with deprecated templates]].&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
Use as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Deprecated template|Old template|Template: New template|details=Further details.}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to get:&lt;br /&gt;
&lt;br /&gt;
{{Deprecated template|Old template|Template: New template|details=Further details.}}&lt;br /&gt;
&lt;br /&gt;
The last two parameters are optional. This can be useful when the template was replaced by something other than a new template, like a category.&lt;br /&gt;
&lt;br /&gt;
The parameter names can be omitted if they are used in the same order as specified above.&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template:Template rating]] – a similar template to be used for a template&#039;s documentation.&lt;br /&gt;
* [[Template:Deprecated]] – for pages whose material is no longer valid.&lt;br /&gt;
* [[Template:Deprecated parameters]] – for template parameters whose use is no longer advised.&lt;br /&gt;
* [[:Category:Deprecated templates]]&lt;br /&gt;
* [[:Category:Pages with deprecated templates]]&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Deprecated_template&amp;diff=215621</id>
		<title>Template:Deprecated template</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Deprecated_template&amp;diff=215621"/>
		<updated>2025-11-01T06:47:15Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{Mbox&lt;br /&gt;
| icon = Icon-Deprecated.png&lt;br /&gt;
| type = delete&lt;br /&gt;
| text = [[{{ARTICLESPACE}}:{{{1|{{ROOTPAGENAME}}}}}]] is deprecated. {{#if:{{{2|}}}|Please use [[{{{2}}}]] instead.}}&lt;br /&gt;
&lt;br /&gt;
{{#if: {{{details|}}} | &#039;&#039;&#039;Details:&#039;&#039;&#039; {{{details}}}}}&lt;br /&gt;
}}&lt;br /&gt;
{{Category handler&lt;br /&gt;
| {{#ifeq: {{NAMESPACE}} | Template&lt;br /&gt;
    | {{#ifeq: {{lc:{{ARTICLEROOTPAGENAME}}}} | template:deprecated template&lt;br /&gt;
        | &amp;lt;!-- Don&#039;t categorize self --&amp;gt;&lt;br /&gt;
        | Deprecated templates&lt;br /&gt;
      }}&lt;br /&gt;
    | Pages with deprecated templates&lt;br /&gt;
  }}&lt;br /&gt;
| {{{debug|}}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Message boxes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Deprecated_template&amp;diff=215620</id>
		<title>Template:Deprecated template</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Deprecated_template&amp;diff=215620"/>
		<updated>2025-11-01T06:44:59Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: try to add category handler&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{Mbox&lt;br /&gt;
| icon = Icon-Deprecated.png&lt;br /&gt;
| type = delete&lt;br /&gt;
| text = [[{{ARTICLESPACE}}:{{{1|{{ROOTPAGENAME}}}}}]] is deprecated. {{#if:{{{2|}}}|Please use [[{{{2}}}]] instead.}} {{{details|}}}&lt;br /&gt;
}}&lt;br /&gt;
{{Category handler&lt;br /&gt;
| {{#ifeq: {{NAMESPACE}} | Template&lt;br /&gt;
    | {{#ifeq: {{lc:{{ARTICLEROOTPAGENAME}}}} | template:deprecated template&lt;br /&gt;
        | &amp;lt;!-- Don&#039;t categorize self --&amp;gt;&lt;br /&gt;
        | Deprecated templates&lt;br /&gt;
      }}&lt;br /&gt;
    | Pages with deprecated templates&lt;br /&gt;
  }}&lt;br /&gt;
| {{{debug|}}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Message boxes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk/Template_sandbox&amp;diff=215611</id>
		<title>User:Ganaram inukshuk/Template sandbox</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=User:Ganaram_inukshuk/Template_sandbox&amp;diff=215611"/>
		<updated>2025-11-01T01:55:13Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mbox&lt;br /&gt;
| icon = Icon-Deprecated.png&lt;br /&gt;
| type = delete&lt;br /&gt;
| text = &#039;&#039;&#039;Template:SomeTemplate&#039;&#039;&#039; is deprecated. Please use [[Template:SomeReplacementTemplate]] instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Details:&#039;&#039;&#039; Other details go here.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebox&lt;br /&gt;
| image = Icon-Deprecated.png&lt;br /&gt;
| image size = 44px&lt;br /&gt;
| text = This template is deprecated. See its template page for more information.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{sidebar&lt;br /&gt;
| Title = This template is deprecated.&lt;br /&gt;
| Row 1 = See its template page for more information.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;delete&#039;&#039;&#039; type. Typically used for pages whose content is deprecated or to be deleted.|type=delete}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;content&#039;&#039;&#039; type. Typically used for pages whose content requires verification or rewriting.|type=content}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;style&#039;&#039;&#039; type. Typically used for pages whose writing style doesn&#039;t fit the wiki&#039;s standards.|type=style}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;ready&#039;&#039;&#039; type. Used to denote pages with reliable content (like Wikipedia&#039;s &amp;quot;good articles&amp;quot;) or features (such as templates) that are ready for use.|type=ready}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;notice&#039;&#039;&#039; type. Used to denote general notices. Most messageboxes are of this type.|type=notice}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;move&#039;&#039;&#039; type. Denotes pages that are to be moved.|type=move}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of &#039;&#039;&#039;protection&#039;&#039;&#039; type. Denotes pages that are protected from editing.|type=protection}}&lt;br /&gt;
&lt;br /&gt;
{{Mbox|text=Messagebox of an unknown type. Could be used to denote errors with a messagebox&#039;s inputs.|type=aaa}}&lt;br /&gt;
&lt;br /&gt;
{{MOS mode degrees|Scale Signature=5L 2s|MODMOS Step Pattern=LsLAsLs}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references group=&amp;quot;group&amp;quot; /&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Intervals of 5L 2s&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; |Intervals&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; |&amp;lt;abbr&amp;gt;Steps subtended&amp;lt;/abbr&amp;gt;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; |Range in cents&lt;br /&gt;
|-&lt;br /&gt;
!&amp;lt;abbr&amp;gt;Generic&amp;lt;/abbr&amp;gt;[[#note1|&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;]]&lt;br /&gt;
!&amp;lt;abbr&amp;gt;Specific&amp;lt;/abbr&amp;gt;&lt;br /&gt;
!&amp;lt;abbr&amp;gt;Abbrev.&amp;lt;/abbr&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;0-diastep&#039;&#039;&#039;&lt;br /&gt;
|Perfect 0-diastep&lt;br /&gt;
|P0ms&lt;br /&gt;
|0&lt;br /&gt;
|0.0¢&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |1-diastep&lt;br /&gt;
|Minor 1-diastep&lt;br /&gt;
|m1ms&lt;br /&gt;
|s&lt;br /&gt;
|0.0¢ to 171.4¢&lt;br /&gt;
|-&lt;br /&gt;
|Major 1-diastep&lt;br /&gt;
|M1ms&lt;br /&gt;
|L&lt;br /&gt;
|171.4¢ to 240.0¢&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |2-diastep&lt;br /&gt;
|Minor 2-diastep&lt;br /&gt;
|m2ms&lt;br /&gt;
|L + s&lt;br /&gt;
|240.0¢ to 342.9¢&lt;br /&gt;
|-&lt;br /&gt;
|Major 2-diastep&lt;br /&gt;
|M2ms&lt;br /&gt;
|2L&lt;br /&gt;
|342.9¢ to 480.0¢&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |3-diastep&lt;br /&gt;
|Perfect 3-diastep&lt;br /&gt;
|P3ms&lt;br /&gt;
|2L + s&lt;br /&gt;
|480.0¢ to 514.3¢&lt;br /&gt;
|-&lt;br /&gt;
|Augmented 3-diastep&lt;br /&gt;
|A3ms&lt;br /&gt;
|3L&lt;br /&gt;
|514.3¢ to 720.0¢&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |4-diastep&lt;br /&gt;
|Diminished 4-diastep&lt;br /&gt;
|d4ms&lt;br /&gt;
|2L + 2s&lt;br /&gt;
|480.0¢ to 685.7¢&lt;br /&gt;
|-&lt;br /&gt;
|Perfect 4-diastep&lt;br /&gt;
|P4ms&lt;br /&gt;
|3L + s&lt;br /&gt;
|685.7¢ to 720.0¢&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |5-diastep&lt;br /&gt;
|Minor 5-diastep&lt;br /&gt;
|m5ms&lt;br /&gt;
|3L + 2s&lt;br /&gt;
|720.0¢ to 857.1¢&lt;br /&gt;
|-&lt;br /&gt;
|Major 5-diastep&lt;br /&gt;
|M5ms&lt;br /&gt;
|4L + s&lt;br /&gt;
|857.1¢ to 960.0¢&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |6-diastep&lt;br /&gt;
|Minor 6-diastep&lt;br /&gt;
|m6ms&lt;br /&gt;
|4L + 2s&lt;br /&gt;
|960.0¢ to 1028.6¢&lt;br /&gt;
|-&lt;br /&gt;
|Major 6-diastep&lt;br /&gt;
|M6ms&lt;br /&gt;
|5L + s&lt;br /&gt;
|1028.6¢ to 1200.0¢&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;7-diastep&#039;&#039;&#039;&lt;br /&gt;
|Perfect 7-diastep&lt;br /&gt;
|P7ms&lt;br /&gt;
|5L + 2s&lt;br /&gt;
|1200.0¢&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;span id=&amp;quot;note1&amp;quot;&amp;gt;Definition of generic interval.&amp;lt;/span&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Lua&amp;diff=215610</id>
		<title>Template:Lua</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Lua&amp;diff=215610"/>
		<updated>2025-11-01T01:46:42Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{sidebox|text=&#039;&#039;&#039;This template has been deprecated. Its replacements are [[Template:Dochead]] and [[Template:Module introspection]].&#039;&#039;&#039;[[Category:Pages with deprecated templates]]|image=Icon-Deprecated.png|image size=60px}}&lt;br /&gt;
&lt;br /&gt;
{{#invoke: Variable arguments | lua_banner&lt;br /&gt;
| debug_mode = {{lc:{{{debug|}}}}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;{{#ifeq: {{NAMESPACE}}|Template|{{#ifeq: {{#titleparts: {{FULLPAGENAME}}||-1}}|doc||[[Category:Lua-based templates]]}}|}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Lua&amp;diff=215609</id>
		<title>Template:Lua</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Lua&amp;diff=215609"/>
		<updated>2025-11-01T01:44:57Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{sidebox|text=&#039;&#039;&#039;This template has been deprecated. Its replacements are [[Template:Dochead]] and [[Template:Module introspection]].&#039;&#039;&#039;[[Category:Pages with deprecated templates]]|image=Icon-Deprecated.png}}&lt;br /&gt;
&lt;br /&gt;
{{#invoke: Variable arguments | lua_banner&lt;br /&gt;
| debug_mode = {{lc:{{{debug|}}}}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;{{#ifeq: {{NAMESPACE}}|Template|{{#ifeq: {{#titleparts: {{FULLPAGENAME}}||-1}}|doc||[[Category:Lua-based templates]]}}|}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Lua&amp;diff=215608</id>
		<title>Template:Lua</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Lua&amp;diff=215608"/>
		<updated>2025-11-01T01:43:48Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{sidebox|text=&#039;&#039;&#039;This template has been deprecated. Its replacements are [[Template:Dochead]] and [[Template:Module introspection]].&#039;&#039;&#039;[[Category:Pages with deprecated templates]]}}&lt;br /&gt;
&lt;br /&gt;
{{#invoke: Variable arguments | lua_banner&lt;br /&gt;
| debug_mode = {{lc:{{{debug|}}}}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;{{#ifeq: {{NAMESPACE}}|Template|{{#ifeq: {{#titleparts: {{FULLPAGENAME}}||-1}}|doc||[[Category:Lua-based templates]]}}|}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215607</id>
		<title>Module:Dochead</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215607"/>
		<updated>2025-11-01T01:41:33Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: add header: data/datamodule; this is autodetected if it&amp;#039;s a /data subpage.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local getArgs = require(&amp;quot;Module:Arguments&amp;quot;).getArgs&lt;br /&gt;
local iutils  = require(&amp;quot;Module:Introspection utils&amp;quot;)&lt;br /&gt;
local yesno   = require(&amp;quot;Module:Yesno&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: (Low-ish priority): rewrite to eliminate redundant code&lt;br /&gt;
&lt;br /&gt;
-- Produces a hatnote that is placed on the top of a documentation page (either&lt;br /&gt;
-- template or module documentation) and can autodetect and categorize:&lt;br /&gt;
-- - FOR MODULES:&lt;br /&gt;
--   - whether a module has an accompanying template (overridable/toggleable)&lt;br /&gt;
--   - whether a module is meant as a library for other modules&lt;br /&gt;
-- - FOR TEMPLATES:&lt;br /&gt;
--   - whether a template has an accompanying module (overridable/toggleable)&lt;br /&gt;
--   - what functions from which modules are invoked&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize modules&lt;br /&gt;
local function categorize_module(pagename)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Module documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Lua modules]]&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle modules&lt;br /&gt;
function p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding template exists&lt;br /&gt;
	-- Then check whether that template invokes the module&lt;br /&gt;
	local has_template = iutils.page_exists(&amp;quot;Template:&amp;quot; .. corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse, metatemplate, or noinvoke, this option&lt;br /&gt;
	-- is ignored. For any other option, it&#039;s not.&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; and header ~= &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		has_template = has_template and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- If the module has a template, check for whether it invokes it.&lt;br /&gt;
	if has_template then&lt;br /&gt;
		local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
		has_template = has_template and iutils.invocation_exists(invokes, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on module&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke indicates a lua-based template, but the module&#039;s code is so&lt;br /&gt;
	--   specialized that its code should not be used by other modules or&lt;br /&gt;
	--   invoked by other templates.&lt;br /&gt;
	-- - metamodule and library indicate a module whose code is used mainly for&lt;br /&gt;
	--   other modules. Such modules generally don&#039;t have a corresponding&lt;br /&gt;
	--   template.&lt;br /&gt;
	-- - data/datamodule indicates a module whose purpose is to provide data&lt;br /&gt;
	--   values to other modules. Like library modules, these don&#039;t have a&lt;br /&gt;
	--   corresponding template.&lt;br /&gt;
	-- Does the module have a template?&lt;br /&gt;
	-- - dualuse, metatemplate, and noinvoke: YES (REQUIRED!!)&lt;br /&gt;
	-- - metamodule/library and data: GENERALLY NO&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module has a corresopnding template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a metatemplate, and may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This module is used to create other Lua-based templates and has no corresponding template.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module should not be invoked directly; use its corresponding instead: [[Template:%s]].&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This module primarily serves as a library for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	elseif header == &amp;quot;data&amp;quot; or pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;):match(&amp;quot;/data$&amp;quot;) then&lt;br /&gt;
		result = &amp;quot;This module primarily serves to provide data values for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
	else&lt;br /&gt;
		if has_template and header ~= &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;%s This module implements [[Template:%s]].&amp;quot;, header, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		elseif has_template and header == &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;This module implements [[Template:%s]].&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Produce categories&lt;br /&gt;
	local cats = categorize_module(pagename)&lt;br /&gt;
	&lt;br /&gt;
	-- Return&lt;br /&gt;
	if result == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot; .. cats&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize template&lt;br /&gt;
local function categorize_template(pagename, has_invoke)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Template documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Templates]]&amp;quot;&lt;br /&gt;
		if has_invoke then&lt;br /&gt;
			cats = cats .. &amp;quot; [[Category:Lua-based templates]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function&lt;br /&gt;
-- Creates an additional hatnote denoting which functions are invoked from which&lt;br /&gt;
-- modules, if a has more than one invoke.&lt;br /&gt;
local function make_invocation_hatnote(invokes)&lt;br /&gt;
	local hatnote = &amp;quot;&amp;quot;&lt;br /&gt;
	if #invokes == 0 then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		hatnote = &amp;quot;This template invokes the following functions:&amp;quot;&lt;br /&gt;
		local calls = {}&lt;br /&gt;
		for _, call in ipairs(invokes) do&lt;br /&gt;
			local module_link = iutils.make_module_link(call.module)&lt;br /&gt;
			table.insert(calls, string.format(&amp;quot;&#039;&#039;&#039;%s&#039;&#039;&#039; from %s&amp;quot;, call.func, module_link))&lt;br /&gt;
		end&lt;br /&gt;
		return string.format(&amp;quot;%s %s.&amp;quot;, hatnote, table.concat(calls, &amp;quot;, &amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle templates&lt;br /&gt;
function p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding module exists&lt;br /&gt;
	-- Then check whether this template invokes the module&lt;br /&gt;
	local has_module = iutils.page_exists(&amp;quot;Module:&amp;quot; .. corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse or metatemplate, this option is ignored.&lt;br /&gt;
	-- For any other option, it&#039;s not (although it also has no effect on&lt;br /&gt;
	-- noinvoke or library/metamodule).&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		has_module = has_module and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Check for whether the template invokes that module, regardless of whether&lt;br /&gt;
	-- it uses the corresponding module.&lt;br /&gt;
	local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
	local is_module_invoked = iutils.invocation_exists(invokes, corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on templates&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke and metamodule/library don&#039;t have use for templates.&lt;br /&gt;
	-- Does the template have a module?&lt;br /&gt;
	-- - dualuse and metatemplate: YES (REQUIRED!!)&lt;br /&gt;
	-- - noinvoke, metamodule/library, and data/datamodule: option&#039;s don&#039;t apply&lt;br /&gt;
	--   to templates.&lt;br /&gt;
	-- RATIONALE FOR NOINVOKE NOT APPLYING: a template may invoke functions from&lt;br /&gt;
	-- more than one module, but one of them must be the &amp;quot;main&amp;quot; module. Since&lt;br /&gt;
	-- there&#039;s no way to autodetect that, that info must be manually entered.&lt;br /&gt;
	-- If that doesn&#039;t happen&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]]. See its module page for Lua-based template implementation.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by a module that is currently missing. [[Special:EditPage/Module:%s]]&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This metatemplate has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; or header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; or header == &amp;quot;data&amp;quot; or header == &amp;quot;datamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This template has a header option in the wrong namespace. It should be used within the Module namespace.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		if has_module and header ~= &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header ~= &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find all invocations for the template and add it as an addl hatnote.&lt;br /&gt;
	local invocation_hatnote = make_invocation_hatnote(invokes)&lt;br /&gt;
	&lt;br /&gt;
	-- Categorize&lt;br /&gt;
	local cats = categorize_template(pagename, #invokes &amp;gt; 0)&lt;br /&gt;
	&lt;br /&gt;
	if result == &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	elseif result == &amp;quot;&amp;quot; and invocation_hatnote ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, invocation_hatnote, cats)&lt;br /&gt;
	elseif result ~= &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;\n:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, invocation_hatnote, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Main function&lt;br /&gt;
function p._dochead(args)&lt;br /&gt;
	local namespace = args[&amp;quot;namespace&amp;quot;]&lt;br /&gt;
	local pagename  = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	local header    = args[&amp;quot;header&amp;quot;] or &amp;quot;none&amp;quot;&lt;br /&gt;
	local corr_template = args[&amp;quot;temp&amp;quot;] or pagename&lt;br /&gt;
	local corr_module   = args[&amp;quot;mod&amp;quot;]  or pagename&lt;br /&gt;
	local detect_corr_page = args[&amp;quot;detect_corr_page&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
	-- If header is none, skip everything&lt;br /&gt;
	if header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		return categorize(namespace, pagename)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Call appropriate hatnote-making function&lt;br /&gt;
	-- Remove /doc suffix if this is on a /doc page to ensure links are made&lt;br /&gt;
	-- properly. :gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if namespace == &amp;quot;Module&amp;quot; then&lt;br /&gt;
		result = p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	elseif namespace == &amp;quot;Template&amp;quot; then&lt;br /&gt;
		result = p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	else&lt;br /&gt;
		result = &amp;quot;:&#039;&#039;This documentation template is in the wrong namespace. It should be within the Template or Module namespaces.&#039;&#039;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper to be invoked&lt;br /&gt;
function p.dochead(frame)&lt;br /&gt;
	local args = getArgs(frame, { removeBlanks = true }) or {}&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Extract or parse args&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = args[&amp;quot;namespace&amp;quot;] or title.nsText&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = args[&amp;quot;pagename&amp;quot; ] or title.text&lt;br /&gt;
&lt;br /&gt;
	-- Extract header or set it to defaults&lt;br /&gt;
	if args[&amp;quot;header&amp;quot;] == nil or args[&amp;quot;header&amp;quot;] == &amp;quot;&amp;quot; then&lt;br /&gt;
		if args[&amp;quot;namespace&amp;quot;] == &amp;quot;Module&amp;quot; then&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;noinvoke&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Extract template/module names, or autogenerate them&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;temp&amp;quot;] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;mod&amp;quot; ] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	-- Option to detect corresponding page (default true)&lt;br /&gt;
	args[&amp;quot;detect_corr_page&amp;quot;] = args[&amp;quot;detect_corr_page&amp;quot;] == nil and true or yesno(args[&amp;quot;detect_corr_page&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tester()&lt;br /&gt;
	local args = {}&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = &amp;quot;Template&amp;quot;&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = &amp;quot;Module introspection&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Documentation/doc&amp;diff=215592</id>
		<title>Template:Documentation/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Documentation/doc&amp;diff=215592"/>
		<updated>2025-10-31T11:08:41Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dochead}}{{substitute|no}}{{wikipedia}}{{templatestyles}}&lt;br /&gt;
The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{documentation}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; template is used to contain information and instructions for templates and modules. Wikipedia&#039;s documentation template has modules that help render the dialog boxes, but here the box is hard-coded to simplify things.&lt;br /&gt;
__NOTOC__&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This template automatically extracts contents from the &amp;lt;code&amp;gt;/doc&amp;lt;/code&amp;gt; subpage of any page. You can optionally add an unnamed argument, which will be displayed in place. &lt;br /&gt;
&lt;br /&gt;
==== Templates ====&lt;br /&gt;
On templates, place &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{documentation}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; on the page itself, place the relevant categories afterwards, and enclose them in &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;noinclude&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; tags:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category: …]]&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modules ====&lt;br /&gt;
On pages consisting of exclusively code (modules, CSS, JS, etc.), place this template on the &amp;lt;code&amp;gt;/doc&amp;lt;/code&amp;gt; subpage and pass the notes, along with {{tlx|dochead}}, in as the first unnamed parameter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Documentation|&lt;br /&gt;
{{Dochead}}&lt;br /&gt;
…&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Escape notice}} &lt;br /&gt;
&lt;br /&gt;
Additionally, when {{tlx|lua}} is used on a module documentation page to indicate dependencies, the first paragraph of text after the Lua banner may need to be encased in its own paragraph (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;) element since otherwise the MediaWiki parser may fail to render the paragraphs correctly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Documentation|&lt;br /&gt;
{{Dochead}}{{lua|…|…|}}&lt;br /&gt;
&amp;lt;p&amp;gt;Paragraph 1&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paragraph 2&lt;br /&gt;
&lt;br /&gt;
Paragraph 3&lt;br /&gt;
…&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template: Dochead]] – used to categorise and add appropriate headers onto documentation pages.&lt;br /&gt;
&lt;br /&gt;
{{todo|inline=1|rework|comment=Template:Lua is deprecated; placement of dochead is incorrect; add module introspection}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215591</id>
		<title>Module:Dochead</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215591"/>
		<updated>2025-10-31T10:28:49Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: some cleanup; todo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local getArgs = require(&amp;quot;Module:Arguments&amp;quot;).getArgs&lt;br /&gt;
local iutils  = require(&amp;quot;Module:Introspection utils&amp;quot;)&lt;br /&gt;
local yesno   = require(&amp;quot;Module:Yesno&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: (Low-ish priority): rewrite to eliminate redundant code&lt;br /&gt;
&lt;br /&gt;
-- Produces a hatnote that is placed on the top of a documentation page (either&lt;br /&gt;
-- template or module documentation) and can autodetect and categorize:&lt;br /&gt;
-- - FOR MODULES:&lt;br /&gt;
--   - whether a module has an accompanying template (overridable/toggleable)&lt;br /&gt;
--   - whether a module is meant as a library for other modules&lt;br /&gt;
-- - FOR TEMPLATES:&lt;br /&gt;
--   - whether a template has an accompanying module (overridable/toggleable)&lt;br /&gt;
--   - what functions from which modules are invoked&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize modules&lt;br /&gt;
local function categorize_module(pagename)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Module documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Lua modules]]&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle modules&lt;br /&gt;
function p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding template exists&lt;br /&gt;
	-- Then check whether that template invokes the module&lt;br /&gt;
	local has_template = iutils.page_exists(&amp;quot;Template:&amp;quot; .. corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse, metatemplate, or noinvoke, this option&lt;br /&gt;
	-- is ignored. For any other option, it&#039;s not.&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; and header ~= &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		has_template = has_template and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- If the module has a template, check for whether it invokes it.&lt;br /&gt;
	if has_template then&lt;br /&gt;
		local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
		has_template = has_template and iutils.invocation_exists(invokes, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on module&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke indicates a lua-based template, but the module&#039;s code is so&lt;br /&gt;
	--   specialized that its code should not be used by other modules or&lt;br /&gt;
	--   invoked by other templates.&lt;br /&gt;
	-- - metamodule and library indicate a module whose code is used mainly for&lt;br /&gt;
	--   other modules. Such modules generally don&#039;t have a corresponding&lt;br /&gt;
	--   template.&lt;br /&gt;
	-- Does the module have a template?&lt;br /&gt;
	-- - dualuse, metatemplate, and noinvoke: YES (REQUIRED!!)&lt;br /&gt;
	-- - metamodule/library: GENERALLY NO&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module has a corresopnding template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a metatemplate, and may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This module is used to create other Lua-based templates and has no corresponding template.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module should not be invoked directly; use its corresponding instead: [[Template:%s]].&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This module primarily serves as a library for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		if has_template and header ~= &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;%s This module implements [[Template:%s]].&amp;quot;, header, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		elseif has_template and header == &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;This module implements [[Template:%s]].&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Produce categories&lt;br /&gt;
	local cats = categorize_module(pagename)&lt;br /&gt;
	&lt;br /&gt;
	-- Return&lt;br /&gt;
	if result == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot; .. cats&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize template&lt;br /&gt;
local function categorize_template(pagename, has_invoke)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Template documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Templates]]&amp;quot;&lt;br /&gt;
		if has_invoke then&lt;br /&gt;
			cats = cats .. &amp;quot; [[Category:Lua-based templates]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function&lt;br /&gt;
-- Creates an additional hatnote denoting which functions are invoked from which&lt;br /&gt;
-- modules, if a has more than one invoke.&lt;br /&gt;
local function make_invocation_hatnote(invokes)&lt;br /&gt;
	local hatnote = &amp;quot;&amp;quot;&lt;br /&gt;
	if #invokes == 0 then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		hatnote = &amp;quot;This template invokes the following functions:&amp;quot;&lt;br /&gt;
		local calls = {}&lt;br /&gt;
		for _, call in ipairs(invokes) do&lt;br /&gt;
			local module_link = iutils.make_module_link(call.module)&lt;br /&gt;
			table.insert(calls, string.format(&amp;quot;&#039;&#039;&#039;%s&#039;&#039;&#039; from %s&amp;quot;, call.func, module_link))&lt;br /&gt;
		end&lt;br /&gt;
		return string.format(&amp;quot;%s %s.&amp;quot;, hatnote, table.concat(calls, &amp;quot;, &amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle templates&lt;br /&gt;
function p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding module exists&lt;br /&gt;
	-- Then check whether this template invokes the module&lt;br /&gt;
	local has_module = iutils.page_exists(&amp;quot;Module:&amp;quot; .. corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse or metatemplate, this option is ignored.&lt;br /&gt;
	-- For any other option, it&#039;s not (although it also has no effect on&lt;br /&gt;
	-- noinvoke or library/metamodule).&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		has_module = has_module and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Check for whether the template invokes that module, regardless of whether&lt;br /&gt;
	-- it uses the corresponding module.&lt;br /&gt;
	local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
	local is_module_invoked = iutils.invocation_exists(invokes, corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on templates&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke and metamodule/library don&#039;t have use for templates.&lt;br /&gt;
	-- Does the template have a module?&lt;br /&gt;
	-- - dualuse and metatemplate: YES (REQUIRED!!)&lt;br /&gt;
	-- - noinvoke and metamodule/library: options don&#039;t apply to templates.&lt;br /&gt;
	-- RATIONALE FOR NOINVOKE NOT APPLYING: a template may invoke functions from&lt;br /&gt;
	-- more than one module, but one of them must be the &amp;quot;main&amp;quot; module. Since&lt;br /&gt;
	-- there&#039;s no way to autodetect that, that info must be manually entered.&lt;br /&gt;
	-- If that doesn&#039;t happen&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]]. See its module page for Lua-based template implementation.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by a module that is currently missing. [[Special:EditPage/Module:%s]]&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This metatemplate has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; or header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This template has a header option in the wrong namespace. It should be used within the Module namespace.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		if has_module and header ~= &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header ~= &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find all invocations for the template and add it as an addl hatnote.&lt;br /&gt;
	local invocation_hatnote = make_invocation_hatnote(invokes)&lt;br /&gt;
	&lt;br /&gt;
	-- Categorize&lt;br /&gt;
	local cats = categorize_template(pagename, #invokes &amp;gt; 0)&lt;br /&gt;
	&lt;br /&gt;
	if result == &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	elseif result == &amp;quot;&amp;quot; and invocation_hatnote ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, invocation_hatnote, cats)&lt;br /&gt;
	elseif result ~= &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;\n:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, invocation_hatnote, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Main function&lt;br /&gt;
function p._dochead(args)&lt;br /&gt;
	local namespace = args[&amp;quot;namespace&amp;quot;]&lt;br /&gt;
	local pagename  = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	local header    = args[&amp;quot;header&amp;quot;] or &amp;quot;none&amp;quot;&lt;br /&gt;
	local corr_template = args[&amp;quot;temp&amp;quot;] or pagename&lt;br /&gt;
	local corr_module   = args[&amp;quot;mod&amp;quot;]  or pagename&lt;br /&gt;
	local detect_corr_page = args[&amp;quot;detect_corr_page&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
	-- If header is none, skip everything&lt;br /&gt;
	if header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		return categorize(namespace, pagename)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Call appropriate hatnote-making function&lt;br /&gt;
	-- Remove /doc suffix if this is on a /doc page to ensure links are made&lt;br /&gt;
	-- properly. :gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if namespace == &amp;quot;Module&amp;quot; then&lt;br /&gt;
		result = p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	elseif namespace == &amp;quot;Template&amp;quot; then&lt;br /&gt;
		result = p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	else&lt;br /&gt;
		result = &amp;quot;:&#039;&#039;This documentation template is in the wrong namespace. It should be within the Template or Module namespaces.&#039;&#039;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper to be invoked&lt;br /&gt;
function p.dochead(frame)&lt;br /&gt;
	local args = getArgs(frame, { removeBlanks = true }) or {}&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Extract or parse args&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = args[&amp;quot;namespace&amp;quot;] or title.nsText&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = args[&amp;quot;pagename&amp;quot; ] or title.text&lt;br /&gt;
&lt;br /&gt;
	-- Extract header or set it to defaults&lt;br /&gt;
	if args[&amp;quot;header&amp;quot;] == nil or args[&amp;quot;header&amp;quot;] == &amp;quot;&amp;quot; then&lt;br /&gt;
		if args[&amp;quot;namespace&amp;quot;] == &amp;quot;Module&amp;quot; then&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;noinvoke&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Extract template/module names, or autogenerate them&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;temp&amp;quot;] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;mod&amp;quot; ] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	-- Option to detect corresponding page (default true)&lt;br /&gt;
	args[&amp;quot;detect_corr_page&amp;quot;] = args[&amp;quot;detect_corr_page&amp;quot;] == nil and true or yesno(args[&amp;quot;detect_corr_page&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tester()&lt;br /&gt;
	local args = {}&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = &amp;quot;Template&amp;quot;&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = &amp;quot;Module introspection&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Wikipedia/doc&amp;diff=215590</id>
		<title>Template:Wikipedia/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Wikipedia/doc&amp;diff=215590"/>
		<updated>2025-10-31T10:09:43Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead|mod=Variable arguments}}{{wikipedia}}{{templatestyles}}&lt;br /&gt;
: &#039;&#039;Not to be confused with [[Template:Wlink]].&#039;&#039;&lt;br /&gt;
The &#039;&#039;&#039;Wikipedia&#039;&#039;&#039; template shows a right-floating sister-project box with a link to a single English Wikipedia page. It was inspired by [[Wiktionary:Template:wikipedia|the corresponding template on the English Wiktionary]], which includes many more features that are not implemented in this simplified version of the template.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
The template should be placed at the beginning of the page it refers to, immediately after hatnotes if there are any. If there are also images, box templates such as this should appear first. Alternatively, consider linking to Wikipedia in the &amp;quot;External links&amp;quot; section; see [[Special: Interwiki]] for tips on adding such links.&lt;br /&gt;
&lt;br /&gt;
The template can also be placed at the beginning of a section. In that case, the title of the Wikipedia page must be explicitly given as a [[#Parameters|parameter]].{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
All parameters are optional. Pass in all pages &#039;&#039;in addition to the name of the page itself&#039;&#039; to link to as an arbitrary number of unnamed arguments.&lt;br /&gt;
&lt;br /&gt;
For example, placing this on the page [[Frequently asked questions]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Wikipedia|Frequently asked questions|page1|page2|page3}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will yield:&lt;br /&gt;
&lt;br /&gt;
{{Wikipedia|Frequently asked questions|page1|page2|page3}}{{clear}}&lt;br /&gt;
&lt;br /&gt;
If you do not wish to link the page with the current page&#039;s name, simply omit it. For example, placing &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{wikipedia|&#039;&#039;page1&#039;&#039;|&#039;&#039;page2&#039;&#039;|&#039;&#039;page3&#039;&#039;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; on [[Frequently asked questions]] will yield the same result as above, but without the link to [[Frequently asked questions]].&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[Template:Wlink]] – for formatting inline links to Wikipedia articles.&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Nowrap/doc&amp;diff=215589</id>
		<title>Template:Nowrap/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Nowrap/doc&amp;diff=215589"/>
		<updated>2025-10-31T10:09:32Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead|mod=Variable arguments}}{{Wikipedia}}&lt;br /&gt;
The &amp;lt;code&amp;gt;{&amp;lt;nowiki /&amp;gt;{nowrap}}&amp;lt;/code&amp;gt; template stops wrapping of specific text that may happen at spaces, dashes, or parentheses. It is to be used for sections such as units, dates, and mathematical equations that should always stay together.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
Pass in the text to be held together as a single unnamed parameter. Two or more unnamed parameters will result in individual chunks of non-wrapped text separated by a comma and space.&lt;br /&gt;
&lt;br /&gt;
Leading and trailing whitespaces in the input parameters will be trimmed. Interior whitespaces will not wrap, but the spaces separating the generated &amp;lt;code&amp;gt;&amp;lt;&amp;lt;nowiki /&amp;gt;span&amp;gt;&amp;lt;/code&amp;gt; elements are ordinary spaces and will wrap by default.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! You type&lt;br /&gt;
! Generated HTML&lt;br /&gt;
! Rendered output&lt;br /&gt;
|-&lt;br /&gt;
| {{{{ROOTPAGENAME}}|&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{nowrap|10 kg (22 lb)}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;10 kg (22 lb)&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| {{{{ROOTPAGENAME}}|10 kg (22 lb)}}&lt;br /&gt;
|-&lt;br /&gt;
| {{{{ROOTPAGENAME}}|&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{nowrap|1 Jan|2 Feb|3 Mar|4 Apr}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;}}&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;1 Jan&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;2 Feb&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;3 Mar&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;4 Apr&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| {{{{ROOTPAGENAME}}|1 Jan|2 Feb|3 Mar|4 Apr}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{escape notice}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Lua/doc&amp;diff=215588</id>
		<title>Template:Lua/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Lua/doc&amp;diff=215588"/>
		<updated>2025-10-31T10:09:17Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead|mod=Variable arguments}}{{Template rating|rating=deprecated|details=[[Template:Dochead]] and [[Template:Module introspection]] now fulfil the role of this template, which automatically finds and links to all dependencies.}}&lt;br /&gt;
{{clear}}{{wikipedia}}{{clear}}&lt;br /&gt;
&lt;br /&gt;
On templates with modules, this template provides a link from the template or its documentation to the corresponding module.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
Pass in the name of all modules used for a given template, separated by pipe characters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! You type !! You get&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{lua|Infobox ET}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; || {{{{ROOTPAGENAMEE}}|Infobox ET}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{lua|Infobox ET|Utils}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; || {{{{ROOTPAGENAMEE}}|Infobox ET|Utils}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If no argument is passed, there will be a single link to the module with the same name as the template.&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Breadcrumb/doc&amp;diff=215587</id>
		<title>Template:Breadcrumb/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Breadcrumb/doc&amp;diff=215587"/>
		<updated>2025-10-31T10:09:02Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{dochead|mod=Variable arguments}}{{templatestyles}}&lt;br /&gt;
The &#039;&#039;&#039;Breadcrumb&#039;&#039;&#039; template is used to manually insert a breadcrumb navigation bar at the top of a subpage in the main namespace. While MediaWiki has an [[mw:Help:Subpages|automated subpage feature]] that automatically inserts navigation breadcrumbs at the top of pages, this feature is normally disabled in the main (article) namespace since forward slashes in page titles may be misinterpreted as separators for subpages. On the Xenharmonic Wiki, forward slashes frequently appear in page titles, such as [[3/2]].&lt;br /&gt;
&lt;br /&gt;
All subpages in the article namespace are filed under [[:Category:Article subpages]].&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
For pages in the (article) namespace, pass in each level of the subpage as a separate unnamed parameter.&lt;br /&gt;
&lt;br /&gt;
For example, if a page titled &amp;lt;code&amp;gt;eiusmod tempor incididunt&amp;lt;/code&amp;gt; is located within a page titled &amp;lt;code&amp;gt;adipiscing elit sed do&amp;lt;/code&amp;gt;, which in turn is located in a page titled &amp;lt;code&amp;gt;dolor sit/amet/consectetur&amp;lt;/code&amp;gt;, which is located in a master page titled &amp;lt;code&amp;gt;Lorem ipsum&amp;lt;/code&amp;gt;, you would put, at the top of the page:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{breadcrumb|Lorem ipsum|dolor sit/amet/consectetur|adipiscing elit sed do|eiusmod tempor incididunt}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;display: inline-block; margin-bottom: 3em;&amp;quot;&amp;gt;which gives:&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{{{ROOTPAGENAMEE}}|Lorem ipsum|dolor sit/amet/consectetur|adipiscing elit sed do|eiusmod tempor incididunt}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Odd-limit_navigation/doc&amp;diff=215586</id>
		<title>Template:Odd-limit navigation/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Odd-limit_navigation/doc&amp;diff=215586"/>
		<updated>2025-10-31T10:03:11Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: Undo revision 215585 by Ganaram inukshuk (talk) testing worked; undo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dochead|mod=Prime limit navigation}}&lt;br /&gt;
This template generates a box and navigation bar to help navigating through [[odd limit]] pages.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
Use one unnamed argument for the odd limit. &lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
You type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Odd limit navigation|5}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You get&lt;br /&gt;
&lt;br /&gt;
{{{{ROOTPAGENAME}}|5}}{{clear}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Odd-limit_navigation/doc&amp;diff=215585</id>
		<title>Template:Odd-limit navigation/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Odd-limit_navigation/doc&amp;diff=215585"/>
		<updated>2025-10-31T10:02:46Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: testing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dochead|mod=Prime limit navigation|detect_corr_page=false}}&lt;br /&gt;
This template generates a box and navigation bar to help navigating through [[odd limit]] pages.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
Use one unnamed argument for the odd limit. &lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
You type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Odd limit navigation|5}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You get&lt;br /&gt;
&lt;br /&gt;
{{{{ROOTPAGENAME}}|5}}{{clear}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Template:Odd-limit_navigation/doc&amp;diff=215584</id>
		<title>Template:Odd-limit navigation/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Template:Odd-limit_navigation/doc&amp;diff=215584"/>
		<updated>2025-10-31T10:00:37Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dochead|mod=Prime limit navigation}}&lt;br /&gt;
This template generates a box and navigation bar to help navigating through [[odd limit]] pages.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
Use one unnamed argument for the odd limit. &lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
You type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Odd limit navigation|5}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You get&lt;br /&gt;
&lt;br /&gt;
{{{{ROOTPAGENAME}}|5}}{{clear}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215583</id>
		<title>Module:Dochead</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Dochead&amp;diff=215583"/>
		<updated>2025-10-31T09:58:41Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: bugfix removing /doc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]&lt;br /&gt;
local getArgs = require(&amp;quot;Module:Arguments&amp;quot;).getArgs&lt;br /&gt;
local iutils  = require(&amp;quot;Module:Introspection utils&amp;quot;)&lt;br /&gt;
local yesno   = require(&amp;quot;Module:Yesno&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- TODO: Change requirements for lua-based template&lt;br /&gt;
-- FROM: detect whether a corresponding page exists&lt;br /&gt;
-- TO: detect whether it invokes ANYTHING at all&lt;br /&gt;
&lt;br /&gt;
-- Produces a hatnote that is placed on the top of a documentation page (either&lt;br /&gt;
-- template or module documentation) and can autodetect and categorize:&lt;br /&gt;
-- - FOR MODULES:&lt;br /&gt;
--   - whether a module has an accompanying template (overridable/toggleable)&lt;br /&gt;
--   - whether a module is meant as a library for other modules&lt;br /&gt;
-- - FOR TEMPLATES:&lt;br /&gt;
--   - whether a template has an accompanying module (overridable/toggleable)&lt;br /&gt;
--   - what functions from which modules are invoked&lt;br /&gt;
&lt;br /&gt;
-- Helper function&lt;br /&gt;
-- Categorizes pages if they&#039;re in the right namespace, and based on the nature&lt;br /&gt;
-- of the page&lt;br /&gt;
local function categorize(namespace, pagename, is_lua_based_template)&lt;br /&gt;
	local is_lua_based_template = is_lua_based_template or false&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		-- Documentation subpages&lt;br /&gt;
		if namespace == &amp;quot;Template&amp;quot; then&lt;br /&gt;
			cats = &amp;quot;[[Category:Template documentation]]&amp;quot;&lt;br /&gt;
		elseif namespace == &amp;quot;Module&amp;quot; then&lt;br /&gt;
			cats = &amp;quot;[[Category:Module documentation]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- Main pages&lt;br /&gt;
		if namespace == &amp;quot;Template&amp;quot; then&lt;br /&gt;
			cats = &amp;quot;[[Category:Templates]]&amp;quot;&lt;br /&gt;
			if is_lua_based_template then&lt;br /&gt;
				cats = cats .. &amp;quot; [[Category:Lua-based templates]]&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
		elseif namespace == &amp;quot;Module&amp;quot; then&lt;br /&gt;
			cats = &amp;quot;[[Category:Lua modules]]&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			--cats = &amp;quot;[[Category:Templates in the incorrect namespace]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize modules&lt;br /&gt;
local function categorize_module(pagename)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Module documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Lua modules]]&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle modules&lt;br /&gt;
function p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding template exists&lt;br /&gt;
	-- Then check whether that template invokes the module&lt;br /&gt;
	local has_template = iutils.page_exists(&amp;quot;Template:&amp;quot; .. corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse, metatemplate, or noinvoke, this option&lt;br /&gt;
	-- is ignored. For any other option, it&#039;s not.&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; and header ~= &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		has_template = has_template and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- If the module has a template, check for whether it invokes it.&lt;br /&gt;
	if has_template then&lt;br /&gt;
		local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
		has_template = has_template and iutils.invocation_exists(invokes, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on module&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke indicates a lua-based template, but the module&#039;s code is so&lt;br /&gt;
	--   specialized that its code should not be used by other modules or&lt;br /&gt;
	--   invoked by other templates.&lt;br /&gt;
	-- - metamodule and library indicate a module whose code is used mainly for&lt;br /&gt;
	--   other modules. Such modules generally don&#039;t have a corresponding&lt;br /&gt;
	--   template.&lt;br /&gt;
	-- Does the module have a template?&lt;br /&gt;
	-- - dualuse, metatemplate, and noinvoke: YES (REQUIRED!!)&lt;br /&gt;
	-- - metamodule/library: GENERALLY NO&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module has a corresopnding template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a metatemplate, and may be invoked by templates using its corresponding template [[Template:%s]], or used directly from other modules.&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This module is used to create other Lua-based templates and has no corresponding template.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; then&lt;br /&gt;
		if has_template then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module should not be invoked directly; use its corresponding instead: [[Template:%s]].&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This module implements a template that is currently missing or does not use this module. ([[Special:EditPage/Template:%s|edit template]])&amp;quot;,&lt;br /&gt;
				corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This module primarily serves as a library for other modules and has no corresponding template.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		if has_template and header ~= &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;%s This module implements [[Template:%s]].&amp;quot;, header, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		elseif has_template and header == &amp;quot;&amp;quot; then&lt;br /&gt;
			result = string.format(&amp;quot;This module implements [[Template:%s]].&amp;quot;, corr_template:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Produce categories&lt;br /&gt;
	local cats = categorize_module(pagename)&lt;br /&gt;
	&lt;br /&gt;
	-- Return&lt;br /&gt;
	if result == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot; .. cats&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function: categorize template&lt;br /&gt;
local function categorize_template(pagename, has_invoke)&lt;br /&gt;
	local cats = &amp;quot;&amp;quot;&lt;br /&gt;
	if pagename:match(&amp;quot;/doc$&amp;quot;) then&lt;br /&gt;
		cats = &amp;quot;[[Category:Template documentation]]&amp;quot;&lt;br /&gt;
	else	&lt;br /&gt;
		cats = &amp;quot;[[Category:Templates]]&amp;quot;&lt;br /&gt;
		if has_invoke then&lt;br /&gt;
			cats = cats .. &amp;quot; [[Category:Lua-based templates]]&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return cats&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function&lt;br /&gt;
-- Creates an additional hatnote denoting which functions are invoked from which&lt;br /&gt;
-- modules, if a has more than one invoke.&lt;br /&gt;
local function make_invocation_hatnote(invokes)&lt;br /&gt;
	local hatnote = &amp;quot;&amp;quot;&lt;br /&gt;
	if #invokes == 0 then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		hatnote = &amp;quot;This template invokes the following functions:&amp;quot;&lt;br /&gt;
		local calls = {}&lt;br /&gt;
		for _, call in ipairs(invokes) do&lt;br /&gt;
			local module_link = iutils.make_module_link(call.module)&lt;br /&gt;
			table.insert(calls, string.format(&amp;quot;&#039;&#039;&#039;%s&#039;&#039;&#039; from %s&amp;quot;, call.func, module_link))&lt;br /&gt;
		end&lt;br /&gt;
		return string.format(&amp;quot;%s %s.&amp;quot;, hatnote, table.concat(calls, &amp;quot;, &amp;quot;))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle templates&lt;br /&gt;
function p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	-- Check whether corresponding module exists&lt;br /&gt;
	-- Then check whether this template invokes the module&lt;br /&gt;
	local has_module = iutils.page_exists(&amp;quot;Module:&amp;quot; .. corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Check whether to use detect_corr_page option&lt;br /&gt;
	-- If the header option is dualuse or metatemplate, this option is ignored.&lt;br /&gt;
	-- For any other option, it&#039;s not (although it also has no effect on&lt;br /&gt;
	-- noinvoke or library/metamodule).&lt;br /&gt;
	if header ~= &amp;quot;dualuse&amp;quot; and header ~= &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		has_module = has_module and detect_corr_page&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Check for whether the template invokes that module, regardless of whether&lt;br /&gt;
	-- it uses the corresponding module.&lt;br /&gt;
	local wikitext = iutils.get_and_preprocess_content(&amp;quot;Template&amp;quot;, pagename:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	local invokes = iutils.find_invokes(wikitext)&lt;br /&gt;
	local is_module_invoked = iutils.invocation_exists(invokes, corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;))&lt;br /&gt;
	&lt;br /&gt;
	-- Heading meanings and usage on templates&lt;br /&gt;
	-- - dualuse means a template is implement by a module, but its template may&lt;br /&gt;
	--   be bypassed by using its module directly from other modules.&lt;br /&gt;
	-- - metatemplate is a special case of dualuse; the template-module pair is&lt;br /&gt;
	--   for a metatemplate, a template used to build other templates.&lt;br /&gt;
	-- - noinvoke and metamodule/library don&#039;t have use for templates.&lt;br /&gt;
	-- Does the template have a module?&lt;br /&gt;
	-- - dualuse and metatemplate: YES (REQUIRED!!)&lt;br /&gt;
	-- - noinvoke and metamodule/library: options don&#039;t apply to templates.&lt;br /&gt;
	-- RATIONALE FOR NOINVOKE NOT APPLYING: a template may invoke functions from&lt;br /&gt;
	-- more than one module, but one of them must be the &amp;quot;main&amp;quot; module. Since&lt;br /&gt;
	-- there&#039;s no way to autodetect that, that info must be manually entered.&lt;br /&gt;
	-- If that doesn&#039;t happen&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if header == &amp;quot;dualuse&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]]. See its module page for Lua-based template implementation.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by a module that is currently missing. [[Special:EditPage/Module:%s]]&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;metatemplate&amp;quot; then&lt;br /&gt;
		if has_module and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This metatemplate has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = &amp;quot;This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif header == &amp;quot;noinvoke&amp;quot; or header == &amp;quot;library&amp;quot; or header == &amp;quot;metamodule&amp;quot; then&lt;br /&gt;
		result = &amp;quot;This template has a header option in the wrong namespace. It should be used within the Module namespace.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		if has_module and header ~= &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header ~= &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;%s. This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				header,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template is implemented by the Lua module [[Module:%s]].&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		elseif has_module and header == &amp;quot;&amp;quot; and not is_module_invoked then&lt;br /&gt;
			result = string.format(&lt;br /&gt;
				&amp;quot;This template has a corresponding Lua module [[Module:%s]], but does not invoke its functions.&amp;quot;,&lt;br /&gt;
				corr_module:gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			result = header&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find all invocations for the template and add it as an addl hatnote.&lt;br /&gt;
	local invocation_hatnote = make_invocation_hatnote(invokes)&lt;br /&gt;
	&lt;br /&gt;
	-- Categorize&lt;br /&gt;
	local cats = categorize_template(pagename, #invokes &amp;gt; 0)&lt;br /&gt;
	&lt;br /&gt;
	if result == &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	elseif result == &amp;quot;&amp;quot; and invocation_hatnote ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, invocation_hatnote, cats)&lt;br /&gt;
	elseif result ~= &amp;quot;&amp;quot; and invocation_hatnote == &amp;quot;&amp;quot; then&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, cats)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;quot;:&#039;&#039;%s&#039;&#039;\n:&#039;&#039;%s&#039;&#039;%s\n&amp;quot;, result, invocation_hatnote, cats)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Main function&lt;br /&gt;
function p._dochead(args)&lt;br /&gt;
	local namespace = args[&amp;quot;namespace&amp;quot;]&lt;br /&gt;
	local pagename  = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	local header    = args[&amp;quot;header&amp;quot;] or &amp;quot;none&amp;quot;&lt;br /&gt;
	local corr_template = args[&amp;quot;temp&amp;quot;] or pagename&lt;br /&gt;
	local corr_module   = args[&amp;quot;mod&amp;quot;]  or pagename&lt;br /&gt;
	local detect_corr_page = args[&amp;quot;detect_corr_page&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
	-- If header is none, skip everything&lt;br /&gt;
	if header == &amp;quot;none&amp;quot; then&lt;br /&gt;
		return categorize(namespace, pagename)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Call appropriate hatnote-making function&lt;br /&gt;
	-- Remove /doc suffix if this is on a /doc page to ensure links are made&lt;br /&gt;
	-- properly. :gsub(&amp;quot;/doc$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	local result = &amp;quot;&amp;quot;&lt;br /&gt;
	if namespace == &amp;quot;Module&amp;quot; then&lt;br /&gt;
		result = p.make_module_hatnote(header, pagename, corr_template, detect_corr_page)&lt;br /&gt;
	elseif namespace == &amp;quot;Template&amp;quot; then&lt;br /&gt;
		result = p.make_template_hatnote(header, pagename, corr_module, detect_corr_page)&lt;br /&gt;
	else&lt;br /&gt;
		result = &amp;quot;:&#039;&#039;This documentation template is in the wrong namespace. It should be within the Template or Module namespaces.&#039;&#039;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper to be invoked&lt;br /&gt;
function p.dochead(frame)&lt;br /&gt;
	local args = getArgs(frame, { removeBlanks = true }) or {}&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Extract or parse args&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = args[&amp;quot;namespace&amp;quot;] or title.nsText&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = args[&amp;quot;pagename&amp;quot; ] or title.text&lt;br /&gt;
&lt;br /&gt;
	-- Extract header or set it to defaults&lt;br /&gt;
	if args[&amp;quot;header&amp;quot;] == nil or args[&amp;quot;header&amp;quot;] == &amp;quot;&amp;quot; then&lt;br /&gt;
		if args[&amp;quot;namespace&amp;quot;] == &amp;quot;Module&amp;quot; then&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;noinvoke&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Extract template/module names, or autogenerate them&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;temp&amp;quot;] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;mod&amp;quot; ] or args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	-- Option to detect corresponding page (default true)&lt;br /&gt;
	args[&amp;quot;detect_corr_page&amp;quot;] = args[&amp;quot;detect_corr_page&amp;quot;] == nil and true or yesno(args[&amp;quot;detect_corr_page&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tester()&lt;br /&gt;
	local args = {}&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;namespace&amp;quot;] = &amp;quot;Template&amp;quot;&lt;br /&gt;
	args[&amp;quot;pagename&amp;quot; ] = &amp;quot;Module introspection&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;temp&amp;quot;] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	args[&amp;quot;mod&amp;quot; ] = args[&amp;quot;pagename&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	args[&amp;quot;header&amp;quot;] = &amp;quot;&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	return p._dochead(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
	<entry>
		<id>https://en.xen.wiki/index.php?title=Module:Variable_arguments/doc&amp;diff=215582</id>
		<title>Module:Variable arguments/doc</title>
		<link rel="alternate" type="text/html" href="https://en.xen.wiki/index.php?title=Module:Variable_arguments/doc&amp;diff=215582"/>
		<updated>2025-10-31T09:52:11Z</updated>

		<summary type="html">&lt;p&gt;Ganaram inukshuk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{documentation|{{dochead|header=This module should not be invoked directly; use its corresponding templates instead.|detect_corr_page=false}}&lt;br /&gt;
This module is used to store functions for templates that take a variable number of arguments but do not use [[:Module:Labelled list hatnote]]:&lt;br /&gt;
* [[Template:Breadcrumb]]&lt;br /&gt;
* [[Template:Lua]]&lt;br /&gt;
* [[Template:Nowrap]]&lt;br /&gt;
* [[Template:Wikipedia]]&lt;br /&gt;
{{clear}}&lt;br /&gt;
{{module introspection}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Ganaram inukshuk</name></author>
	</entry>
</feed>