Difference between revisions of "Template:ListEdgesWIP"
From AtlasWiki
(fixing colspan again) |
(Copy of latest version from ListEdges) |
||
Line 6: | Line 6: | ||
| format=array | | format=array | ||
| headers=hide | | headers=hide | ||
− | |||
| 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: | ||
− | [ | + | [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|  |
− | {{!}}|var| | + | {{!}}- |
+ | {{!}}|var|{{#arraydefine:edgeRelationships|var|<PROP>|}}{{#arraydefine:relationships|{{#arrayindex:edgeRelationships|1}}|<MANY>|}}{{#arrayprint:relationships|  | ||
+ | {{!}}- | ||
+ | {{!}}|@@@@|[[{{#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 | ||
− | |||
| 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|  |
− | {{!}}|var| | + | {{!}}- |
+ | {{!}}|var|{{#arraydefine:edgeRelationships|var|<PROP>|}}{{#arraydefine:relationships|{{#arrayindex:edgeRelationships|1}}|<MANY>|}}{{#arrayprint:relationships|  | ||
+ | {{!}}- | ||
+ | {{!}}|@@@@|[[{{#arrayindex:edgeRelationships|0}}]] {{!}}{{!}} [[{{#explode:@@@@|$SEP$|0}}]] {{!}}{{!}} {{#explode:@@@@|$SEP$|1}} {{!}}{{!}} {{ReconstructLinks|{{#explode:@@@@|$SEP$|2}}}} }} }} | ||
{{!}}} | {{!}}} | ||
}}<noinclude><!-- | }}<noinclude><!-- | ||
Line 76: | Line 86: | ||
{{#arrayprint:parents||@@@@|  | {{#arrayprint:parents||@@@@|  | ||
{{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.