Module:Factory slot/doc
This is the documentation page for Module:Factory slot
Draws one slot of a Factory grid: an item icon with its stack count. Module:UI uses it for the crafting grids of {{Crafting}}, and Module:Recipe table uses its stack parser. Inspired by and partially based on Minecraft Wiki's Module:Inventory slot.
The look is in Template:Crafting/styles.css (TemplateStyles). main adds that stylesheet; when a module calls slot, the module adds it, as Module:UI does.
Item stacks
A stack is written Name or Name,count. A tier at the end, Circuit Plate T3 or Circuit Plate [T3], gives the name Circuit Plate [T3] and the icon File:Circuit Plate T3.png, shown at 32×32 pixels and pixelated. Counts above 1 show in the corner of the slot: in full below a million, then as 1.5E6 (the E with the brand kit class .tpt-num__e), and as ∞ from 1E18 or when written ∞. The slot count always uses this notation; it doesn't follow the reader's number format.
Counts can be written in full or in E notation, with either case: Plate,1500000, Plate,1.5e6 and Plate,1.5E6 are the same stack.
Functions
slot(args): the slot as anmw.htmlspan.args[1]is a stack string or table; without it the slot is empty.linkis the page the icon and count link to (no link when empty orno).classandstylego on the slot,itemClassanditemStyleon the item,numStyleon the count.main(frame): the same for {{Factory slot}}, which no page uses at the moment.parseStack(text)andstringifyStack(stack): convert between stack strings and{ name, count }tables.formatCount(count): the count text, ornilfor counts below 2.