Difference between revisions of "WIP/Tabs"

From LinnDocs
Jump to: navigation, search
m
m
Line 30: Line 30:
 
* <nowiki>[[Envelopes]]</nowiki>
 
* <nowiki>[[Envelopes]]</nowiki>
 
</tab> text?
 
</tab> text?
 +
 +
 +
These are the {{#tab:| <categorytree mode="all" >Airplay 2</categorytree><tab />}} products
 +
 +
 +
These are the {{#tab:| 1|2|3}} products
 +
 +
<tabs>
 +
<tab name="Default 1" style="background:lightgreen;">First tab.</tab>
 +
<tab name="Default 2" style="background:lightgreen;">Second tab.</tab>
 +
<tab name="Inline" style="background:salmon;">Third tab.</tab>
 +
<tab name="Block" style="background:royalblue;">Fourth tab.</tab>
 +
<tab index="1">This is a seperate tab. It demonstrates what happens if a tab has no inline or block attributes defined. If the tab contains a lot of text, it will automatically be forced to a new line, despite extra space being available at the end of the previous line.</tab>
 +
<tab index="2">This seperate tab isn't forced to a new line, since it's short enough.</tab>
 +
<tab index="3" inline>This is a seperate tab that has an inline attribute defined. It will fit in with the text as normal text would, and it fills up any space that is left available after the previous line. This makes tabs with inline attributes a bit better at fitting in with the flow of text.</tab>
 +
<tab index="4" block>Despite fitting on the previous line, the block attribute forces this seperate tab to a new line</tab>
 +
</tabs>
 +
 +
{|class="wikitable" !style="width: 50%"|Code !style="width: 50%"|Description |- |{{#tab:name1/#1, name2/#2, etc|content 1|content 2|etc}} |Each of the defined names will be set as name or index attributes, respectively. *All values that are prefixed with #, and are numbers only will be recognised as indices. For indices, surrounding whitespace is allowed, but internal whitespace or any non-number characters such as decimal points aren't. *If these condtions are not met, the entered value is interpreted as a name. *If the entered value contains only whitespace or is left empty, the index of that tab is automatically calculated. |- |{{#tab:|content 1|content 2|etc}} |No indices or names are defined here, so the indices of the tabs within the parser functions are automatically assigned as index. |- |{{#tab:name1/#1, , name3/#3, name4/#4|content 1|content 2| |content 4}} |The second tab will automatically get index="2", and the third tab will have no content: *If the third tab has a name defined in the list of names, then it becomes a [[#Self-closing tabs|self-closing tag]]. *If the third tab has an index defined, this tab is skipped, and no output is generated for this tab. |- |{{#tab:name1, name2, name3...}} |This will define three tabs, "name1", "name2" and "name3" using the [[#Self-closing tabs|self-closing syntax]]. |- |{{#tab:#3, #5|content 3|content 5}} |This will add "content 3" to the rest of the contents of tab 3, and "content 5" to the rest of the content of tab 5. |- |{{#tab:name1/#1, etc|content 1|$1}} |When the content of a tab is $n (where n is the place of the tab in the parser function), the contents of that tab are copied over to the tab that has $n in it. For this to work, the following conditions must be met: *The tab must contain nothing other than a dollar sign and a number directly after it. Surrounding whitespace is allowed. *The parser function's nth parameter must be defined. n may also be bigger than the current tab index (so, {{#tab:#3,#5|$2|Hi}} would put "Hi" in both tab 3 and 5). *The parser function's nth parameter must contain something other than just whitespace. Recursive references won't work, so {{#tab:|Hi|$1|$2}} will put "Hi" in tabs 1 and 2, and the literal text "$1" in tab 3. |- |{{#tab:|3=content 3| 5 = content 5}} |You can also refer to the tab '''index''' (so not the tab name) by putting the tab index before an equals sign (=) in the parameter. This will not work for tab names, to prevent unwanted effects caused by equals signs inside the tab (which then would cause all of the preceding text to be interpreted as a tab name). This syntax will override an index or name specified using the syntax of the above code examples. |}

Revision as of 08:06, 4 August 2023

A

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

b


Can this be between

Stationery

text?


Can this be between

text?


These are the

products


These are the

1
2
3

products

First tab.
Second tab.
Third tab.
Fourth tab.
This is a seperate tab. It demonstrates what happens if a tab has no inline or block attributes defined. If the tab contains a lot of text, it will automatically be forced to a new line, despite extra space being available at the end of the previous line.
This seperate tab isn't forced to a new line, since it's short enough.
This is a seperate tab that has an inline attribute defined. It will fit in with the text as normal text would, and it fills up any space that is left available after the previous line. This makes tabs with inline attributes a bit better at fitting in with the flow of text.
Despite fitting on the previous line, the block attribute forces this seperate tab to a new line