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

From blackwiki
Jump to navigation Jump to search
imported>Jts1882
(uses testcases for examples →‎Examples:)
imported>Jts1882
 
Line 4: Line 4:
  
 
*{{para|page}} – the page name containing the target section or cladogram.
 
*{{para|page}} – the page name containing the target section or cladogram.
*{{para|section}} &ndash; get a named section. This works like <code><nowiki>{{#section}}</nowiki></code> and retrieved sections marked with  <code><nowiki><section begin=NAME /></nowiki></code> and  <code><nowiki><section end=NAME /></nowiki></code>
+
*{{para|section}} &ndash; get a named section. This works like <code><nowiki>{{#section}}</nowiki></code> and retrieves sections marked with  <code><nowiki><section begin=NAME /></nowiki></code> and  <code><nowiki><section end=NAME /></nowiki></code>
*{{para|label}} &ndash; get a subclade associated with {{para|labelN}} and {{para|N}} in a cladegram.  
+
*{{para|label}} &ndash; select a subtree associated with {{para|labelN}} and {{para|N}} parameters from a larger cladogram.  
*{{para|subtree}} &ndash; get a subtree associated with {{para|targetX}} and {{para|subcladeX}} in a cladegram.
+
*{{para|subtree}} &ndash; select the subtree associated with {{para|targetX}} and {{para|subcladeX}} from a larger cladogram.
 
*{{para|wrap}} &ndash; wraps a subclade retrieved with {{para|section}} in a {{tl|clade}} template. The label for the root of the tree is the section name if {{para|wrap}} used purely as a flag or {{para|wrap|VALUE}} if a value provided.
 
*{{para|wrap}} &ndash; wraps a subclade retrieved with {{para|section}} in a {{tl|clade}} template. The label for the root of the tree is the section name if {{para|wrap}} used purely as a flag or {{para|wrap|VALUE}} if a value provided.
*{{para|xsection}} &ndash;  
+
*{{para|exclude}}, {{para|exclude2}}, etc. &ndash; prunes a subclade from the selected subtree
*{{para|xlabel}} &ndash;
+
*{{para|replace}}, {{para|replace2}}, etc  &ndash; replacement content for the corresponding pruned element.
*{{para|xsubtree}} &ndash;
 
  
 
==Examples:==
 
==Examples:==

Latest revision as of 15:44, 14 November 2019

This template can partially transclude marked sections and subclades from cladograms contructed with the {{clade}} template. The template and module were written with{{clade}} cladograms in mind, but the section option works with any page.

Parameters:

  • |page= – the page name containing the target section or cladogram.
  • |section= – get a named section. This works like {{#section}} and retrieves sections marked with <section begin=NAME /> and <section end=NAME />
  • |label= – select a subtree associated with |labelN= and |N= parameters from a larger cladogram.
  • |subtree= – select the subtree associated with |targetX= and |subcladeX= from a larger cladogram.
  • |wrap= – wraps a subclade retrieved with |section= in a {{clade}} template. The label for the root of the tree is the section name if |wrap= used purely as a flag or |wrap=VALUE if a value provided.
  • |exclude=, |exclude2=, etc. – prunes a subclade from the selected subtree
  • |replace=, |replace2=, etc – replacement content for the corresponding pruned element.

Examples:

Examples of selection transclusion for a larger cladogram

DescriptionCodeOutput
Label
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |label=Commelinids
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.
Label
(with subtree)
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |label=Fabids
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.
Subtree
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |subtree=SUPERROSIDS
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.
Section
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |section=Lamiids
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.
Label
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |label=Eudicots
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.
Label
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |label=EUDICOTS
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.

Examples with pruning

DescriptionCodeOutput
Subtree
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |subtree=SUPERROSIDS
   |exclude=Malvids
   |replace=Malvid clade pruned
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.
Label

(Eudicots pruned)
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |label=Eudicots
   |exclude=Superrosids
   |replace=Superrosids clade pruned
   |exclude2=Superasterids
   |replace2=Superasterids clade pruned
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.
Subtree

(EUDICOTS pruned)
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |subtree=EUDICOTS
   |exclude=Malvids
   |replace=Malvid clade pruned
   |exclude2=Fabids
   |replace2=Fabid clade pruned
   |exclude3=Lamiids
   |replace3=Lamiid clade pruned
   |exclude4=Campanulids
   |replace4=Campanulids clade pruned 
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.
Subtree

(basal tree)
{{Clade transclude
   |page=Template:Phylogeny/APG IV
   |label=Angiosperms
   |exclude=Magnoliids
   |replace=Magnoliids clade pruned
   |exclude2=Monocots
   |replace2=Monocots clade pruned
   |exclude3=Eudicots
   |replace3=Eudicots clade pruned
   |wrap=
}}
Page with title "Template:Phylogeny/APG IV" not found.

Note that in the last example the Angiosperm tree must be pruned or an expansion depth limit is exceeded. This is because this template recontructs the whole tree before processing. If the whole tree is wanted call the {{Phylogeny/APG IV}} template directly.

More examples at: