Difference between revisions of "Test matrix"
From FollowTheScore
MrDolomite (talk | contribs) m (→Links to DPL Manual pages: add link to Test matrix2) |
MrDolomite (talk | contribs) m (→generating a matrix from an indented list: rm whitespace from input list) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
one | one | ||
oho | oho | ||
− | |||
− | |||
aha | aha | ||
two ~~ Two | two ~~ Two | ||
Line 18: | Line 16: | ||
two ~~ Two | two ~~ Two | ||
uhui ~~ UHU | uhui ~~ UHU | ||
+ | |||
Output is: | Output is: | ||
{|class=wikitable | {|class=wikitable | ||
!normal | !normal | ||
!flipped | !flipped | ||
+ | |-- | ||
+ | |<pre>{{#dplmatrix:a simple demo matrix|||| | ||
+ | one | ||
+ | oho | ||
+ | aha | ||
+ | two ~~ Two | ||
+ | ehem | ||
+ | three | ||
+ | four | ||
+ | aha | ||
+ | uhui ~~ UHU | ||
+ | two ~~ Two | ||
+ | uhui ~~ UHU | ||
+ | }}</pre> | ||
+ | |<pre>{{#dplmatrix:a simple demo matrix|<big>•</big>|.|flip| | ||
+ | one | ||
+ | oho | ||
+ | aha | ||
+ | two ~~ Two | ||
+ | ehem | ||
+ | three | ||
+ | four | ||
+ | aha | ||
+ | uhui ~~ UHU | ||
+ | two ~~ Two | ||
+ | uhui ~~ UHU | ||
+ | }}</pre> | ||
|-- | |-- | ||
| | | | ||
Line 27: | Line 53: | ||
one | one | ||
oho | oho | ||
− | |||
− | |||
− | |||
aha | aha | ||
two ~~ Two | two ~~ Two | ||
Line 66: | Line 89: | ||
===Links to DPL Manual pages=== | ===Links to DPL Manual pages=== | ||
Now we use two nested DPL queries and [[Test matrix2]] to generate the indented list: | Now we use two nested DPL queries and [[Test matrix2]] to generate the indented list: | ||
+ | <pre> | ||
+ | {{#dplmatrix:''links from articles to the DPL manual''|'''x'''|-|flip| | ||
+ | {{#dpl: | ||
+ | |debug=1 | ||
+ | |category=DPL Manual | ||
+ | |format=,%PAGE% ~~ %TITLE%\n²{:Test matrix2¦page=%PAGE%¦category=DPL Manual¦namespace=}², | ||
+ | }} | ||
+ | }} | ||
+ | </pre> | ||
+ | |||
{{#dplmatrix:''links from articles to the DPL manual''|'''x'''|-|flip| | {{#dplmatrix:''links from articles to the DPL manual''|'''x'''|-|flip| | ||
{{#dpl: | {{#dpl: |
Latest revision as of 03:29, 17 July 2008
Test | matrix |
generating a matrix from an indented list
Input is:
one oho aha two ~~ Two ehem three four aha uhui ~~ UHU two ~~ Two uhui ~~ UHU
Output is:
normal | flipped | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{#dplmatrix:a simple demo matrix|||| one oho aha two ~~ Two ehem three four aha uhui ~~ UHU two ~~ Two uhui ~~ UHU }} |
{{#dplmatrix:a simple demo matrix|<big>•</big>|.|flip| one oho aha two ~~ Two ehem three four aha uhui ~~ UHU two ~~ Two uhui ~~ UHU }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
- "from" items ("source") start in col 1
- "to" items ("target") are indented by at least one space
- source appears in input sequence
- target is sorted by alphabet
- items are treated as pages and shown as a link
- the label can be defined by adding it after the iterm, separated by "~~"
- symbols for "yes" and "no" can be defined
- via the stylesheet in Mediawiki:Common.css you can control the layout (class=dplmatrix)
Links to DPL Manual pages
Now we use two nested DPL queries and Test matrix2 to generate the indented list:
{{#dplmatrix:''links from articles to the DPL manual''|'''x'''|-|flip| {{#dpl: |debug=1 |category=DPL Manual |format=,%PAGE% ~~ %TITLE%\n²{:Test matrix2¦page=%PAGE%¦category=DPL Manual¦namespace=}², }} }}