Difference between revisions of "Template:ListEdges.generateTable"

From AtlasWiki
Jump to: navigation, search
(add links to inherited portion of table)
(Add "pipe trick" to edge links, to avoid the "XCSG:" junk (also removes the "(Edge)" stuff...not certain we want that, but at least less of a concern that the "XCSG:" junk))
Line 56: Line 56:
 
{{!}}{{#arrayprint:uninheritedEdges| 
 
{{!}}{{#arrayprint:uninheritedEdges| 
 
{{!}}-
 
{{!}}-
{{!}}|var|{{#arraydefine:edgeRelationships|var|<PROP>|}}{{#arraydefine:relationships|{{#arrayindex:edgeRelationships|1}}|<MANY>|}} rowspan="{{#arraysize:relationships}}" {{!}} [[{{#arrayindex:edgeRelationships|0}}]]  {{!}}{{!}}  [[{{#explode:{{#arrayindex:relationships|0}}|$SEP$|0}}]]  {{!}}{{!}} {{#explode:{{#arrayindex:relationships|0}}|$SEP$|1}} {{!}}{{!}} rowspan="{{#arraysize:relationships}}" {{!}} {{ReconstructLinks|{{#explode:{{#arrayindex:relationships|0}}|$SEP$|2}}}} {{#arrayslice:relationships|relationships|1}} {{#arrayprint:relationships||@@@@|&#32;
+
{{!}}|var|{{#arraydefine:edgeRelationships|var|<PROP>|}}{{#arraydefine:relationships|{{#arrayindex:edgeRelationships|1}}|<MANY>|}} rowspan="{{#arraysize:relationships}}" {{!}} [[{{#arrayindex:edgeRelationships|0}}]]  {{!}}{{!}}  [[{{#explode:{{#arrayindex:relationships|0}}|$SEP$|0}}|]]  {{!}}{{!}} {{#explode:{{#arrayindex:relationships|0}}|$SEP$|1}} {{!}}{{!}} rowspan="{{#arraysize:relationships}}" {{!}} {{ReconstructLinks|{{#explode:{{#arrayindex:relationships|0}}|$SEP$|2}}}} {{#arrayslice:relationships|relationships|1}} {{#arrayprint:relationships||@@@@|&#32;
 
{{!}}-
 
{{!}}-
 
{{!}} [[{{#explode:@@@@|$SEP$|0}}]] {{!}}{{!}} {{#explode:@@@@|$SEP$|1}} }} }} }}
 
{{!}} [[{{#explode:@@@@|$SEP$|0}}]] {{!}}{{!}} {{#explode:@@@@|$SEP$|1}} }} }} }}
Line 65: Line 65:
 
{{!}}{{#arrayprint:inheritedEdges|&#32;
 
{{!}}{{#arrayprint:inheritedEdges|&#32;
 
{{!}}-
 
{{!}}-
{{!}} |@@@@| {{#arraydefine:edges|{{#explode:@@@@|<PARENT>|1}}|<EDGE_SEP>|}} rowspan="{{#expr:{{#arrayprint:edges|+|####|{{#arraydefine:findSize|####|<MANY>}}{{#arraysize:findSize}}}}}}" {{!}} [[{{#explode:@@@@|<PARENT>|0}}]] {{!}}{{!}} {{#arraydefine:firstEdge|{{#arrayindex:edges|0}}|<EDGE_PROP>}} {{#arraydefine:firstOrigins|{{#arrayindex:firstEdge|2}}|<MANY>}} rowspan="{{#arraysize:firstOrigins}}" {{!}} [[{{#arrayindex:firstEdge|0}}]] {{!}}{{!}} [[{{#explode:{{#arrayindex:firstOrigins|0}}|<VAL>|0}}]] {{!}}{{!}} {{#explode:{{#arrayindex:firstOrigins|0}}|<VAL>|1}} {{!}}{{!}} rowspan="{{#arraysize:firstOrigins}}" {{!}} {{#arrayindex:firstEdge|1}} {{#arrayslice:restOfFirstOrigins|firstOrigins|1}} {{#arrayprint:restOfFirstOrigins||$$$$|&#32;
+
{{!}} |@@@@| {{#arraydefine:edges|{{#explode:@@@@|<PARENT>|1}}|<EDGE_SEP>|}} rowspan="{{#expr:{{#arrayprint:edges|+|####|{{#arraydefine:findSize|####|<MANY>}}{{#arraysize:findSize}}}}}}" {{!}} [[{{#explode:@@@@|<PARENT>|0}}]] {{!}}{{!}} {{#arraydefine:firstEdge|{{#arrayindex:edges|0}}|<EDGE_PROP>}} {{#arraydefine:firstOrigins|{{#arrayindex:firstEdge|2}}|<MANY>}} rowspan="{{#arraysize:firstOrigins}}" {{!}} [[{{#arrayindex:firstEdge|0}}|]] {{!}}{{!}} [[{{#explode:{{#arrayindex:firstOrigins|0}}|<VAL>|0}}]] {{!}}{{!}} {{#explode:{{#arrayindex:firstOrigins|0}}|<VAL>|1}} {{!}}{{!}} rowspan="{{#arraysize:firstOrigins}}" {{!}} {{#arrayindex:firstEdge|1}} {{#arrayslice:restOfFirstOrigins|firstOrigins|1}} {{#arrayprint:restOfFirstOrigins||$$$$|&#32;
 
{{!}}-
 
{{!}}-
 
{{!}} [[{{#explode:$$$$|<VAL>|0}}]] {{!}}{{!}} {{#explode:$$$$|<VAL>|1}} }} {{#arrayslice:restOfEdges|edges|1}}
 
{{!}} [[{{#explode:$$$$|<VAL>|0}}]] {{!}}{{!}} {{#explode:$$$$|<VAL>|1}} }} {{#arrayslice:restOfEdges|edges|1}}
 
{{#arrayprint:restOfEdges||####|&#32;
 
{{#arrayprint:restOfEdges||####|&#32;
 
{{!}}-
 
{{!}}-
{{!}}{{#arraydefine:edge|####|<EDGE_PROP>}} {{#arraydefine:origins|{{#arrayindex:edge|2}}|<MANY>}} rowspan="{{#arraysize:origins}}" {{!}} [[{{#arrayIndex:edge|0}}]] {{!}}{{!}} [[{{#explode:{{#arrayindex:origins|0}}|<VAL>|0}}]] {{!}}{{!}} {{#explode:{{#arrayindex:origins|0}}|<VAL>|1}} {{!}}{{!}} rowspan="{{#arraysize:origins}}" {{!}} {{#arrayIndex:edge|1}}
+
{{!}}{{#arraydefine:edge|####|<EDGE_PROP>}} {{#arraydefine:origins|{{#arrayindex:edge|2}}|<MANY>}} rowspan="{{#arraysize:origins}}" {{!}} [[{{#arrayIndex:edge|0}}|]] {{!}}{{!}} [[{{#explode:{{#arrayindex:origins|0}}|<VAL>|0}}]] {{!}}{{!}} {{#explode:{{#arrayindex:origins|0}}|<VAL>|1}} {{!}}{{!}} rowspan="{{#arraysize:origins}}" {{!}} {{#arrayIndex:edge|1}}
 
{{#arrayslice:restOfOrigins|origins|1}} {{#arrayprint:restOfOrigins||$$$$|{{!}}-
 
{{#arrayslice:restOfOrigins|origins|1}} {{#arrayprint:restOfOrigins||$$$$|{{!}}-
 
{{!}} [[{{#explode:$$$$|<VAL>|0}}]] {{!}}{{!}} {{#explode:$$$$|<VAL>|1}} }} }} }} }}
 
{{!}} [[{{#explode:$$$$|<VAL>|0}}]] {{!}}{{!}} {{#explode:$$$$|<VAL>|1}} }} }} }} }}
 
{{!}}}
 
{{!}}}
 
}}
 
}}

Revision as of 14:22, 12 May 2014

Requires five parameters:

title: the main title of the table, e.g. "Specified In Edges"

edgeTitle: the header to place above the edges column of the table, e.g. "In Edge"

nodeTitle: the header to place above the related node column of the table, e.g. "Origin"

uninheritedEdges: a list of edges which have a relationship specified with the node this table is being generated for

inheritedEdges: a list of edges which have a relationship specified with a parent of this node kind