Difference between revisions of "Template:Family tree"
Line 264: | Line 264: | ||
{{family tree | JOE | | ME | | SIS | | | JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}} | {{family tree | JOE | | ME | | SIS | | | JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}} | ||
{{family tree/end}} | {{family tree/end}} | ||
+ | |||
+ | |||
+ | |||
+ | == Parameters == | ||
+ | The {{para|summary|<var>text</var>}} parameter of the {{tl|family tree/start}} template should be used to describe the overall layout of the tree. This summary is for [[Wikipedia:Accessibility|accessibility]]: it is read aloud to visually impaired readers who use [[screen reader]]s, and is invisible to sighted readers. | ||
+ | |||
+ | The {{tl|family tree}} template produces one row in a family tree table. The template accepts up to 80 unnamed parameters describing the contents of the table. Each parameter specifies a '''tile''' or a '''box'''. | ||
+ | * '''Tiles''' are line drawing symbols consisting of horizontal and vertical lines and various corners and crossings thereof. Tiles are specified using single-character symbols that more or less approximate the shape of the tile in appearance. A special case of a tile is the '''empty tile''', specified by a single space character. A table of supported tiles is given below. | ||
+ | |||
+ | {|style="float:left;margin-left:1em" | ||
+ | |+ '''Solid lines:''' | ||
+ | |- | ||
+ | | {{big|<code>,</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|,}}{{family tree/end}} | ||
+ | | {{big|<code>v</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|v}}{{family tree/end}} | ||
+ | | {{big|<code>.</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|.}}{{family tree/end}} | ||
+ | |- | ||
+ | | {{big|<code>)</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|)}}{{family tree/end}} | ||
+ | | {{big|<code>+</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|+}}{{family tree/end}} | ||
+ | | {{big|<code>(</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|(}}{{family tree/end}} | ||
+ | |- | ||
+ | | {{big|<code>`</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|`}}{{family tree/end}} | ||
+ | | {{big|<code>^</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|^}}{{family tree/end}} | ||
+ | | {{big|<code>'</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|'}}{{family tree/end}} | ||
+ | |- | ||
+ | | {{big|<code>-</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|-}}{{family tree/end}} | ||
+ | | {{big|<code>!</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|!}}{{family tree/end}} | ||
+ | | {{big|<code> </code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree| }}{{family tree/end}} | ||
+ | |} | ||
+ | {| style="float:left;margin-left:1em" | ||
+ | |+ '''Dashed lines:''' | ||
+ | |- | ||
+ | | {{big|<code>F</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|F}}{{family tree/end}} | ||
+ | | {{big|<code>V</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|V}}{{family tree/end}} | ||
+ | | {{big|<code>7</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|7}}{{family tree/end}} | ||
+ | |- | ||
+ | | {{big|<code>D</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|D}}{{family tree/end}} | ||
+ | | {{big|<code>%</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|%}}{{family tree/end}} | ||
+ | | {{big|<code>C</code>}} ||style="border:1px solid gray"| {{family tree/start}}{{family tree|C}}{{family tree/end}} | ||
+ | |- | ||
+ | | {{big|<code>L</code>}} ||style="border: 1px solid gray"| {{familytree/start}}{{familytree|L}}{{familytree/end}} | ||
+ | | {{big|<code>A</code>}} ||style="border: 1px solid gray"| {{familytree/start}}{{familytree|A}}{{familytree/end}} | ||
+ | | {{big|<code>J</code>}} ||style="border: 1px solid gray"| {{familytree/start}}{{familytree|J}}{{familytree/end}} | ||
+ | |- | ||
+ | | {{big|<code>~</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|~}}{{familytree/end}} | ||
+ | | {{big|<code>:</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|:}}{{familytree/end}} | ||
+ | | {{big|<code> </code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree| }}{{familytree/end}} | ||
+ | |} | ||
+ | {|style="float:left;margin-left:1em" | ||
+ | |+ '''Mixed (1):''' | ||
+ | |- | ||
+ | | {{big|<code>r</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|r}}{{familytree/end}} | ||
+ | | {{big|<code>y</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|y}}{{familytree/end}} | ||
+ | | {{big|<code>n</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|n}}{{familytree/end}} | ||
+ | |- | ||
+ | | {{big|<code>]</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|]}}{{familytree/end}} | ||
+ | | {{big|<code>#</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|#}}{{familytree/end}} | ||
+ | | {{big|<code>[</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|[}}{{familytree/end}} | ||
+ | |- | ||
+ | | {{big|<code>c</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|c}}{{familytree/end}} | ||
+ | | {{big|<code>h</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|h}}{{familytree/end}} | ||
+ | | {{big|<code>j</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|j}}{{familytree/end}} | ||
+ | |- | ||
+ | | {{big|<code>~</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|~}}{{familytree/end}} | ||
+ | | {{big|<code>!</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|!}}{{familytree/end}} | ||
+ | | {{big|<code> </code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree| }}{{familytree/end}} | ||
+ | |} | ||
+ | {|style="float:left;margin-left:1em" | ||
+ | |+ '''Mixed (2):''' | ||
+ | |- | ||
+ | | {{big|<code>p</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|p}}{{familytree/end}} | ||
+ | | {{big|<code>u</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|u}}{{familytree/end}} | ||
+ | | {{big|<code>q</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|q}}{{familytree/end}} | ||
+ | |- | ||
+ | | {{big|<code>E</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|E|}}{{familytree/end}} | ||
+ | | {{big|<code>*</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|*}}{{familytree/end}} | ||
+ | | {{big|<code>3</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|3|}}{{familytree/end}} | ||
+ | |- | ||
+ | | {{big|<code>b</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|b}}{{familytree/end}} | ||
+ | | {{big|<code>t</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|t|}}{{familytree/end}} | ||
+ | | {{big|<code>d</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|d}}{{familytree/end}} | ||
+ | |- | ||
+ | | {{big|<code>-</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|-}}{{familytree/end}} | ||
+ | | {{big|<code>:</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|:}}{{familytree/end}} | ||
+ | | {{big|<code> </code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree| }}{{familytree/end}} | ||
+ | |} | ||
+ | {|style="float:left;margin-left:1em" | ||
+ | |+ '''Misc.:'''<!-- this subset is an insufficient set or questionable: --> | ||
+ | |- | ||
+ | | || | ||
+ | | {{big|<code>T</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|T}}{{familytree/end}} | ||
+ | |- | ||
+ | | {{big|<code>G</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|G}}{{familytree/end}} | ||
+ | | {{big|<code>X</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|X}}{{familytree/end}} | ||
+ | | {{big|<code>K</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|K}}{{familytree/end}} | ||
+ | | {{big|<code>k</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|k}}{{familytree/end}} | ||
+ | |- | ||
+ | | || | ||
+ | | {{big|<code>U</code>}} ||style="border:1px solid gray"| {{familytree/start}}{{familytree|U}}{{familytree/end}} | ||
+ | |} | ||
+ | {{clear left}} | ||
+ | * '''Boxes''' can contain arbitrary [[wiki markup]]. The contents of boxes are specified using additional named parameters appended to the template call. Each box is '''three tiles wide''' and normally has a 2 pixels wide black border. Boxes can have any name that is a valid template parameter name, although single character names should be avoided to prevent conflicts with tile symbols. | ||
+ | |||
[[Category:Template]] | [[Category:Template]] | ||
</noinclude> | </noinclude> |
Revision as of 05:14, 20 July 2019
Documentation
This is a template for rendering simple family trees or diagrams consisting of boxes and connecting lines based on an ASCII art-like syntax. The trees are displayed as HTML tables using Cascading Style Sheets attributes, and may contain arbitrary wiki markup within the boxes.
Example usage
This code:
{{family tree/start |summary=I have a brother Joe and a little sister: my mom married my dad, and my dad's parents were Grandma and Grandpa; they had another child, Aunt Daisy.}} {{family tree | | | | GMa |~|y|~| GPa | | GMa=Gladys|GPa=Sydney}} {{family tree | | | | | | | |)|-|-|-|.| }} {{family tree | | | MOM |y| DAD | |DAISY| MOM=Mom|DAD=Dad|DAISY=[[Aunt Daisy]]}} {{family tree | |,|-|-|-|+|-|-|-|.| | | }} {{family tree | JOE | | ME | | SIS | | | JOE=My brother Joe|ME='''Me!'''|SIS=My little sister}} {{family tree/end}}
Produces this:
Gladys | Sydney | ||||||||||||||||||||||||
Mom | Dad | Aunt Daisy | |||||||||||||||||||||||
My brother Joe | Me! | My little sister | |||||||||||||||||||||||
Parameters
The Template:Para parameter of the Template:Tl template should be used to describe the overall layout of the tree. This summary is for accessibility: it is read aloud to visually impaired readers who use screen readers, and is invisible to sighted readers.
The Template:Tl template produces one row in a family tree table. The template accepts up to 80 unnamed parameters describing the contents of the table. Each parameter specifies a tile or a box.
- Tiles are line drawing symbols consisting of horizontal and vertical lines and various corners and crossings thereof. Tiles are specified using single-character symbols that more or less approximate the shape of the tile in appearance. A special case of a tile is the empty tile, specified by a single space character. A table of supported tiles is given below.
, |
|
v |
|
. |
| ||||||||||||
) |
|
+ |
|
( |
| ||||||||||||
` |
|
^ |
|
' |
| ||||||||||||
- |
|
! |
|
|
|
r |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | y |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | n |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
] |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | # |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | [ |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
c |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | h |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | j |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
~ |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | ! |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
p |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | u |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | q |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
E |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | * |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | 3 |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
b |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | t |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | d |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
- |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | : |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
T |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | ||||||
G |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | X |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | K |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end | k |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
U |
Template:Familytree/startTemplate:FamilytreeTemplate:Familytree/end |
- Boxes can contain arbitrary wiki markup. The contents of boxes are specified using additional named parameters appended to the template call. Each box is three tiles wide and normally has a 2 pixels wide black border. Boxes can have any name that is a valid template parameter name, although single character names should be avoided to prevent conflicts with tile symbols.