Difference between revisions of "Template:Clade labels/doc"

From Summertime Saga Wiki
Jump to: navigation, search
m (Parameters)
m
Line 1: Line 1:
{{tlg|clade labels}} is a utility template for labeling cladograms made with the {{tl|clade}} template. In particular, it is for use with {{para|grouplabelN}} and adding multiple labels with defined positions.
+
{{tlg|clade labels}} is a utility template for labeling cladograms made with the {{tl|clade}} template. In particular, it is for use with {{para|grouplabel{{var|n}}}} and adding multiple labels with defined positions.
  
 
=== Parameters ===
 
=== Parameters ===
Line 6: Line 6:
 
; {{para|label{{var|n}}}} : The text to place in the label {{var|n}}.
 
; {{para|label{{var|n}}}} : The text to place in the label {{var|n}}.
 
; {{para|top{{var|n}}}} : The position of the label from the top of the table cell containing the group label. It is recommended that the value be given in %, e.g. 50% to center the label. This is the CSS property so the values can also be given in other units.
 
; {{para|top{{var|n}}}} : The position of the label from the top of the table cell containing the group label. It is recommended that the value be given in %, e.g. 50% to center the label. This is the CSS property so the values can also be given in other units.
; {{para|bottom{{var|n}}}}, {{para|left{{var|n}}}}, {{para|leaf{{var|n}}}} : Similar to {{para|top{{var|n}}}} these parameters position the bottom, left and right of the label. The behaviour is counter‐intuitive. Because {{para|left{{var|n}}}} shifts the left edge of the label, the result is a shift to the right.
+
; {{para|bottom{{var|n}}}}, {{para|left{{var|n}}}}, {{para|leaf{{var|n}}}} : Similar to {{para|top{{var|n}}}} these parameters position the bottom, left, and right of the label. The behaviour is counter‐intuitive. Because {{para|left{{var|n}}}} shifts the left edge of the label, the result is a shift to the right.
 
; {{para|style{{var|n}}}} : Add CSS styleing specific to the numbered label.
 
; {{para|style{{var|n}}}} : Add CSS styleing specific to the numbered label.
 
; {{para|color{{var|n}}}} : Changes the color of text in the label.
 
; {{para|color{{var|n}}}} : Changes the color of text in the label.
Line 31: Line 31:
 
|bar2=red
 
|bar2=red
 
|2= {{clade
 
|2= {{clade
|1=Leaf 3   
+
|1=Leaf 3 
|2=Leaf 4  
+
|2=Leaf 4
 
}}
 
}}
 
}}
 
}}
Line 39: Line 39:
 
             |label1=stem group|top1=20%|color1=green
 
             |label1=stem group|top1=20%|color1=green
 
             |label2=crown group|top2=70%|color2=red
 
             |label2=crown group|top2=70%|color2=red
             }}
+
             }}
 
}}</pre>
 
}}</pre>
 
| style="vertical-align:middle;" | {{clade
 
| style="vertical-align:middle;" | {{clade
Line 49: Line 49:
 
|bar2=red
 
|bar2=red
 
|2= {{clade
 
|2= {{clade
|1=Leaf 3&nbsp;  
+
|1=Leaf 3&nbsp;
|2=Leaf 4  
+
|2=Leaf 4
 
}}
 
}}
 
}}
 
}}
Line 57: Line 57:
 
|label1=stem group|top1=20%|color1=green
 
|label1=stem group|top1=20%|color1=green
 
|label2=crown group|top2=70%|color2=red
 
|label2=crown group|top2=70%|color2=red
}}
+
}}
 
}}
 
}}
 
|}
 
|}
  
 
[[Category:Templates]][[Category:Templates documentation]]
 
[[Category:Templates]][[Category:Templates documentation]]

Revision as of 17:04, 24 August 2020

{{clade labels}} is a utility template for labeling cladograms made with the Template:Tl template. In particular, it is for use with |grouplabeln= and adding multiple labels with defined positions.

Parameters

The following parameters apply to each label:

|labeln= 
The text to place in the label n.
|topn= 
The position of the label from the top of the table cell containing the group label. It is recommended that the value be given in %, e.g. 50% to center the label. This is the CSS property so the values can also be given in other units.
|bottomn=, |leftn=, |leafn= 
Similar to |topn= these parameters position the bottom, left, and right of the label. The behaviour is counter‐intuitive. Because |leftn= shifts the left edge of the label, the result is a shift to the right.
|stylen= 
Add CSS styleing specific to the numbered label.
|colorn= 
Changes the color of text in the label.

The following parameters apply to all the labels in the group:

|width= 
Fixes the width of the element containing the group of labels. This is useful because the positioning uses absolute CSS positions so they don't automatically change the size of the parenet element. As a result the labels can appear outside the parent element.
|style= 
Applies a common CCS style to all the labels.
|left= 
Shifts all the labels to the right.
|top=,|bottom=, |right= 
Similar to |left= these shift the positions of all the labels.
|color= 
Changes the color of text in all the labels.

Example

Markup Renders as
{{clade
|label1=root
|1=	{{clade
	|1=Leaf 1|bar1=green
	|2=	{{clade
		|1=Leaf 2 |bar1=green
		|bar2=red
		|2=	{{clade
			|1=Leaf 3 
			|2=Leaf 4
			}}
		}}
	}}
|grouplabel1={{clade labels|width=10em;
             |label1=stem group|top1=20%|color1=green
             |label2=crown group|top2=70%|color2=red
             }}
}}
root

Leaf 1  




Leaf 2   




Leaf 3 



Leaf 4


  


stem group
crown group