Template:Clade converter/doc

Wikitext list converter
Converts a list in wikitext marker to the clade structure. The list must be wrapped in  tags.

Alternatively invoke function directly:


 * produces

Newick converter
Convert simple Newick strings to the clade structure. This is a tool to aid construction of cladograms using the clade template and not for use directly in the article namespace.

Parameters

 * newickstring – the Newick format data to be converted
 * indent – optionally set an indent, which will indent every line by N spaces. This can help alignment in the final cladogram.

Example
The following code

produces the output below



Processing the Newick string
The Newick format data provided Open Tree of Life and other sources typically has extraneous encoding data. This extra information can be removed using the newickN-pattern and newickN-replace parameters which supply a Lua pattern (similar to Regex) and replacement. The following code uses Newick format data for the genus Prionailurus downloaded from using Open Tree of Life (source data):

produces



In this example there are two replacements. The first strips the _ott suffix and applies Wikitext markup. Note the Wikitext markup has to be handled with a template The second abbreviates the genus name when not standalone. In addition, underscores are always replaced by spaces.

List Converter
Converts a Wikitext-like list to a clade structure. The list uses the symbol @ as the * would be processed as Wikitext.

Example
The following illustrates the code and the desired output: