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

From blackwiki
Jump to navigation Jump to search
imported>Jts1882
(add example)
imported>Jts1882
(add comparison to simple label (this won't display correctly until module updated) →‎Example)
Line 12: Line 12:
 
==Example==
 
==Example==
  
<pre>{{clade |style=float:right;
+
{{clade example |description=|code=|output=
 +
|description1=Simple long {{para|sublabel}}
 +
|code1=<pre>{{clade
 +
|label1=root
 +
|1={{clade
 +
  |1=Leaf 1
 +
  |2={{clade
 +
      |1=Leaf 2&nbsp;
 +
      |sublabel2={{clade label|long label that stretches the cladogram}}
 +
      |2={{clade
 +
        |1=Leaf 3&nbsp;
 +
        |2=Leaf 4
 +
        }}
 +
      }}
 +
  }}
 +
}}</pre>
 +
|output1={{clade
 +
|label1=root
 +
|1={{clade
 +
  |1=Leaf 1
 +
  |2={{clade
 +
      |1=Leaf 2&nbsp;
 +
      |sublabel2={{clade label|long label that stretches the cladogram}}
 +
      |2={{clade
 +
        |1=Leaf 3&nbsp;
 +
        |2=Leaf 4
 +
        }}
 +
      }}
 +
  }}
 +
}}
 +
|description2=Use of {{tl|clade label}}
 +
|code2=<pre>{{clade |style=float:right;
 
|label1=root
 
|label1=root
 
|1={{clade
 
|1={{clade
Line 26: Line 57:
 
   }}
 
   }}
 
}}</pre>
 
}}</pre>
 +
|output2=
 
{{clade |style=float:right;
 
{{clade |style=float:right;
 
|label1=root
 
|label1=root
Line 42: Line 74:
 
}}
 
}}
  
 
+
}}
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
<!-- Categories below this line, please; interwikis at Wikidata -->
  
 
}}</includeonly>
 
}}</includeonly>

Revision as of 13:56, 8 January 2020

This is a utility template for labelling cladograms made with the {{clade}} template. In particular it is for use with |labelN= and |sublabelN= to enable long labels without stretching the cladogram horizontally.

Usage

{{clade label|long label that doesn't stretch the cladogram}}

This returns a label in a div element that is positioned absolutely against the right edge of a parent div element.

Example

DescriptionCodeOutput
Simple long |sublabel=
{{clade 
|label1=root
|1={{clade
   |1=Leaf 1 
   |2={{clade
      |1=Leaf 2  
      |sublabel2={{clade label|long label that stretches the cladogram}}
      |2={{clade
         |1=Leaf 3  
         |2=Leaf 4 
         }}
      }}
   }}
}}
root

Leaf 1

Leaf 2 

Leaf 3 

Leaf 4

long label that stretches the cladogram

Use of {{clade label}}
{{clade |style=float:right;
|label1=root
|1={{clade
   |1=Leaf 1 
   |2={{clade
      |1=Leaf 2  
      |sublabel2={{clade label|long label that doesn't stretch the cladogram}}
      |2={{clade
         |1=Leaf 3  
         |2=Leaf 4 
         }}
      }}
   }}
}}
root

Leaf 1

Leaf 2 

Leaf 3 

Leaf 4

long label that doesn't stretch the cladogram