yoohoo! hot sauce please
10:27, 7 September 2026 (UTC)
Editing
Module:Infobox categorizer/doc
(section)
From 2swagg wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== reading infobox values == {{Tip|You need to have some experience with [[Lua]] to be able to understand anything below this section, or if you want to make a submodule.}} {| class="wikitable" ! function ! result |- | <code>trim(value)</code> | Converts a value to trimmed text. <code>nil</code> becomes an empty string. |-well | <code>normalize(value, mode)</code> | Lowercases text. Default or <code>compact</code> removes nonword characters. <code>spaced</code> replaces runs of them with spaces, if you need that. |- |<code>clean(value)</code> | Returns text for matching. It will remove references, hidden markers, comments, and tags. It substitutes displayed wikilink text and external link labels removes bare HTTP(S) urls and decodes entities. It is an analysis aid only. |- | <code>findYears(value)</code> | finds distinct{{Note|Read more on Lua frontier patterns to understand what this means exactly.}} four-digit years in the cleaned text, in encounter order. |- | <code>findYearRanges(value)</code> | if the parameter you want to read recommends years be entered as YYYY - YYYY, use this function. It will find all distinct pairs, returning, for example, <code><nowiki>{{'2020', '2022'}, ...}</nowiki></code> . It does not expand or interpret ranges. -, em dash, whatever dash, all are supported. |- | <code>findLinkTargets(value, opts)</code> | Returns distinct wikilink targets as prefixed page titles, ignoring display labels, refs, and fragments. Defaults to namespace <code>0</code>, <code>opts.namespaces</code> changes the allowed list. '''It does not resolve redirects'''{{Note|Avoid redirects with this thing like the plague, avoid redirects in general}} |- | <code>[[Module:CatMark|readDataAttr]](value, name)</code> | Reads all <code>data-cat-''name''</code> attribute values produced by [[Module:CatMark]]. Returns a list of decoded strings. The name argument may only contain letters, digits, and hyphens. Read CatMark to learn more about using it. |- | <code>parseNumber(value)</code> | Parses a [[autism|signed decimal number]] after removing commas and whitespace. Returns <code>nil</code> if invalid. |- | <code>pickBand(number, bands)</code> | Finds the eligible "band" with the greatest <code>min</code> and returns its <code>name</code>. Returns <code>nil</code> if none qualifies. |} For <code>pickBand</code>, keep in mind that bands are records such as <code>{min=100, name = '100 SoyBooru posts'}</code>. In other words, the subject module decides which number to read and whether a band category applies.
Summary:
Please note that all contributions to 2swagg wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
2swagg wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Module
Discussion
Read
Edit source
History
Page actions
Module
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
janny
Noticeboard
Tools
What links here
Related changes
Special pages
Page information