Difference between revisions of "Template:ListEdgesWIP"

From AtlasWiki
Jump to: navigation, search
(fixing colspan again)
(Copy of latest version from ListEdges)
Line 6: Line 6:
 
| format=array
 
| format=array
 
| headers=hide
 
| headers=hide
| propsep=$SEP$
 
 
| name=inEdges
 
| name=inEdges
 
}}<noinclude><!--
 
}}<noinclude><!--
Line 14: Line 13:
 
Each entry in the array is in this format:
 
Each entry in the array is in this format:
  
[link to edge]$SEP$[name of predecessor]$SEP$[multiplicity]$SEP$[edge description])
+
[name of edge]<PROP>[name of predecessor]$SEP$[multiplicity]$SEP$[edge description]
 +
 
 +
...except that, if there are multiple entries from the same edge, they will be separated by "<MANY>",
 +
and the name of the edge will not be repeated, i.e., if there are two possible predecessors for a specific
 +
edge type, the format will be:
 +
 
 +
[name of edge]<PROP>[name of predecessor]$SEP$[multiplicity]$SEP$[edge description]<MANY>[name of other predecessor]$SEP$[multiplicity]
  
 
...now we parse those into an "In Edge" table, if and only if there is at least one in edge:
 
...now we parse those into an "In Edge" table, if and only if there is at least one in edge:
  
--></noinclude>{{#switch:{{#arraysize:inEdges}}| 0 = | #default =  
+
--></noinclude>{{#switch:{{#arraysize:inEdges}}| 0 = | #default =
 
{{{!}} class="xcsgtable"
 
{{{!}} class="xcsgtable"
 
! In Edge !! Predecessor (Comes From) !! Multiplicity !! Description
 
! In Edge !! Predecessor (Comes From) !! Multiplicity !! Description
 
{{!}}-
 
{{!}}-
{{!}}{{#arrayprint:inEdges|{{!}}-
+
{{!}}{{#arrayprint:inEdges|&#32;
{{!}}|var|[[{{#explode:var|$SEP$|0}}]] {{!}}{{!}} [[{{#explode:var|$SEP$|1}}]] {{!}}{{!}} {{#explode:var|$SEP$|2}} {{!}}{{!}} {{ReconstructLinks|{{#explode:var|$SEP$|3}}}} }}
+
{{!}}-
 +
{{!}}|var|{{#arraydefine:edgeRelationships|var|<PROP>|}}{{#arraydefine:relationships|{{#arrayindex:edgeRelationships|1}}|<MANY>|}}{{#arrayprint:relationships|&#32;
 +
{{!}}-
 +
{{!}}|@@@@|[[{{#arrayindex:edgeRelationships|0}}]] {{!}}{{!}} [[{{#explode:@@@@|$SEP$|0}}]] {{!}}{{!}} {{#explode:@@@@|$SEP$|1}} {{!}}{{!}} {{ReconstructLinks|{{#explode:@@@@|$SEP$|2}}}} }} }}
 
{{!}}}  
 
{{!}}}  
 
}}<noinclude><!--
 
}}<noinclude><!--
Line 45: Line 53:
 
| format=array
 
| format=array
 
| headers=hide
 
| headers=hide
| propsep=$SEP$
 
 
| name=outEdges
 
| name=outEdges
 
}}<noinclude><!--
 
}}<noinclude><!--
Line 57: Line 64:
 
We print the out edges table:
 
We print the out edges table:
  
--></noinclude>{{#switch:{{#arraysize:outEdges}}| 0 = | #default =  
+
--></noinclude>{{#switch:{{#arraysize:outEdges}}| 0 = | #default =
 
{{{!}} class="xcsgtable"
 
{{{!}} class="xcsgtable"
 
! Out Edge !! Successor (Points To) !! Multiplicity !! Description
 
! Out Edge !! Successor (Points To) !! Multiplicity !! Description
 
{{!}}-
 
{{!}}-
{{!}}{{#arrayprint:outEdges|{{!}}-
+
{{!}}{{#arrayprint:outEdges|&#32;
{{!}}|var|[[{{#explode:var|$SEP$|0}}]] {{!}}{{!}} [[{{#explode:var|$SEP$|1}}]] {{!}}{{!}} {{#explode:var|$SEP$|2}} {{!}}{{!}} {{ReconstructLinks|{{#explode:var|$SEP$|3}}}} }}
+
{{!}}-
 +
{{!}}|var|{{#arraydefine:edgeRelationships|var|<PROP>|}}{{#arraydefine:relationships|{{#arrayindex:edgeRelationships|1}}|<MANY>|}}{{#arrayprint:relationships|&#32;
 +
{{!}}-
 +
{{!}}|@@@@|[[{{#arrayindex:edgeRelationships|0}}]] {{!}}{{!}} [[{{#explode:@@@@|$SEP$|0}}]] {{!}}{{!}} {{#explode:@@@@|$SEP$|1}} {{!}}{{!}} {{ReconstructLinks|{{#explode:@@@@|$SEP$|2}}}} }} }}
 
{{!}}}  
 
{{!}}}  
 
}}<noinclude><!--
 
}}<noinclude><!--
Line 76: Line 86:
 
{{#arrayprint:parents||@@@@|&#32;
 
{{#arrayprint:parents||@@@@|&#32;
 
{{InheritEdgesFrom|@@@@}}}}
 
{{InheritEdgesFrom|@@@@}}}}
{{!}}} }} }}
+
{{!}}} }} }}<noinclude>[[Category:XCSG Templates]]</noinclude>

Revision as of 17:15, 7 May 2014

For use on node kind pages, automatically lists edges declared on the current page.

If the parameter "parents" is given a comma-separated list of the parents of the node, inherited edges will also be listed.