Module:Sandbox/User:Simanelix/Cross table/doc

Jump to navigation Jump to search
This is the documentation page. It is transcluded into Module:Sandbox/User:Simanelix/Cross table. See Template:Documentation for more information.

Usage[edit source]

This module is an advanced method of creating a table with repetitive data. You should only use this in special circumstances.

Example[edit source]

{{User:Simanelix/Sandbox/Cross table
|caption = Where each music track plays
|name = Track
|C B  = {{BiomeLink|Badlands|text=B}}
|C CG = {{BiomeLink|Cherry Grove|text=CG}}
|C DC = {{BiomeLink|Dripstone Caves|text=DC}}
|C DD = {{BiomeLink|Deep Dark|text=DD}}
|C FF = {{BiomeLink|Flower Forest|text=FF}}
|C G  = {{BiomeLink|Grove|text=G}}
|C JP = {{BiomeLink|Jagged Peaks|text=JP}}
|C LC = {{BiomeLink|Lush Caves|text=LC}}
|C SP = {{BiomeLink|Stony Peaks|text=SP}}
|C SS = {{BiomeLink|Snowy Slopes|text=SS}}
|C Eob = Every other biome
|C Ms  = [[Menu screen]]s
|
"Deeper"      ~ DC; DD; FF
|
"Featherfall" ~ (\~yes\~) B ; CG; LC
|
"Eld Unknown" ;
"Endless"     ;
"pokopoko"    ~ DC; G ; JP
|
"Eld Unknown" ~ SP
|
"pokopoko"    ~ SS ~ (R {{tc|yes|Yes&#x200B\;{{only|je|short=1}}}}) "Endless"
|
"Featherfall" ;
"komorebi"    ;
"Puzzlebox"   ;
"Watcher"     ;
"yakusoku"    ~ Eob
|
"Deeper"      ;
"Featherfall" ;
"Eld Unknown" ;
"Endless"     ;
"pokopoko"    ;
"komorebi"    ;
"Puzzlebox"   ;
"Watcher"     ;
"yakusoku"    ~ Ms
}}
NameDCDDFFBCGLCGJPSPSSEvery other biomeMenu screens
"Deeper"YesYesYesNoNoNoNoNoNoNoNoYes
"Featherfall"NoNoNo~yes~~yes~~yes~NoNoNoNoYesYes
"Eld Unknown"YesNoNoNoNoNoYesYesYesNoNoYes
"Endless"YesNoNoNoNoNoYesYesNoYes​‌[JE only]NoYes
"pokopoko"YesNoNoNoNoNoYesYesNoYesNoYes
"komorebi"NoNoNoNoNoNoNoNoNoNoYesYes
"Puzzlebox"NoNoNoNoNoNoNoNoNoNoYesYes
"Watcher"NoNoNoNoNoNoNoNoNoNoYesYes
"yakusoku"NoNoNoNoNoNoNoNoNoNoYesYes

Parameters[edit source]

Every parameter is optional, but you will probably need to use the name or caption parameters if you want your table to make any sense.

Un-named parameters

The un-named parameter are assignment chains. Each tilde (~) does 3 things at once:

  • assigns all of the items to its left as row names
  • assigns all of the items to its right as column names
  • assosciates each of the items on the left with each of the items on the right
    • assosciated items will default to a {{tc}}-value of yes where their column and row intersect

In essence, tilder places a tc-value in the rows and columns named on its left and right. Row names and column names can be separated using ;.

  • A ; B ~ C ; D places tc-values in the cells where the columns A and B intersect with the columns C and D. This ends up placing 4 tc-values.
  • A ; B; C ~ D; E; F places tc-values in the cells where the columns A, B, and C intersect with the columns D, E, and F. This ends up placing 9 tc-values.

Additionally, a modifier can be placed after a tilde. The format of a modifier is: (<Flag> <Table content>).

  • <Flag> can be either:
    • L
    • R
    • B
  • <Table content> can be any text that does not contain parenthesis.
    • This is used as the content for all of the cells where the rows and columns of the tidle intersect.

The L does nothing except declare that the rest of the modifier is the <Table content>.

The R reverses the directionality of the tilde. So, items to the left of the tilde are assigned as columns, and items to the right of the tilde are assigned as rows.

The B makes the tilde assign columns and rows in both directions. So, items to the left of the tilde are assigned as columns and rows, and items to the right are assigned as columns and rows too.

One modifier cannot contain multiple flags, because there is no reason you would use multiple flags.

Each un-named parameter can contain a sequence of values with tilder between. Each tilder will assign columns and rows independently. So, | A ~ B ~ C ~ D is effectively a shorthand for | A ~ B | B ~ C | C ~ D.

Tilde modifiers also work independently. So, modifiers on any one tilde are not applied to any other tilde. Therefore, | A ~ B ~(R) C ~ D ~(R) E is effectively a shorthand for | A ~ B | C ~ B | C ~ D | E ~ D.

Named parameters

name is the content of the top-left cell of the table (but for some reason it doesn't work).

caption is the content of the table's caption.

sign is the symbol for the tildes in the un-named parameters. You can use this to rename tilde to whatever you want, but be careful. This "symbol" is used in Lua patterns in the module's code, and if you put anything weird in there, you might have to escape it with %.

sep is the symbol used to separate the row and column names in the un-named parameters. i.e. this symbol replaces ;. You can use this to rename tilde to whatever you want, but be careful. This "symbol" is used in Lua patterns in the module.

tc_sep is the symbol for separating the content of a table cell from the HTML attribute list for table cell's HTML element. You can use this to rename pipe to whatever you want, but be careful. This "symbol" is also used in Lua patterns in the module.

Column-name parameters

Any named parameter starting with C <space> (<space> means 1 or more required spaces) is interpreted as a column-name. Everything after C <space> (in the parameter's name) is defined as a shorthand for the column. The value of the parameter is the header of the column, which will be printed in the final table (if the column is ever assigned). Any tilde that uses the column's shorthand will place content in that column.

There are no row-name parameters, but maybe I will add those in the future.